/* ============================================================
   uNiek Design System — App Header
   Eventkaart.nl
   ============================================================ */

/* --- OpenDyslexic font ------------------------------------ */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('https://fonts.cdnfonts.com/s/14982/OpenDyslexic-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* --- Dyslexia mode ---------------------------------------- */
body.dys,
body.dys * {
    font-family: 'OpenDyslexic', Arial, sans-serif !important;
    letter-spacing: 0.05em;
    word-spacing: 0.12em;
    line-height: 1.6;
}

/* --- Root header ------------------------------------------ */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: #ffffff;
    color: #1C1C2E;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 1100;
    border-bottom: 3px solid var(--brand-primary, #AACA38);
    box-sizing: border-box;
}

/* --- Zone 1: Identity (LEFT) ------------------------------ */
.app-header__left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
}

.header-logo img {
    height: 32px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

.header-appname {
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
}

.header-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.header-username {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.role-badge {
    background: var(--brand-primary, #AACA38);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
    text-transform: capitalize;
}

.header-login-link {
    font-size: 13px;
    color: var(--brand-primary, #AACA38);
    text-decoration: none;
    font-weight: 600;
}

.header-login-link:hover {
    text-decoration: underline;
}

/* --- Zone 2: Navigation (CENTER) -------------------------- */
.app-header__center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0 8px;
}

.header-hamburger {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(170, 202, 56, 0.12);
    border: none;
    border-radius: 20px;
    padding: 5px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
    transition: background 0.2s;
}

.header-hamburger:hover,
.header-hamburger[aria-expanded="true"] {
    background: rgba(170, 202, 56, 0.28);
}

.header-hamburger .hamburger-icon {
    font-size: 17px;
    line-height: 1;
}

.header-page-title {
    white-space: nowrap;
}

/* Dropdown nav */
.header-nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-top: 3px solid var(--brand-primary, #AACA38);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 180px;
    z-index: 1200;
    overflow: hidden;
}

.header-nav-dropdown.open {
    display: block;
}

.header-nav-dropdown a {
    display: block;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #1C1C2E;
    text-decoration: none;
    transition: background 0.15s;
}

.header-nav-dropdown a:hover {
    background: rgba(170, 202, 56, 0.12);
}

.header-nav-dropdown a.active {
    font-weight: 700;
    color: var(--brand-primary, #AACA38);
}

/* --- Zone 3: A11y controls (RIGHT) ------------------------ */
.app-header__right {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.a11y-btn {
    background: transparent;
    border: 1px solid rgba(28, 28, 46, 0.2);
    border-radius: 6px;
    color: inherit;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 7px;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
    line-height: 1.3;
}

.a11y-btn:hover,
.a11y-btn.active {
    background: rgba(170, 202, 56, 0.18);
    border-color: var(--brand-primary, #AACA38);
}

/* ============================================================
   Dark Theme
   ============================================================ */
body.theme-dark .app-header {
    background: var(--brand-bg, #1C1C2E);
    color: #f0f0f0;
}

body.theme-dark .header-logo {
    color: #f0f0f0;
}

body.theme-dark .header-appname {
    color: #f0f0f0;
}

body.theme-dark .header-hamburger {
    background: rgba(170, 202, 56, 0.15);
    color: #f0f0f0;
}

body.theme-dark .header-hamburger:hover,
body.theme-dark .header-hamburger[aria-expanded="true"] {
    background: rgba(170, 202, 56, 0.3);
}

body.theme-dark .header-nav-dropdown {
    background: #252535;
    border-color: #3a3a4e;
    border-top-color: var(--brand-primary, #AACA38);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.theme-dark .header-nav-dropdown a {
    color: #e0e0e0;
}

body.theme-dark .header-nav-dropdown a:hover {
    background: rgba(170, 202, 56, 0.18);
}

body.theme-dark .a11y-btn {
    border-color: rgba(240, 240, 240, 0.25);
    color: #f0f0f0;
}

body.theme-dark .a11y-btn:hover,
body.theme-dark .a11y-btn.active {
    background: rgba(170, 202, 56, 0.22);
    border-color: var(--brand-primary, #AACA38);
}

body.theme-dark .header-login-link {
    color: var(--brand-primary, #AACA38);
}

/* ============================================================
   Mobile — < 600px
   ============================================================ */
@media (max-width: 600px) {
    .header-username,
    .role-badge {
        display: none;
    }

    .header-appname {
        font-size: 14px;
    }

    .header-hamburger {
        padding: 5px 12px;
    }

    .a11y-btn {
        padding: 4px 5px;
        font-size: 11px;
    }
}
