/**
 * Hittegodscentralen Users - CSS
 * Farvetema matcher hittegodscentralen.dk
 * Alt kan overstyres i Divi Builder!
 */

/* =============================================
   FARVE VARIABLER - Brug disse i Divi
   ============================================= */
:root {
    /* Primære */
    --hg-primary: #1e3a5f;
    --hg-dark: #1a4d5c;
    
    /* Tabt - Orange/koral */
    --hg-tabt: #e8956c;
    --hg-tabt-light: #f5c4a8;
    --hg-tabt-gradient: linear-gradient(135deg, #e8956c 0%, #d4a574 100%);
    
    /* Fundet - Turkis/mint */
    --hg-fundet: #7ecec2;
    --hg-fundet-light: #b8e5df;
    --hg-fundet-gradient: linear-gradient(135deg, #7ecec2 0%, #5cb8aa 100%);
    
    /* Tekst */
    --hg-text: #2c3e50;
    --hg-text-muted: #6b7c8a;
    
    /* Borders & Backgrounds */
    --hg-border: #e1e8ed;
    --hg-bg: #f5f7f9;
    --hg-white: #ffffff;
    
    /* Radius - Afrundede hjørner som på websitet */
    --hg-radius: 12px;
    --hg-radius-lg: 50px;
}

/* =============================================
   BASE
   ============================================= */
.hg-hidden { display: none !important; }

/* =============================================
   ALERTS / BESKEDER
   ============================================= */
.hg-alert {
    padding: 15px 20px;
    border-radius: var(--hg-radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.hg-alert--success {
    background: var(--hg-fundet-gradient);
    color: white;
}

.hg-alert--error {
    background: var(--hg-tabt-gradient);
    color: white;
}

/* =============================================
   FORM ELEMENTER
   ============================================= */
.hg-field {
    margin-bottom: 20px;
}

.hg-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--hg-text);
    font-size: 14px;
}

.hg-input,
.hg-textarea,
.hg-select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--hg-border);
    border-radius: var(--hg-radius);
    font-size: 15px;
    font-family: inherit;
    background: var(--hg-white);
    color: var(--hg-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.hg-input:focus,
.hg-textarea:focus,
.hg-select:focus {
    outline: none;
    border-color: var(--hg-fundet);
    box-shadow: 0 0 0 4px rgba(126, 206, 194, 0.2);
}

.hg-textarea {
    min-height: 100px;
    resize: vertical;
}

.hg-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .hg-field-row { grid-template-columns: 1fr; }
}

.hg-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.hg-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--hg-fundet);
}

/* =============================================
   KNAPPER - Afrundede som på websitet
   ============================================= */
.hg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--hg-radius-lg);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.hg-btn--primary {
    background: var(--hg-primary);
    color: white;
}

.hg-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 95, 0.3);
}

.hg-btn--secondary {
    background: var(--hg-white);
    color: var(--hg-text);
    border: 2px solid var(--hg-border);
}

.hg-btn--secondary:hover {
    border-color: var(--hg-fundet);
    color: var(--hg-fundet);
}

.hg-btn--danger {
    background: var(--hg-white);
    color: var(--hg-tabt);
    border: 2px solid var(--hg-border);
}

.hg-btn--danger:hover {
    border-color: var(--hg-tabt);
    background: rgba(232, 149, 108, 0.1);
}

.hg-btn--social {
    flex: 1;
    background: var(--hg-white);
    color: var(--hg-text);
    border: 2px solid var(--hg-border);
    padding: 12px 20px;
    border-radius: var(--hg-radius);
}

.hg-btn--social:hover {
    border-color: var(--hg-primary);
}

.hg-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* =============================================
   LOGIN FORM
   ============================================= */
.hg-login-form {
    max-width: 420px;
    margin: 0 auto;
}

.hg-login-header {
    text-align: center;
    margin-bottom: 30px;
}

.hg-login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--hg-text);
    margin-bottom: 8px;
}

.hg-login-subtitle {
    color: var(--hg-text-muted);
    font-size: 15px;
}

.hg-step { /* Steps are shown/hidden via JS */ }

.hg-divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    color: var(--hg-text-muted);
    font-size: 13px;
}

.hg-divider::before,
.hg-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--hg-border);
}

.hg-divider span {
    padding: 0 15px;
}

.hg-social {
    display: flex;
    gap: 12px;
}

.hg-back {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.hg-back a {
    color: var(--hg-text-muted);
    text-decoration: none;
}

.hg-back a:hover {
    color: var(--hg-fundet);
}

.hg-link {
    color: var(--hg-fundet);
    text-decoration: none;
    font-weight: 500;
}

.hg-link:hover {
    text-decoration: underline;
}

/* =============================================
   DASHBOARD
   ============================================= */
.hg-welcome h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.hg-welcome p {
    color: var(--hg-text-muted);
    margin-bottom: 30px;
}

/* Stats */
.hg-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.hg-stat {
    background: var(--hg-white);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.hg-stat__number {
    font-size: 36px;
    font-weight: 700;
    display: block;
    color: var(--hg-text);
}

.hg-stat__label {
    font-size: 14px;
    color: var(--hg-text-muted);
}

.hg-stat--tabt { border-top: 4px solid var(--hg-tabt); }
.hg-stat--fundet { border-top: 4px solid var(--hg-fundet); }
.hg-stat--total { border-top: 4px solid var(--hg-primary); }

/* Klikbare stats */
.hg-stat--clickable {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
    display: block;
}

.hg-stat--clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.hg-stat--clickable:active {
    transform: translateY(-2px);
}

/* Actions - Store knapper som på forsiden */
.hg-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 600px) {
    .hg-actions { grid-template-columns: 1fr; }
}

.hg-action {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 32px;
    border-radius: var(--hg-radius-lg);
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.hg-action:hover {
    transform: translateY(-4px);
}

.hg-action--tabt {
    background: var(--hg-tabt-gradient);
    box-shadow: 0 8px 25px rgba(232, 149, 108, 0.4);
}

.hg-action--tabt:hover {
    box-shadow: 0 12px 35px rgba(232, 149, 108, 0.5);
}

.hg-action--fundet {
    background: var(--hg-fundet-gradient);
    box-shadow: 0 8px 25px rgba(126, 206, 194, 0.4);
}

.hg-action--fundet:hover {
    box-shadow: 0 12px 35px rgba(126, 206, 194, 0.5);
}

.hg-action__icon {
    font-size: 36px;
}

.hg-action__text strong {
    display: block;
    font-size: 18px;
    margin-bottom: 4px;
}

.hg-action__text small {
    opacity: 0.9;
    font-weight: 400;
}

/* Grid layout */
.hg-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .hg-grid { grid-template-columns: 1fr; }
}

.hg-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Cards */
.hg-card {
    background: var(--hg-white);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.hg-card__header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--hg-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hg-card__header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.hg-card__header a {
    color: var(--hg-fundet);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.hg-card__body {
    padding: 24px;
}

/* Quick links */
.hg-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hg-links li {
    border-bottom: 1px solid var(--hg-border);
}

.hg-links li:last-child {
    border-bottom: none;
}

.hg-links a {
    display: block;
    padding: 14px 24px;
    color: var(--hg-text);
    text-decoration: none;
    transition: all 0.2s;
}

.hg-links a:hover {
    background: var(--hg-bg);
    color: var(--hg-fundet);
}

/* =============================================
   BADGES
   ============================================= */
.hg-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.hg-badge--tabt {
    background: var(--hg-tabt-gradient);
    color: white;
}

.hg-badge--fundet {
    background: var(--hg-fundet-gradient);
    color: white;
}

.hg-badge--lukket {
    background: var(--hg-primary);
    color: white;
}

/* =============================================
   FILTERS - Afrundede
   ============================================= */
.hg-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.hg-filter {
    padding: 12px 24px;
    border: 2px solid var(--hg-border);
    background: var(--hg-white);
    border-radius: var(--hg-radius-lg);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--hg-text-muted);
}

.hg-filter:hover {
    border-color: var(--hg-fundet);
    color: var(--hg-fundet);
}

.hg-filter--active {
    background: var(--hg-primary);
    color: white;
    border-color: var(--hg-primary);
}

.hg-filter--tabt.hg-filter--active {
    background: var(--hg-tabt-gradient);
    border-color: var(--hg-tabt);
}

.hg-filter--fundet.hg-filter--active {
    background: var(--hg-fundet-gradient);
    border-color: var(--hg-fundet);
}

/* =============================================
   POST CARDS (Mine opslag)
   ============================================= */
.hg-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.hg-post {
    background: var(--hg-white);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: all 0.3s ease;
}

.hg-post:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.hg-post__image {
    height: 180px;
    background: var(--hg-bg);
    position: relative;
}

.hg-post__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hg-post__image .hg-badge {
    position: absolute;
    top: 12px;
    right: 12px;
}

.hg-post__body {
    padding: 20px;
}

.hg-post__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--hg-text);
}

.hg-post__meta {
    font-size: 13px;
    color: var(--hg-text-muted);
    margin-bottom: 16px;
}

.hg-post__actions {
    display: flex;
    gap: 8px;
}

.hg-post__actions .hg-btn {
    padding: 10px 18px;
    font-size: 13px;
}

/* =============================================
   PAGINATION
   ============================================= */
.hg-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.hg-page {
    width: 44px;
    height: 44px;
    border: 2px solid var(--hg-border);
    background: var(--hg-white);
    border-radius: 50%;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.hg-page:hover {
    border-color: var(--hg-fundet);
    color: var(--hg-fundet);
}

.hg-page--active {
    background: var(--hg-primary);
    color: white;
    border-color: var(--hg-primary);
}

.hg-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =============================================
   MODAL
   ============================================= */
.hg-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.hg-modal--open {
    display: flex;
}

.hg-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 58, 95, 0.6);
    backdrop-filter: blur(4px);
}

.hg-modal__box {
    position: relative;
    background: var(--hg-white);
    border-radius: 20px;
    padding: 36px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.hg-modal__box h3 {
    font-size: 22px;
    margin-bottom: 12px;
}

.hg-modal__box p {
    color: var(--hg-text-muted);
    margin-bottom: 24px;
}

.hg-modal__actions {
    display: flex;
    gap: 12px;
}

.hg-modal__actions .hg-btn {
    flex: 1;
}

/* =============================================
   SUPPORT MESSAGES
   ============================================= */
.hg-messages {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hg-message-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--hg-border);
    transition: background 0.15s;
}

.hg-message-item:hover {
    background: var(--hg-bg);
}

.hg-message-item:last-child {
    border-bottom: none;
}

.hg-message-item__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.hg-message-item__header time {
    font-size: 12px;
    color: var(--hg-text-muted);
    flex-shrink: 0;
}

.hg-message-item__content {
    font-size: 14px;
    line-height: 1.5;
    color: var(--hg-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Message type icon */
.hg-message-type {
    font-size: 14px;
    margin-right: 6px;
}

/* Unread message styling */
.hg-message-item--unread {
    background: #fffbf0;
    border-left: 3px solid var(--hg-tabt);
}

.hg-message-item--unread .hg-message-item__header strong {
    color: var(--hg-primary);
}

.hg-message-item--unread .hg-message-item__content {
    color: var(--hg-text);
}

/* Support message styling */
.hg-message-item--support {
    border-left: 3px solid var(--hg-fundet);
}

.hg-message-item--support.hg-message-item--unread {
    background: #f0faf8;
}

/* Notification badge */
.hg-badge--notification {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--hg-tabt);
    border-radius: 10px;
    margin-left: 8px;
}

.hg-message-item__reply {
    margin-top: 15px;
    padding: 15px;
    background: var(--hg-bg);
    border-radius: var(--hg-radius);
    border-left: 3px solid var(--hg-fundet);
}

.hg-message-item__reply strong {
    display: block;
    font-size: 12px;
    color: var(--hg-fundet);
    margin-bottom: 8px;
}

/* =============================================
   LOADING
   ============================================= */
.hg-loading {
    text-align: center;
    padding: 40px;
    color: var(--hg-text-muted);
}

/* =============================================
   FORM ACTIONS
   ============================================= */
.hg-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.hg-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

/* =============================================
   INLINE STATS (for helper shortcode)
   ============================================= */
.hg-stats-inline {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.hg-stat-inline {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: var(--hg-bg);
}

.hg-stat-inline--tabt { color: var(--hg-tabt); }
.hg-stat-inline--fundet { color: var(--hg-fundet); }

/* =============================================
   TABS
   ============================================= */
.hg-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--hg-border);
    padding-bottom: 10px;
}

.hg-tab {
    padding: 12px 24px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    color: var(--hg-text-muted);
    border-radius: var(--hg-radius) var(--hg-radius) 0 0;
    transition: all 0.2s;
}

.hg-tab:hover {
    color: var(--hg-text);
    background: var(--hg-bg);
}

.hg-tab--active {
    color: var(--hg-fundet);
    border-bottom: 3px solid var(--hg-fundet);
    margin-bottom: -12px;
}

.hg-tab-content {
    min-height: 200px;
}

/* =============================================
   MESSAGE ITEMS (extended)
   ============================================= */
.hg-message-item--unread {
    background: rgba(126, 206, 194, 0.1);
    border-left: 4px solid var(--hg-fundet);
}

.hg-message-item__post {
    font-size: 13px;
    color: var(--hg-text-muted);
    margin-bottom: 8px;
    padding: 4px 8px;
    background: var(--hg-bg);
    border-radius: 4px;
    display: inline-block;
}

.hg-message-item__actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.hg-btn--small {
    padding: 8px 16px;
    font-size: 13px;
}

/* =============================================
   KONTAKT BRUGER
   ============================================= */
.hg-kontakt-bruger {
    background: var(--hg-bg);
    padding: 20px;
    border-radius: var(--hg-radius);
    margin-top: 20px;
}

.hg-kontakt-bruger h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
}

/* =============================================
   REDIGER OPSLAG - Forbedret layout
   ============================================= */
.hg-edit-post {
    max-width: 1000px;
    margin: 0 auto;
}

.hg-back-link {
    color: var(--hg-fundet);
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 20px;
}

.hg-back-link:hover {
    color: var(--hg-primary);
}

.hg-edit-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .hg-edit-grid {
        grid-template-columns: 1fr;
    }
}

.hg-edit-image-section .hg-card {
    margin-bottom: 20px;
}

.hg-edit-image-preview {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--hg-radius);
    overflow: hidden;
    background: var(--hg-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hg-edit-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hg-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hg-text-muted);
    font-size: 14px;
    background: var(--hg-bg);
}

.hg-edit-gallery {
    margin-top: 15px;
}

.hg-gallery-label {
    font-size: 13px;
    color: var(--hg-text-muted);
    margin-bottom: 10px;
}

.hg-gallery-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hg-gallery-thumbs img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--hg-border);
}

.hg-edit-image-note {
    margin-top: 15px;
    font-size: 12px;
    color: var(--hg-text-muted);
    font-style: italic;
}

.hg-edit-info-section .hg-card {
    margin-bottom: 20px;
}

.hg-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.hg-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 500px) {
    .hg-field-row {
        grid-template-columns: 1fr;
    }
}
