/* Mobile Menu Toggle Button */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1000;
}

.menu-toggle:hover {
    border-color: transparent;
    box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.2);
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--accent-cyan);
    margin: 2px 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 1px;
}

.menu-toggle.active {
    border: 1px solid var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* Mobile Navigation */
.header-nav {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@media (max-width: 900px) {
    .menu-toggle {
        display: flex;
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(20px);
        border-left: 2px solid var(--primary-bg);
        z-index: 999;
        padding: 100px 0 40px;
        overflow-y: auto;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
    }

    .header-nav.active {
        right: 0;
    }

    .header-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0 24px;
    }

    .header-nav li {
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .header-nav li:last-child {
        border-bottom: none;
    }

    .header-nav a {
        display: block;
        padding: 20px 16px;
        font-size: 16px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        border-left: 3px solid transparent;
        transition: all 0.3s ease;
        position: relative;
    }

    .header-nav a:hover,
    .header-nav a:focus {
        border-left-color: var(--accent-cyan);
        background: rgba(0, 212, 255, 0.1);
        padding-left: 24px;
    }

    .header-nav a::after {
        content: '→';
        position: absolute;
        right: 16px;
        opacity: 0;
        transform: translateX(-10px);
        transition: all 0.3s ease;
    }

    .header-nav a:hover::after,
    .header-nav a:focus::after {
        opacity: 1;
        transform: translateX(0);
    }

    /* Mobile menu animations */
    .header-nav.active li {
        animation: slideInRight 0.5s ease forwards;
    }

    .header-nav.active li:nth-child(1) {
        animation-delay: 0.1s;
    }

    .header-nav.active li:nth-child(2) {
        animation-delay: 0.2s;
    }

    .header-nav.active li:nth-child(3) {
        animation-delay: 0.3s;
    }

    .header-nav.active li:nth-child(4) {
        animation-delay: 0.4s;
    }

    .header-nav.active li:nth-child(5) {
        animation-delay: 0.5s;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .header-nav {
        width: 100%;
        right: -100%;
    }

    .header-nav.active {
        right: 0;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {

    .menu-toggle span,
    .header-nav,
    .header-nav a,
    .mobile-menu-overlay {
        transition: none !important;
    }

    .header-nav.active li {
        animation: none !important;
    }
}