/* AETHER NAV - REFINED */

.aether-header {
    background-color: rgba(11, 26, 48, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease-in-out;
    border-bottom: 1px solid var(--glass-border);
    transform: translateY(-100%);
    animation: slideDown 0.5s 0.5s ease-out forwards;
}
@keyframes slideDown {
    to { transform: translateY(0); }
}
.aether-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    /* Add padding for container spacing */
    padding: 0 2rem;
}
.aether-logo {
    opacity: 0;
    animation: fadeIn 0.5s 1s ease-out forwards;
}
.aether-logo img {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.aether-logo:hover img {
    opacity: 0.8;
    transform: scale(1.05);
}

.aether-desktop-menu {
    display: flex;
    align-items: center;
    gap: 2rem; /* FIX: Correctly spaces the nav links from the CTA */
}

.aether-desktop-menu > ul > li,
.aether-desktop-menu > div {
    opacity: 0;
    transform: translateY(-10px);
    animation: fadeInDown 0.4s ease-out forwards;
    animation-delay: calc(1s + var(--i) * 0.1s);
}

@keyframes fadeInDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeIn {
    to { opacity: 1; }
}


/* FIX: Style the new menu container for desktop */
.aether-mobile-menu {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.aether-nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2.5rem; /* This can be inherited from parent or set here */
}

.aether-nav-links a {
    color: var(--slate);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding: 10px 0;
}

.aether-nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--tech-cyan);
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.aether-nav-links a:hover::after,
.aether-nav-links a.active::after {
    width: 100%;
}

.aether-nav-links a:hover, .aether-nav-links a.active {
    color: var(--tech-cyan);
}

.aether-nav-cta {
    color: var(--tech-cyan);
    border: 1px solid var(--tech-cyan);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

.aether-nav-cta:hover {
    background-color: var(--cta-magenta);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(100, 255, 218, 0.1);
}


/* ===================================================
   DESKTOP DROPDOWN MENU STYLING
==================================================== */
.nav-item-has-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    z-index: 1001;

    background-color: rgba(15, 39, 62, 0.8); /* --lightest-navy with more alpha */
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px -15px rgba(0,0,0,0.7);

    /* Animation & Visiblity */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

/* Show dropdown on hover */
.nav-item-has-dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    /* Reset animation properties from the parent */
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--slate);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.dropdown-menu a:hover {
    color: var(--tech-cyan);
    background-color: rgba(100, 255, 218, 0.05);
}

.mobile-menu-header {
    color: var(--tech-cyan);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 2rem 1rem 0.5rem;
    pointer-events: none; /* Makes the header non-clickable */
}

/* Adjust padding for the first header */
.aether-mobile-nav-links li:first-child.mobile-menu-header {
    padding-top: 0;
}

/* FIX: Explicitly hide the mobile toggle on desktop */
.aether-mobile-menu-toggle {
    display: none;
}
.aether-mobile-menu-overlay {
    display: none; /* Hidden by default */
}

/* Hide old preloader */
#preloader { display: none; }


/* === MOBILE STYLES === */
@media (max-width: 992px) {
    /* FIX: On mobile, hide the entire desktop menu container */
    .aether-desktop-menu {
        display: none;
    }
    .aether-nav .aether-nav-cta { display: none; }

    /* FIX: On mobile, show the hamburger toggle */
    .aether-mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        z-index: 2001; /* Ensure it's above other header content */
    }
    .aether-mobile-menu-toggle span {
        display: block;
        width: 25px;
        height: 2px;
        background-color: var(--light-slate);
        transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
    }

    /* Styles for the mobile menu overlay when it's open */
    .aether-header.is-open .aether-mobile-menu {
        /* This is the overlay itself */
        display: flex; /* This correctly overrides display:none */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: fixed;
        top: 0; /* Cover the entire screen */
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--dark-navy);
        gap: 0; /* Reset desktop gap */
        opacity: 0;
        z-index: 2500;
        animation: fadeIn 0.3s forwards;
    }

    @keyframes fadeIn {
        to { opacity: 1; }
    }

    /* Re-style links for the overlay */
    .aether-header.is-open .aether-nav-links {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    .aether-header.is-open .aether-nav-links a {
        font-size: 1.5rem;
    }
    .aether-header.is-open .aether-nav-cta {
        margin-top: 2rem;
        font-size: 1.2rem;
        padding: 0.8rem 1.5rem;
    }

    .aether-mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--dark-navy);
        z-index: 2000;
        display: flex;
        flex-direction: column;

        justify-content: flex-start;

        overflow-y: auto;

        padding: 100px 2rem 40px;

        transform: translateY(-100%);
        transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .aether-mobile-nav-links {
        list-style: none;
        padding: 0;
        margin: 0;
        text-align: center;
    }

    .aether-mobile-nav-links a {
        display: block;
        padding: 1rem;
        font-size: 1.5rem;
        color: var(--slate);
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s ease;
    }

    .aether-mobile-nav-links a:hover {
        color: var(--tech-cyan);
    }

    .aether-mobile-menu-overlay .aether-nav-cta {
        margin-top: 2.5rem;
        font-size: 1.2rem;
        padding: 0.8rem 1.5rem;
    }

    body.mobile-menu-open .aether-mobile-menu-overlay {
        transform: translateY(0);
    }

    /* Hamburger to "X" animation */
    .header-is-open .aether-mobile-menu-toggle span { background-color: var(--tech-cyan); }
    .header-is-open .aether-mobile-menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .header-is-open .aether-mobile-menu-toggle span:nth-child(2) { opacity: 0; }
    .header-is-open .aether-mobile-menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

.aether-menu-close-btn {
    position: absolute;
    top: 15px;
    right: 2rem; /* Aligns with the .aether-nav padding */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
    color: var(--slate);
    font-size: 2.75rem;
    font-weight: 300;
    z-index: 2002; /* Ensure it's clickable */
    transition: all 0.3s ease;
}

.aether-menu-close-btn:hover {
    color: var(--tech-cyan);
    transform: scale(1.1) rotate(90deg);
}

