/**
 * Mobile Navigation Styles
 * 
 * Premium mobile navigation with smooth animations, glassmorphism,
 * and touch-optimized interactions.
 */

/* Hamburger Button */
.hamburger {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    padding: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.hamburger:active {
    transform: scale(0.95);
}

/* Hamburger Icon Bars */
.hamburger-icon {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Hamburger Active State (X transformation) */
.hamburger.active .hamburger-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.hamburger.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active .hamburger-icon span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Navigation Backdrop */
.nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.nav-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Navigation Drawer */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(85vw, 400px);
    height: 100vh;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.98) 0%,
        rgba(8, 12, 20, 0.98) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(56, 189, 248, 0.2);
    box-shadow: -10px 0 60px rgba(0, 0, 0, 0.5);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}

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

/* Mobile Nav Header */
.mobile-nav-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 80px;
}

.mobile-nav-home {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.mobile-nav-home:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: 12px;
}

.mobile-nav-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.4));
}

.mobile-nav-branding {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-nav-title {
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.mobile-nav-subtitle {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

/* Mobile Nav Links */
.mobile-nav-links {
    padding: 1rem 0;
    flex: 1;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 56px;
    letter-spacing: 0.5px;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-link:active,
.mobile-nav-link:hover {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
}

.mobile-nav-link:active::before,
.mobile-nav-link:hover::before {
    transform: scaleY(1);
}

.mobile-nav-link .material-symbols-outlined {
    font-size: 24px;
    color: var(--primary);
}

/* Mobile Nav Footer */
.mobile-nav-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #030712;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.3);
    min-height: 50px;
}

.mobile-nav-cta:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

/* Show hamburger on mobile */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Hide desktop navigation on mobile */
    body.landing .main-nav,
    body.landing .nav-actions,
    .top-bar .main-nav,
    .top-bar .nav-actions {
        display: none;
    }

    /* For non-landing pages */
    .main-nav {
        display: none;
    }
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .mobile-nav,
    .nav-backdrop,
    .hamburger-icon span,
    .mobile-nav-link {
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
