/* ===================================
   Profile Avatar Trigger
   =================================== */
.headerProfileTrigger {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    flex-shrink: 0;
}

.headerProfileTrigger:hover {
    border-color: #0088cc;
    box-shadow: 0 0 0 2px rgba(0, 136, 204, 0.15);
}

.headerProfileTriggerImg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.headerProfileTriggerInitial {
    font-size: 15px;
    font-weight: 600;
    color: #555;
    line-height: 1;
    user-select: none;
}

/* ===================================
   Nav Panel (desktop: dropdown, mobile: fullscreen)
   =================================== */
.headerNavLinksOuterDiv {
    display: none;
    position: absolute;
    top: 75px;
    right: 40px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    min-width: 260px;
    z-index: 1001;
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    animation: burgerSlideDown 0.2s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

@keyframes burgerSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.headerNavLinksOuterDiv.show {
    display: block;
}

/* Dashboard overrides */
.headerNavDashboard {
    min-width: 300px;
    padding: 0;
    overflow: hidden;
}

.headerNavDashboard.show {
    display: flex;
    flex-direction: column;
}

/* Close button - hidden on desktop */
.headerNavCloseBtn {
    display: none;
}

/* Profile card at top of menu */
.headerNavProfileCard {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.headerNavProfileAvatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.headerNavProfileAvatar span {
    font-size: 18px;
    font-weight: 600;
    color: #555;
}

.headerNavProfileInfo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.headerNavProfileName {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Scrollable links area */
.headerNavDashboardLinks {
    padding: 8px;
    overflow-y: auto;
    flex: 1;
}

/* ===================================
   Sections
   =================================== */
.headerNavSection {
    padding: 4px 0;
}

.headerNavSection + .headerNavSection {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: 4px;
    padding-top: 8px;
}

.headerNavSectionLabel {
    display: block;
    padding: 4px 12px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    pointer-events: none;
}

/* ===================================
   Nav Links
   =================================== */
.headerNavLink {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    font-size: 14.5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    transition: all 0.15s ease;
    white-space: nowrap;
    border-radius: 8px;
    margin: 1px 0;
    position: relative;
}

.headerNavLink svg {
    flex-shrink: 0;
    color: #777;
    transition: color 0.15s ease;
}

.headerNavLink:hover {
    background-color: #f0f7ff;
    color: #0088cc;
}

.headerNavLink:hover svg {
    color: #0088cc;
}

.headerNavLink:active {
    background-color: #e6f4fc;
}

.headerNavLinkLogout {
    color: #dc3545;
}

.headerNavLinkLogout svg {
    color: #dc3545;
}

.headerNavLinkLogout:hover {
    background-color: #fff5f5;
    color: #c82333;
}

.headerNavLinkLogout:hover svg {
    color: #c82333;
}

/* ===================================
   Overlay backdrop
   =================================== */
.headerNavOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.headerNavOverlay.show {
    display: block;
    opacity: 1;
}

/* Prevent body scroll when menu is open on mobile */
body.burgerMenuOpen {
    overflow: hidden;
}

/* ===================================
   Mobile: fullscreen takeover
   =================================== */
@media screen and (max-width: 768px) {

    .headerProfileTrigger {
        width: 32px;
        height: 32px;
    }

    .headerProfileTriggerInitial {
        font-size: 13px;
    }

    /* Menu goes fullscreen on mobile */
    .headerNavDashboard {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        min-width: 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
        z-index: 1002;
        animation: burgerSlideUp 0.25s ease-out;
        max-height: 100vh;
        max-height: 100dvh;
        padding: 0;
    }

    .headerNavDashboard.show {
        display: flex;
        flex-direction: column;
    }

    @keyframes burgerSlideUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Show close button on mobile */
    .headerNavCloseBtn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        border: none;
        background: none;
        color: #666;
        cursor: pointer;
        border-radius: 50%;
        transition: background-color 0.15s ease, color 0.15s ease;
        z-index: 1;
    }

    .headerNavCloseBtn:hover {
        background-color: #f0f0f0;
        color: #333;
    }

    .headerNavProfileCard {
        padding: 24px 20px 20px;
    }

    .headerNavProfileAvatar {
        width: 48px;
        height: 48px;
    }

    .headerNavProfileName {
        font-size: 16px;
    }

    .headerNavDashboardLinks {
        padding: 8px 12px 24px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .headerNavDashboard .headerNavLink {
        padding: 13px 12px;
        font-size: 15px;
        gap: 12px;
    }

    .headerNavDashboard .headerNavLink svg {
        width: 20px;
        height: 20px;
    }

    .headerNavDashboard .headerNavSectionLabel {
        padding: 6px 12px 8px;
        font-size: 11.5px;
    }
}

/* ===================================
   Small mobile adjustments
   =================================== */
@media screen and (max-width: 320px) {
    .headerProfileTrigger {
        width: 30px;
        height: 30px;
    }
}
