/* ============================================================
   OAKOKHO — UNIFIED HEADER & NAV STYLESHEET
   https://scripts.oakokho.com/css/header.css
   ============================================================ */

/* ============================================================
   HEADER BASE
   ============================================================ */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    gap: 16px;
}

/* ============================================================
   LOGO
   ============================================================ */
.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    line-height: 1;
}

.logo a i,
.logo a .fa-solid {
    font-size: 1.9rem;
    color: #fff;
}

/* ============================================================
   NAV MENU
   ============================================================ */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 4px;
    align-items: center;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

.nav-menu li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border-radius: 8px;
    transition: background .2s ease;
    white-space: nowrap;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: rgb(255 255 255 / 0.18);
    color: #fff;
    transform: translateY(-1px);
}

/* ============================================================
   MOBILE TOGGLE
   ============================================================ */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
}

/* ============================================================
   USER PILL
   ============================================================ */
.user-icon-container,
.user-menu {
    position: relative;
    list-style: none;
}

.user-pill,
.user-profile {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgb(255 255 255 / 0.15);
    border: 1.5px solid rgb(255 255 255 / 0.35);
    color: #fff;
    padding: 6px 14px 6px 10px;
    border-radius: 24px;
    cursor: pointer;
    font-size: .88rem;
    font-weight: 600;
    transition: background .2s ease;
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
}

.user-pill:hover,
.user-profile:hover {
    background: rgb(255 255 255 / 0.28);
    color: #fff;
    transform: none;
}

.user-pill i:first-child,
.user-profile i:first-child {
    font-size: 1.1rem;
}

.user-pill-caret {
    font-size: .7rem;
    opacity: .7;
    transition: transform .2s ease;
}

.user-icon-container.open .user-pill-caret,
.user-menu.open .user-pill-caret {
    transform: rotate(180deg);
}

/* ============================================================
   USER DROPDOWN — CLICK-TRIGGERED via .open class
   NO hover trigger — avoids the gap/disappear bug
   ============================================================ */
.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    /* SOLID WHITE — override any site gradient */
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgb(0 0 0 / 0.18);
    min-width: 220px;
    z-index: 9999;
    /* NO overflow:hidden — was clipping padding gap */
    color: #1e293b;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
}

/* OPEN STATE — toggled by header.js */
.user-icon-container.open .user-dropdown,
.user-menu.open .user-dropdown {
    display: block;
}

.user-dropdown-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-dropdown-header strong {
    font-size: .92rem;
    font-weight: 700;
    color: #1e293b;
}

.user-dropdown-header small {
    font-size: .76rem;
    color: #64748b;
    word-break: break-all;
}

.user-dropdown a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 12px 16px !important;
    color: #1e293b !important;
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    background: #ffffff !important;
    transition: background .15s ease;
    border-bottom: 1px solid #f1f5f9 !important;
    border-radius: 0 !important;
    transform: none !important;
}

.user-dropdown a:last-child {
    border-bottom: none !important;
    border-radius: 0 0 12px 12px !important;
}

.user-dropdown a:hover {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    transform: none !important;
}

.user-dropdown a i {
    width: 16px;
    text-align: center;
    color: #64748b;
    font-size: .9rem;
}

.user-dropdown a.logout-link {
    color: #dc2626 !important;
    border-top: 1px solid #e2e8f0 !important;
}

.user-dropdown a.logout-link:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

.user-dropdown a.logout-link i {
    color: #dc2626;
}

/* ============================================================
   LOGIN BUTTON
   ============================================================ */
.nav-login-btn {
    list-style: none;
}

.btn-login,
.btn-login-nav {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    background: rgb(255 255 255 / 0.15);
    border: 1.5px solid rgb(255 255 255 / 0.4);
    color: #fff !important;
    padding: 7px 18px;
    border-radius: 24px;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    transition: all .2s ease;
    white-space: nowrap;
    cursor: pointer;
}

.btn-login:hover,
.btn-login-nav:hover {
    background: #ffffff;
    color: #667eea !important;
    border-color: #ffffff;
    transform: none;
}

/* ============================================================
   ADMIN LINK / DIVIDER (SWARGAM)
   ============================================================ */
.admin-link {
    color: #fbbf24 !important;
}

.admin-link:hover {
    background: rgb(251 191 36 / 0.15) !important;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
    list-style: none;
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 12px 16px 16px;
        box-shadow: 0 8px 24px rgb(0 0 0 / 0.2);
        z-index: 999;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li a {
        padding: 10px 14px;
        font-size: .95rem;
    }

    .user-dropdown {
        right: auto;
        left: 0;
        min-width: 200px;
    }

    .user-pill-name {
        display: none;
    }

    .btn-login,
    .btn-login-nav {
        width: 100%;
        justify-content: center;
    }
}