
/* --- NAVBAR CONTAINER --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    z-index: 10000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scroll Effect: Compacts navbar when scrolling down */
.navbar.scrolled {
    padding: 12px 5%; /* Shrinks padding */
}

/* --- BRANDING --- */
.brand-text {
    font-size: 2rem;
    font-weight: 900;
    color: #1f4399;
    text-decoration: none;
    letter-spacing: -1px;
    z-index: 10002; /* Always above menu */
    position: relative;
}

.brand-text .dot {
    color: #2563eb;
}

/* --- NAV ISLAND (The Floating Menu) --- */
.nav-island {
    background: rgba(10, 73, 221, 0.85); /* Slightly transparent blue */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 8px 10px;
    box-shadow: 0 10px 30px rgba(0, 48, 137, 0.25);
    display: flex;
    transition: all 0.3s ease;
}

/* Darker background when scrolling for better readability */
.navbar.scrolled .nav-island {
    background: rgba(10, 73, 221, 0.95);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 5px;
    margin: 0;
    padding: 0;
}

/* --- NAVIGATION LINKS --- */
.nav-link {
    color: #e4e4e4;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 10px 24px;
    border-radius: 30px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Active State (Pill Highlight) */
.nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* --- AUTH BUTTONS --- */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10002;
}

.login-btn {
    background: #0846cc;
    color: white;
    padding: 12px 28px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease;
    box-shadow: 0 4px 15px rgba(8, 70, 204, 0.3);
}

.login-btn:hover {
    background: #063cb3;
    transform: translateY(-2px);
}

/* --- MOBILE HAMBURGER TOGGLE --- */
.menu-toggle {
    display: none; /* Hidden on Desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10005; /* CRITICAL: Must be higher than the menu */
}

.bar {
    width: 100%;
    height: 3px;
    background-color: #1f4399;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

/* Hamburger Animation States */
.menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
    background-color: white; /* Turn white on mobile menu background */
}
.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}
.menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
    background-color: white;
}

/* --- MOBILE RESPONSIVE (Max 768px) --- */
@media (max-width: 768px) {
    .login-btn { display: none; }
    .menu-toggle { display: flex; }

    .nav-island {
        position: absolute;
        top: 80px;
        left: 5%;
        right: 5%;
        width: 90%;
        flex-direction: column;
        align-items: center;
        padding: 40px 20px;
        
        /* Glassmorphism Mobile Background */
        background: rgba(10, 73, 221, 0.98);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
        border-radius: 24px;
        
        /* Hiding Logic (Critical for Toggle) */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px) scale(0.95);
        pointer-events: none; /* Prevents clicking when hidden */
        z-index: 10001;
    }

    /* Active State (When Open) */
    .nav-island.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        pointer-events: all; /* Re-enable clicks */
    }

    .nav-links {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        text-align: center;
    }

    .nav-link {
        display: block;
        font-size: 1.1rem;
        width: 100%;
        padding: 12px 0;
    }
    
    .nav-link:hover, .nav-link.active {
        background: rgba(255, 255, 255, 0.15);
    }
}