/* ==========================================================================
   Mobile Navbar & Fullscreen Menu
   Isolated styles to avoid global conflicts
   ========================================================================== */

/* Hamburger Toggle Button */
.mobile-menu-toggle {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10001; /* Above the overlay */
    padding: 0;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: left center;
}

.mobile-menu-toggle:hover span {
    background-color: #8a2be2;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

/* Toggle Animation State */
.mobile-menu-toggle.is-open span:nth-child(1) {
    transform: rotate(45deg);
    width: 32px;
}

.mobile-menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.mobile-menu-toggle.is-open span:nth-child(3) {
    transform: rotate(-45deg);
    width: 32px;
}

/* Fullscreen Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 10000; /* Below toggle but above everything else */
    opacity: 0;
    visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    padding-bottom: 20px;
    /* Promote to own GPU layer â€” prevents backdrop-filter from forcing
       a full-page compositing flush on Android Chrome */
    will-change: opacity;
    contain: layout style paint;
    /* Ensure touch events pass through when invisible */
    touch-action: none;
}

.mobile-menu-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Links Container */
.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mobile-nav-links li {
    opacity: 0;
    transform: translateY(30px);
}

.mobile-nav-links a {
    font-family: 'Outfit', sans-serif;
    font-size: 38px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.mobile-nav-links a:hover, 
.mobile-nav-links a:focus {
    color: #fff;
    transform: scale(1.05);
}

/* Hover Gradient Accent */
.mobile-nav-links a::before {
    content: '';
    position: absolute;
    bottom: 5px;
    left: -10px;
    width: 0;
    height: 30%;
    background: linear-gradient(90deg, rgba(138, 43, 226, 0.4), rgba(0, 140, 255, 0.4));
    z-index: -1;
    transition: width 0.4s ease;
    border-radius: 4px;
    filter: blur(4px);
}

.mobile-nav-links a:hover::before {
    width: calc(100% + 20px);
}

/* Add some atmosphere to the menu itself */
.mobile-menu-bg-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.2) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
}

/* Media Query to show hamburger on Mobile and hide desktop links */
@media (max-width: 900px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-links {
        display: none !important;
    }
    
    /* Make the navbar full width with no border radius on small screens for better edge-to-edge feel */
    .glass-navbar {
        width: 100%;
        border-radius: 0;
        top: 0;
        border-top: none;
        border-left: none;
        border-right: none;
        padding: 15px 20px;
    }
}

/* Mobile Dropdown */
.mobile-nav-dropdown {
    width: 100%;
}
.mobile-dropdown-menu {
    list-style: none !important;
    padding-left: 20px;
    margin-top: 10px;
    display: none;
    border-left: 1px solid rgba(255,255,255,0.1);
}
.mobile-dropdown-menu.is-open {
    display: block;
}
.mobile-dropdown-menu li {
    margin: 15px 0;
    list-style-type: none !important;
    transform: none !important;
    opacity: 1 !important;
}
.mobile-dropdown-menu li a {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.6);
    display: block;
}
.mobile-dropdown-menu li a:hover {
    color: #D4AF37;
}
.mobile-dropdown-menu li a::before {
    display: none; /* remove gradient accent from sublinks */
}

