/* ═══════════════════════════════════════════════════════
   PREMIUM NAV — Minimalist High-End 2026
   Side Drawer + Glassmorphism + Uniform Items
   ═══════════════════════════════════════════════════════ */

/* Import Arabic typeface */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;600;700&display=swap');

/* ── Header Bar ───────────────────────────────────────── */
.main-header {
    position: sticky;
    top: 0;
    z-index: 900;
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.main-header.is-scrolled {
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.35);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
    min-height: 64px;
}

/* ── Logo ─────────────────────────────────────────────── */
.site-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none !important;
    color: var(--gold);
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.logo-icon {
    font-size: 1.1rem;
    color: var(--gold);
}

/* ── Hamburger ────────────────────────────────────────── */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid rgba(201, 162, 74, 0.25);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    z-index: 950;
    transition: border-color 0.3s, background 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.hamburger:hover,
.hamburger.is-open {
    background: rgba(201, 162, 74, 0.08);
    border-color: rgba(201, 162, 74, 0.5);
}

.ham-line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--gold);
    border-radius: 4px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity  0.3s ease,
                width    0.3s ease;
    transform-origin: center;
}

.ham-top { width: 14px; align-self: flex-end; margin-left: auto; }
.ham-bot { width: 10px; align-self: flex-start; margin-right: auto; }

/* Open state */
.hamburger.is-open .ham-top {
    width: 20px;
    transform: translateY(7px) rotate(45deg);
}
.hamburger.is-open .ham-mid {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.is-open .ham-bot {
    width: 20px;
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Backdrop ─────────────────────────────────────────── */
.nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 910;
    background: rgba(5, 15, 40, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.nav-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ── Side Drawer ──────────────────────────────────────── */
.nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(85vw, 320px);
    z-index: 920;

    /* Glassmorphism */
    background: linear-gradient(165deg,
        rgba(10, 22, 55, 0.97) 0%,
        rgba(8, 18, 48, 0.99) 100%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border-left: 1px solid rgba(201, 162, 74, 0.15);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);

    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;

    /* Slide in from right */
    transform: translateX(110%);
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 16px 0 0 16px;
}

.nav-drawer.is-open {
    transform: translateX(0);
}

/* ── Drawer Header ────────────────────────────────────── */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(201, 162, 74, 0.12);
}

.drawer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Amiri', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold);
}

.drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.drawer-close:hover {
    background: rgba(201, 162, 74, 0.12);
    border-color: rgba(201, 162, 74, 0.3);
    color: var(--gold);
}

/* ── Nav List ─────────────────────────────────────────── */
.nav-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    flex: 1;
}

.nav-item {
    margin: 0;
    padding: 0 0.75rem;
}

/* Staggered slide-in for items */
.nav-item {
    opacity: 0;
    transform: translateX(16px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-drawer.is-open .nav-item:nth-child(1)  { opacity: 1; transform: none; transition-delay: 0.07s; }
.nav-drawer.is-open .nav-item:nth-child(2)  { opacity: 1; transform: none; transition-delay: 0.10s; }
.nav-drawer.is-open .nav-item:nth-child(3)  { opacity: 1; transform: none; transition-delay: 0.13s; }
.nav-drawer.is-open .nav-item:nth-child(4)  { opacity: 1; transform: none; transition-delay: 0.15s; }
.nav-drawer.is-open .nav-item:nth-child(5)  { opacity: 1; transform: none; transition-delay: 0.18s; }
.nav-drawer.is-open .nav-item:nth-child(6)  { opacity: 1; transform: none; transition-delay: 0.21s; }
.nav-drawer.is-open .nav-item:nth-child(7)  { opacity: 1; transform: none; transition-delay: 0.24s; }
.nav-drawer.is-open .nav-item:nth-child(8)  { opacity: 1; transform: none; transition-delay: 0.27s; }

/* Nav Divider */
.nav-divider {
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(201, 162, 74, 0.2) 30%,
        rgba(201, 162, 74, 0.2) 70%,
        transparent);
    margin: 0.4rem 0.75rem;
    padding: 0;
}

/* Nav Link — Uniform for ALL items */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    height: 52px;           /* Touch target ≥48px */
    padding: 0 1rem;
    border-radius: 10px;
    color: rgba(230, 240, 255, 0.78);
    font-family: 'Tajawal', 'Cairo', sans-serif;
    font-size: 0.975rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: background 0.22s ease, color 0.22s ease, padding-right 0.22s ease;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(201, 162, 74, 0.06);
    opacity: 0;
    transition: opacity 0.22s ease;
    border-radius: inherit;
}

.nav-link:hover::before,
.nav-link:active::before {
    opacity: 1;
}

.nav-link:hover {
    color: rgba(255, 240, 200, 0.95);
    padding-right: 1.25rem;
}

/* Icon */
.nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: rgba(201, 162, 74, 0.65);
    flex-shrink: 0;
    transition: color 0.22s ease;
}

.nav-link:hover .nav-icon {
    color: var(--gold);
}

/* Arrow (admin only) */
.nav-arrow {
    font-size: 0.65rem;
    margin-right: auto;
    margin-left: 0;
    color: rgba(201, 162, 74, 0.4);
    transition: transform 0.25s ease, color 0.22s ease;
}

.nav-link:hover .nav-arrow {
    transform: translateX(-4px);
    color: var(--gold);
}

/* Admin link — same base style, subtle gold accent */
.nav-link--admin {
    color: rgba(201, 162, 74, 0.85);
    font-weight: 600;
}

.nav-link--admin .nav-icon {
    color: rgba(201, 162, 74, 0.8);
}

.nav-link--admin::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    bottom: 20%;
    width: 2.5px;
    background: var(--gold);
    border-radius: 4px;
    opacity: 0.5;
}

.nav-link--admin:hover {
    color: var(--gold);
}

.nav-link--wizard {
    color: rgba(201, 162, 74, 0.92);
    font-weight: 600;
}

.nav-link--wizard .nav-icon {
    color: rgba(201, 162, 74, 0.85);
}

/* ── Drawer Footer ────────────────────────────────────── */
.drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-family: 'Tajawal', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.2);
    text-align: center;
    letter-spacing: 0.03em;
}

/* ── Header Actions (Right Side) ──────────────────────── */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ── Top User Menu ───────────────────────────────────── */
.user-menu-wrapper {
    position: relative;
    font-family: 'Tajawal', sans-serif;
}

.user-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(201, 162, 74, 0.1);
    border: 1px solid rgba(201, 162, 74, 0.2);
    border-radius: 50px;
    color: var(--gold);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
}

a.user-menu-btn.user-menu-btn--direct {
    text-decoration: none;
    box-sizing: border-box;
}

.user-menu-btn:hover {
    background: rgba(201, 162, 74, 0.18);
    border-color: rgba(201, 162, 74, 0.4);
}

.user-menu-btn i.fa-user-shield {
    font-size: 1.1rem;
}

.user-menu-btn .fa-chevron-down {
    font-size: 0.7rem;
    margin-right: 5px;
    opacity: 0.7;
    transition: transform 0.3s ease;
}

.user-name-label {
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 400px) {
    .user-name-label { display: none; }
    .user-menu-btn { padding: 0.4rem; width: 36px; height: 36px; justify-content: center; }
    .user-menu-btn i { margin: 0; }
}

/* ── User Dropdown Card ──────────────────────────────── */
.user-dropdown-card {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    left: auto;
    width: 240px;
    max-width: min(240px, calc(100vw - 24px));
    background: rgba(10, 22, 55, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(201, 162, 74, 0.25);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    padding: 0.5rem 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.user-dropdown-card.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header-info {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.dropdown-header-info strong {
    color: var(--gold);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 3px;
}

.badge-role {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    background: rgba(201, 162, 74, 0.15);
    color: var(--gold);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-header-info span:not(.badge-role) {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

.dropdown-divider {
    height: 1px;
    background: rgba(201, 162, 74, 0.12);
    margin: 0.4rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.88rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(201, 162, 74, 0.08);
    color: var(--gold);
    padding-right: 1.25rem;
}

.dropdown-item.logout {
    color: #ff6b6b;
    border: none;
    background: none;
    width: 100%;
    text-align: right;
    cursor: pointer;
    font-family: inherit;
}

.dropdown-item.logout:hover {
    background: rgba(255, 107, 107, 0.05);
    color: #ff8787;
}

/* ── Desktop: compact inline nav ─────────────────────── */
@media (min-width: 1024px) {
    .hamburger { display: none !important; }
    .nav-backdrop { display: none !important; }

    /* القائمة بين الشعار وزر الحساب في صف واحد */
    .header-inner .nav-drawer {
        position: static !important;
        transform: none !important;
        width: auto !important;
        flex: 1 1 auto;
        min-width: 0;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center;
        margin: 0 0.25rem;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
        height: 64px;
    }

    .drawer-header,
    .drawer-footer,
    .drawer-close,
    .nav-arrow,
    .nav-list .nav-divider { display: none !important; }

    .nav-list {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.1rem;
        padding: 0;
    }

    .nav-item {
        opacity: 1 !important;
        transform: none !important;
        padding: 0;
    }

    .nav-link {
        height: 40px;
        padding: 0 0.875rem;
        font-size: 0.875rem;
        border-radius: 8px;
        white-space: nowrap;
        color: rgba(230, 240, 255, 0.75);
    }

    .nav-icon { display: none; }

    .nav-link--admin {
        border: 1px solid rgba(201, 162, 74, 0.25);
        background: rgba(201, 162, 74, 0.06);
    }

    .nav-link--admin::after { display: none; }
}

/* ── Scrollbar ────────────────────────────────────────── */
.nav-drawer::-webkit-scrollbar { width: 3px; }
.nav-drawer::-webkit-scrollbar-thumb { background: rgba(201, 162, 74, 0.2); border-radius: 4px; }

/* ── Hide OLD nav-links / mobile-nav-action leftovers ── */
.nav-links, .mobile-nav-action, .desktop-nav-action { display: none !important; }
