/* --- Sticky Glass Navbar --- */

/*
 * Anti-snap fix: Navbar starts invisible so the Bootstrap collapse
 * initialisation (which happens before DOMContentLoaded) is never seen.
 * navigation.js adds 'navbar-ready' during its init(), fading the bar in
 * only after the DOM is fully set up and Bootstrap has already applied the
 * correct collapsed/expanded state.
 */
.custom-navbar-wrapper {
    z-index: 1000;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    pointer-events: none;
    transition: none !important;
    background: transparent !important;

    /* Hidden until navigation.js marks it ready */
    opacity: 0;
}

.custom-navbar-wrapper.navbar-ready {
    opacity: 1;
    transition: opacity 0.3s ease !important;
}

/* The actual "Pill" container */
.glass-menu-pill {
    pointer-events: auto;
    font-family: 'Poppins', sans-serif;
    background: rgba(80, 80, 80, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    /* Default mobile-friendly roundness */
    padding: 0.6rem 1.25rem !important;
    /* Mobile padding first */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);

    /* STABILITY: Mobile-First Width */
    width: 90% !important;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;

    /* NO SNAP: Remove 'all' transition for layout properties */
    transition: background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

/* Base Logo Sizing (Mobile First) */
.nav-logo {
    height: 26px !important;
    width: auto;
    transition: height 0.3s ease;
}

/* --- Menu Links --- */
.pill-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem !important;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.pill-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
}

.pill-link.active {
    background-color: #000 !important;
    color: #fff !important;
    font-weight: 400;
}

/* --- Responsive Upgrades --- */

/* Tablet & Up */
@media (min-width: 768px) {
    .nav-logo {
        height: 30px !important;
    }

    .glass-menu-pill {
        width: 94% !important;
        padding: 0.8rem 2rem !important;
    }
}

/* Desktop & Up (LG) */
@media (min-width: 992px) {
    .nav-logo {
        height: 36px !important;
    }

    .glass-menu-pill {
        width: auto !important;
        /* Size based on menu items */
        max-width: fit-content;
        flex-wrap: nowrap;
    }

    .navbar-collapse {
        border-top: none;
        padding-top: 0;
        margin-top: 0;
    }
}

/* Mobile-Specific Cleanup (Breakpoints below LG) */
@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 0.5rem;
        text-align: center;
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 1rem;
    }

    .glass-menu-pill>.navbar-brand,
    .glass-menu-pill>.navbar-toggler {
        display: flex;
        align-items: center;
    }
}