﻿/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
    background: var(--primary);
    padding: 5px clamp(12px, 2vw, 20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    flex-wrap: wrap;
    gap: 6px;
}

.topbar-links {
    display: flex;
    gap: clamp(8px, 2vw, 16px);
    align-items: center;
    flex-wrap: wrap;
}

    .topbar-links a {
        color: rgba(255,255,255,0.7);
        transition: color .2s;
        white-space: nowrap;
    }

        .topbar-links a:hover {
            color: var(--accent-light);
        }

.topbar-user {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.user-pill {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 20px;
    padding: 3px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}

    .user-pill:hover {
        background: rgba(255,255,255,0.18);
    }

.badge-pro {
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 700;
}

/* ── Header ─────────────────────────────────────────────── */
header {
    background: linear-gradient(135deg, var(--primary) 0%, #0f2640 100%);
    padding: 0 clamp(12px, 2vw, 24px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    box-shadow: 0 3px 16px rgba(0,0,0,0.25);
    position: sticky;
    top: 0;
    z-index: 1030;
    gap: 12px;
    flex-wrap: nowrap;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    text-decoration: none;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: 0 3px 10px rgba(200,134,10,0.4);
    flex-shrink: 0;
}

.logo-text .title {
    font-size: clamp(13px, 1.6vw, 17px);
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
}

.logo-text .subtitle {
    font-size: 10px;
    color: rgba(255,255,255,0.55);
    white-space: nowrap;
}

header {
    overflow: visible !important;
}

.header-nav {
    overflow: visible !important;
}
/* ── Desktop Nav ─────────────────────────────────────────── */
.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}

    .header-nav::-webkit-scrollbar {
        display: none;
    }

    .header-nav > a,
    .header-nav .bs-nav-btn {
        color: rgba(255,255,255,0.75);
        padding: 7px clamp(8px, 1vw, 14px);
        border-radius: 6px;
        font-size: clamp(11px, 1vw, 13px);
        font-weight: 500;
        transition: all .2s;
        display: flex;
        align-items: center;
        gap: 5px;
        white-space: nowrap;
        text-decoration: none;
        border: none;
        background: transparent;
        cursor: pointer;
        font-family: 'Tajawal', sans-serif;
        line-height: 1;
    }

        .header-nav > a:hover,
        .header-nav > a.active,
        .header-nav .bs-nav-btn:hover,
        .header-nav .bs-nav-btn.active {
            background: rgba(255,255,255,0.12);
            color: #fff;
        }

        .header-nav > a.active,
        .header-nav .bs-nav-btn.active {
            border-bottom: 2px solid var(--accent-light);
        }

    /* ── Admin Dropdown (Bootstrap) ──────────────────────────── */
    .header-nav .dropdown {
        position: relative;
    }

    .header-nav .dropdown-menu {
        min-width: 210px;
        background: #0f2640;
        border: 1px solid rgba(255,255,255,0.15);
        border-radius: 8px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.4);
        padding: 4px 0;
        margin-top: 8px !important;
    }

    .header-nav .dropdown-item {
        color: rgba(255,255,255,0.82);
        font-size: 13px;
        font-family: 'Tajawal', sans-serif;
        padding: 9px 16px;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: background .15s;
    }

        .header-nav .dropdown-item i {
            color: var(--accent-light);
            width: 16px;
            text-align: center;
            flex-shrink: 0;
        }

        .header-nav .dropdown-item:hover,
        .header-nav .dropdown-item:focus {
            background: rgba(255,255,255,0.1);
            color: #fff;
        }

    .header-nav .dropdown-divider {
        border-color: rgba(255,255,255,0.1);
        margin: 4px 0;
    }

/* ── Header Actions ──────────────────────────────────────── */
.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.btn-header {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 6px clamp(10px, 1.2vw, 16px);
    border-radius: 6px;
    font-size: clamp(11px, 1vw, 12px);
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    text-decoration: none;
}

    .btn-header:hover {
        background: rgba(255,255,255,0.18);
    }

    .btn-header.accent {
        background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
        border-color: transparent;
        box-shadow: 0 2px 8px rgba(200,134,10,0.3);
    }

        .btn-header.accent:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(200,134,10,0.4);
        }

/* ── Mobile Hamburger ────────────────────────────────────── */
.btn-mobile-menu {
    display: none;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 7px;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s;
}

    .btn-mobile-menu:hover {
        background: rgba(255,255,255,0.2);
    }

/* ── Mobile Nav Panel ────────────────────────────────────── */
#mobileNav {
    display: none;
    background: #0d2238;
    border-bottom: 2px solid var(--accent);
}

    #mobileNav.open {
        display: block;
    }

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    font-family: 'Tajawal', sans-serif;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    text-decoration: none;
    transition: background .15s, color .15s;
}

    .mobile-nav-item:hover {
        background: rgba(255,255,255,0.07);
        color: #fff;
    }

    .mobile-nav-item i {
        color: var(--accent-light);
        width: 18px;
        text-align: center;
        flex-shrink: 0;
    }

    .mobile-nav-item.sub {
        padding-right: 44px;
        font-size: 13px;
        color: rgba(255,255,255,0.7);
    }

        .mobile-nav-item.sub i {
            color: var(--accent);
        }

.mobile-nav-section {
    padding: 8px 20px 4px;
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    letter-spacing: 1px;
    font-family: 'Tajawal', sans-serif;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.mobile-nav-item:last-child {
    border-bottom: none;
}

/* ── PWA Install Bar (self-contained) ────────────────────── */
#pwaInstallBar {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: linear-gradient(135deg, #0f2640 0%, #0a1a2e 100%);
    border: 1px solid rgba(200,134,10,0.5);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    padding: 14px 18px;
    max-width: 440px;
    width: calc(100% - 40px);
    align-items: center;
    gap: 14px;
    font-family: 'Tajawal', sans-serif;
}

    #pwaInstallBar.pwa-visible {
        display: flex;
    }

    #pwaInstallBar .pwa-bar-icon {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        background: linear-gradient(135deg, #c8860a 0%, #e0a020 100%);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        color: #fff;
    }

    #pwaInstallBar .pwa-bar-text {
        flex: 1;
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.4;
    }

    #pwaInstallBar .pwa-bar-actions {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
    }

    #pwaInstallBar .pwa-btn {
        border: none;
        border-radius: 7px;
        padding: 8px 16px;
        font-size: 13px;
        font-weight: 700;
        font-family: inherit;
        cursor: pointer;
        transition: transform .15s, box-shadow .15s, background .15s;
    }

    #pwaInstallBar .pwa-btn-install {
        background: linear-gradient(135deg, #c8860a 0%, #e0a020 100%);
        color: #fff;
        box-shadow: 0 2px 8px rgba(200,134,10,0.35);
    }

        #pwaInstallBar .pwa-btn-install:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(200,134,10,0.5);
        }

    #pwaInstallBar .pwa-btn-dismiss {
        background: rgba(255,255,255,0.1);
        color: rgba(255,255,255,0.8);
        border: 1px solid rgba(255,255,255,0.2);
    }

        #pwaInstallBar .pwa-btn-dismiss:hover {
            background: rgba(255,255,255,0.18);
        }

@media (max-width: 480px) {
    #pwaInstallBar {
        flex-wrap: wrap;
    }

        #pwaInstallBar .pwa-bar-actions {
            width: 100%;
            justify-content: stretch;
        }

        #pwaInstallBar .pwa-btn {
            flex: 1;
        }
}

/* ── Guest Gate Modal ────────────────────────────────────── */
body.guest-gate-lock {
    overflow: hidden;
}

.guest-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(8, 20, 35, 0.62);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity .2s ease;
}

    .guest-gate-overlay.is-open {
        opacity: 1;
    }

.guest-gate-card {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    max-width: 420px;
    width: 100%;
    padding: 32px 28px 26px;
    text-align: center;
    font-family: 'Tajawal', sans-serif;
    transform: translateY(12px) scale(.98);
    transition: transform .25s ease;
}

.guest-gate-overlay.is-open .guest-gate-card {
    transform: translateY(0) scale(1);
}

.guest-gate-close {
    position: absolute;
    top: 12px;
    inset-inline-start: 14px;
    background: transparent;
    border: none;
    color: var(--text-muted, #8a98a8);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color .15s;
}

    .guest-gate-close:hover {
        color: var(--primary, #0f2640);
    }

.guest-gate-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent, #c8860a) 0%, var(--gold, #e0a020) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    box-shadow: 0 6px 18px rgba(200,134,10,0.4);
}

.guest-gate-title {
    font-size: 21px;
    font-weight: 800;
    color: var(--primary, #0f2640);
    margin: 0 0 8px;
}

.guest-gate-text {
    font-size: 14.5px;
    color: var(--text-muted, #5a6b7b);
    line-height: 1.7;
    margin: 0 0 22px;
}

.guest-gate-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.guest-gate-btn {
    flex: 1;
    min-width: 140px;
    padding: 11px 16px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: transform .15s, box-shadow .15s, background .15s;
}

.guest-gate-btn-primary {
    background: linear-gradient(135deg, var(--accent, #c8860a) 0%, var(--gold, #e0a020) 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(200,134,10,0.35);
}

    .guest-gate-btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 5px 14px rgba(200,134,10,0.5);
        color: #fff;
    }

.guest-gate-btn-secondary {
    background: rgba(15,38,64,0.06);
    color: var(--primary, #0f2640);
    border: 1px solid rgba(15,38,64,0.14);
}

    .guest-gate-btn-secondary:hover {
        background: rgba(15,38,64,0.1);
    }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991px) {
    .header-nav {
        display: none;
    }

    .btn-mobile-menu {
        display: flex;
    }

    .header-actions .btn-header:not(.accent) {
        display: none;
    }
}

@media (max-width: 575px) {
    .topbar-links .topbar-extra {
        display: none;
    }

    .user-pill span:not(.badge-pro) {
        display: none;
    }

    .btn-header.accent .btn-text {
        display: none;
    }
}
