/* Shared navbar: transparent over hero, glass bar when scrolled. Use .navbar.scrolled on load for non-hero pages. */

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 20px;
    padding-top: max(16px, env(safe-area-inset-top, 0px));
    transition: padding 0.3s ease;
}

.navbar.scrolled {
    padding: 10px 16px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
    transition: all 0.3s ease;
}

/* Floating glass bar when scrolled (home only – do not use when .navbar-standard is present) */
.navbar.scrolled:not(.navbar-standard) .nav-container {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    padding: 6px 28px;
    height: 56px;
}

/* Standard flat bar on non-home pages (no bubble) – full-width bar, no rounded container */
.navbar.navbar-standard {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--borders);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 0 20px;
}

.navbar.navbar-standard .nav-container,
.navbar.navbar-standard.scrolled .nav-container {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 24px;
    height: 56px;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
}

.nav-logo-img {
    height: 40px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: block;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    position: relative;
    padding: 8px 16px;
    border-radius: 12px;
    transition: color 0.3s ease, box-shadow 0.2s ease;
    z-index: 1;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    background: currentColor;
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

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

.nav-link:hover::after {
    transform: scale(1);
    opacity: 0.9;
}

.nav-link:active::after {
    opacity: 1;
}

/* Scrolled state – light text on glass bar (home over video) */
.navbar.scrolled .nav-link {
    color: rgba(255, 255, 255, 0.95);
}

.navbar.scrolled .nav-link:hover {
    color: var(--white);
}

.navbar.scrolled .nav-link::after {
    background: var(--gold-accent);
}

/* Over light background: keep glass bar, only change menu text to dark (must override .scrolled white text) */
.navbar.navbar-over-light .nav-link,
.navbar.navbar-over-light.scrolled .nav-link {
    color: var(--primary-text) !important;
}

.navbar.navbar-over-light .nav-link:hover,
.navbar.navbar-over-light.scrolled .nav-link:hover {
    color: var(--primary-blue) !important;
}

.navbar.navbar-over-light .nav-link::after,
.navbar.navbar-over-light.scrolled .nav-link::after {
    background: var(--primary-blue);
}

.navbar.navbar-over-light .nav-link.nav-cta {
    background: var(--primary-blue);
    color: var(--white);
}

.navbar.navbar-over-light .nav-link.nav-cta:hover {
    background: var(--hover-blue);
    color: var(--white);
}

.navbar.navbar-over-light .nav-toggle span {
    background: var(--dark-base);
}

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

.nav-link.nav-cta {
    background: var(--gold-accent);
    color: var(--dark-base);
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link.nav-cta:hover {
    background: #F59E0B;
    color: var(--dark-base);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
    text-shadow: none;
}

.navbar.scrolled .nav-link.nav-cta {
    background: var(--gold-accent);
    color: var(--dark-base);
}

.navbar.scrolled .nav-link.nav-cta:hover {
    background: #F59E0B;
    color: var(--dark-base);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: relative;
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--white);
    transition: all 0.3s ease;
}

.navbar.scrolled .nav-toggle span {
    background: var(--white);
}

/* Mobile */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: 16px;
        right: 16px;
        top: 80px !important;
        flex-direction: column;
        background: var(--white);
        width: calc(100% - 32px);
        text-align: center;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
        padding: 8px 16px 16px;
        gap: 0;
        z-index: 999;
        border-radius: 20px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .nav-menu.active {
        visibility: visible;
        opacity: 1;
    }

    /* Backdrop overlay behind open menu */
    .nav-menu::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: -1;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        pointer-events: none;
    }

    .nav-menu.active::before {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Homepage glass menu (non-standard navbar) */
    .navbar:not(.navbar-standard) .nav-menu {
        background: rgba(15, 23, 42, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    }

    .navbar:not(.navbar-standard) .nav-menu .nav-link {
        color: rgba(255, 255, 255, 0.9) !important;
        display: block;
        padding: 16px 20px;
        position: relative;
        z-index: 1;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .navbar:not(.navbar-standard) .nav-menu .nav-link:hover {
        color: var(--gold-accent) !important;
        background: rgba(255, 255, 255, 0.08);
    }

    .navbar:not(.navbar-standard) .nav-menu .nav-link.nav-cta {
        background: var(--gold-accent);
        color: var(--dark-base) !important;
        margin: 12px 0 0;
        border-radius: 12px;
        padding: 14px 24px;
        border-bottom: none;
        width: auto;
        display: inline-block;
    }

    .navbar:not(.navbar-standard) .nav-menu .nav-link.nav-cta:hover {
        background: #F59E0B;
    }

    /* Standard pages white menu */
    .navbar.navbar-standard .nav-menu .nav-link {
        color: var(--primary-text) !important;
        display: block;
        padding: 16px 20px;
        position: relative;
        z-index: 1;
    }

    .navbar.navbar-standard .nav-menu .nav-link:hover {
        color: var(--primary-blue) !important;
        background: rgba(0, 0, 0, 0.03);
    }

    .navbar.navbar-standard .nav-menu .nav-link.nav-cta {
        background: var(--primary-blue);
        color: var(--white) !important;
        margin: 12px 0 0;
        border-radius: 12px;
        padding: 14px 24px;
        width: auto;
        display: inline-block;
    }

    .navbar.navbar-standard .nav-menu .nav-link.nav-cta:hover {
        background: var(--hover-blue);
    }

    .nav-menu li {
        width: 100%;
        padding: 0;
    }
    
    .nav-menu li a {
        display: block;
        width: 100%;
    }

    .nav-toggle {
        display: flex;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }

    /* Standard bar: hamburger must stay dark (visible on white bar) */
    .navbar.navbar-standard .nav-toggle span {
        background: var(--dark-base);
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .navbar.scrolled {
        padding: 10px 16px;
    }

    .navbar.scrolled .nav-container {
        padding: 0 20px;
    }

    .navbar.navbar-standard .nav-container {
        padding: 0 20px;
    }

    body.admin-banner-visible .nav-menu {
        top: 98px;
        max-height: calc(100vh - 98px);
    }
}
