/* ===== DNX Header (Vue parity) — de-duplicated ===== */

/* CSS variables & safe fallbacks */
:root{
    --header-height: 80px; /* Vue parity */
    --header-bg: var(--surface-header, #f2f7f4);
    --header-fg: var(--text-primary, #0d1b16);
    --header-link: var(--primary-700, #0f6a57);
    --header-link-hover: var(--primary-800, #0c5646);
    --header-hover: color-mix(in oklab, #000 6%, transparent);
    --header-border: color-mix(in oklab, var(--header-bg) 88%, #000 0%);
}

/* Outer header shell */
.app-header,
.global-header{
    position: sticky; top: 0; z-index: 50;
    background: var(--header-bg);
    color: var(--header-fg);
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    border-bottom: 1px solid var(--header-border);
    transition: background-color .2s ease, box-shadow .2s ease, border-color .2s ease;
    height: var(--header-height);
}

/* Subtle drop shadow when scrolling */
.global-header.is-scrolled{ box-shadow: 0 6px 18px rgba(0,0,0,.08); }

/* Inner container */
.navbar{ max-width: 1300px; margin: 0 auto; padding: 0 24px; border-bottom: 1px solid rgba(0,0,0,.06); }
.header-main-row{
    height: var(--header-height);
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

/* Zones */
.header-left{ display:flex; align-items:center; }
.header-center{ flex: 1 1 auto; display:flex; align-items:center; justify-content:center; gap:8px; }
.header-right{ display:flex; align-items:center; gap:12px; }

/* Logo */
.logo-container{ display:flex; align-items:center; }
.logo-dnx-image{ height: 50px; width: auto; display:block; }

/* Title */
.header-title{
    color: var(--header-fg);
    font-family: var(--font-poppins, 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif);
    font-weight: 600;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: .3px;
    text-align: center;
    margin: 0 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Desktop quick links (light header variant) */
.nav-link-primary{
    display: none; /* becomes inline-flex on md+ via .d-md-flex */
    align-items: center;
    height: 40px;
    padding: 0 10px;
    color: var(--header-link);
    text-decoration: none;
    font-weight: 600;
    border-radius: 12px;
    transition: color .15s ease, background-color .15s ease, transform .15s ease;
}
.nav-link-primary:hover{ color: var(--header-link-hover); background: transparent; }
.nav-link-primary:active{ transform: translateY(1px); }

/* Burger / icon buttons */
.icon-btn{
    width: 36px; height: 36px;
    display:inline-flex; align-items:center; justify-content:center;
    border-radius: 12px; padding: 0; border: 0;
    background: transparent; color: var(--header-fg);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
    position: relative;
}
.icon-btn:hover{ background: color-mix(in oklab, currentColor 10%, transparent); transform: scale(1.04); }
.icon-btn:active{ transform: translateY(1px); }
.icon-btn .fa-regular,
.icon-btn .fa-solid,
.icon-btn .fas,
.nav-bars{ font-size: 18px; line-height: 1; }

/* If you use Bootstrap’s toggler, normalize it to icon-btn size */
.navbar-toggler.icon-btn{
    border:0 !important; background:none !important; box-shadow:none !important;
    width:36px; height:36px; padding:0 !important; border-radius:12px;
}

/* Notification dot */
.notif-dot{
    position: absolute; top:-3px; right:-3px;
    width:8px; height:8px; border-radius:999px; background:#ef4444;
    box-shadow: 0 0 0 2px var(--header-bg);
}

/* Utility – show desktop links on md+ */
@media (min-width: 768px){ .d-md-flex{ display: inline-flex !important; } }

/* Hide center links on small screens */
@media (max-width: 767.98px){ .header-center .nav-link-primary{ display:none !important; } }

/* ===== Dark mode (neutral header, green links) ===== */
html[data-theme="dark"] .app-header,
html[data-theme="dark"] .global-header{
    background: color-mix(in oklab, #0b201a 8%, transparent);
    border-bottom-color: color-mix(in oklab, #000 80%, transparent);
    color: #e7f6f2;
}
html[data-theme="dark"] .nav-link-primary{ color: var(--primary-400, #35a18d); }
html[data-theme="dark"] .icon-btn{ color: #e7f6f2; }
html[data-theme="dark"] .icon-btn:hover{ background: color-mix(in oklab, currentColor 10%, transparent); }
html[data-theme="dark"] .notif-dot{ box-shadow: 0 0 0 2px color-mix(in oklab, #0b201a 8%, transparent); }

/* ===== Brand variant (DNX green bar) ===== */
.app-header--brand .global-header{
    background: #1b5a49 !important;
    color: #ffffff !important;
    border-bottom: none !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.app-header--brand .header-main-row{ height: var(--header-height) !important; }

/* Logo size parity on brand */
.app-header--brand .logo-dnx-image{ height: 50px; }

/* Title on brand */
.app-header--brand .header-title{ color: #fff !important; }

/* Links on brand (pill look) */
.app-header--brand .nav-link-primary{
    color: #fff !important;
    background: rgba(255,255,255,.08);
    border-radius: 12px;
}
.app-header--brand .nav-link-primary:hover{
    background: rgba(255,255,255,.14) !important;
    color: #fff !important;
}

/* Icon buttons on brand */
.app-header--brand .icon-btn{
    color: #e4fff7 !important;
}
.app-header--brand .icon-btn:hover{
    background: rgba(255,255,255,.10) !important;
    color: #ffffff !important;
}

/* Notification dot ring matches brand bar */
.app-header--brand .notif-dot{ box-shadow: 0 0 0 2px #1b5a49; }

/* Stronger shadow when scrolled on brand */
.app-header--brand .global-header.is-scrolled{ box-shadow: 0 8px 28px rgba(0,0,0,.25); }

/* Dark mode keeps the same brand strip */
html[data-theme="dark"] .app-header--brand .global-header{ background: #1b5a49 !important; }
html[data-theme="dark"] .app-header--brand .icon-btn{ color: #d7fff2 !important; }

header.app-header.app-header--brand .icon-btn:hover,
header.app-header.app-header--brand .navbar-toggler.icon-btn:hover {
    background: rgba(255,255,255,.10) !important;
    color: #ffffff !important;
}
header.app-header.app-header--brand .icon-btn .fa-bell,
header.app-header.app-header--brand .icon-btn .fa-moon,
header.app-header.app-header--brand .icon-btn .fa-bars {
    font-size: 22px; line-height: 1;
}

.app-header--brand .nav-bars{ color: inherit; }

@media (prefers-reduced-motion: no-preference) {
    /* Button transition */
    header.app-header .header-right .icon-btn {
        will-change: transform;
        transition:
                transform 0.25s cubic-bezier(.25, .8, .25, 1),
                background-color 0.25s ease,
                color 0.25s ease;
    }

    /* Gentle lift + scale */
    header.app-header .header-right .icon-btn:hover {
        transform: translateY(-1px) scale(1.07) !important;
    }

    /* Press feedback */
    header.app-header .header-right .icon-btn:active {
        transform: scale(0.96) !important;
        transition-duration: 0.12s;
    }

    /* Inner icon (Font Awesome glyph) */
    header.app-header .header-right .icon-btn .fa-solid,
    header.app-header .header-right .icon-btn .fa-regular,
    header.app-header .header-right .icon-btn .fa-bars,
    header.app-header .header-right .icon-btn .fa-moon,
    header.app-header .header-right .icon-btn .fa-sun,
    header.app-header .header-right .icon-btn .fa-bell {
        transition: transform 0.25s cubic-bezier(.25, .8, .25, 1),
        filter 0.25s ease;
    }

    header.app-header .header-right .icon-btn:hover .fa-solid,
    header.app-header .header-right .icon-btn:hover .fa-regular,
    header.app-header .header-right .icon-btn:hover .fa-bars,
    header.app-header .header-right .icon-btn:hover .fa-moon,
    header.app-header .header-right .icon-btn:hover .fa-sun,
    header.app-header .header-right .icon-btn:hover .fa-bell {
        transform: scale(1.10);
        filter: drop-shadow(0 0 4px color-mix(in oklab, currentColor 35%, transparent));
    }

    /* Keep brand bar hover tint */
    header.app-header.app-header--brand .icon-btn:hover {
        background: rgba(255,255,255,.10) !important;
    }
}