/**
 * Mobile Flyout Menu - Slick AF 🔥
 */

/* Desktop Navigation - Hidden on mobile */
.desktop-navigation {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.desktop-navigation .nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.desktop-navigation .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--solar-primary), var(--neon-blue));
    transition: width 0.3s ease;
}

.desktop-navigation .nav-link:hover::after {
    width: 100%;
}

.desktop-navigation .nav-link:hover {
    color: var(--solar-primary);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: var(--text-primary);
    border-radius: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

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

/* Mobile Flyout Menu */
.mobile-menu-flyout {
    position: fixed;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-menu-flyout.active {
    transform: translateX(0);
}

/* Mobile Menu Header */
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    min-height: 70px;
}

.mobile-menu-logo img {
    height: 35px;
    width: auto;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 0;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.mobile-menu-close:hover {
    background: rgba(255, 107, 53, 0.1);
    color: var(--solar-primary);
    transform: rotate(90deg);
}

/* Mobile Navigation */
.mobile-menu-nav {
    flex: 1;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 2rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(135deg, var(--solar-primary), var(--neon-blue));
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.mobile-nav-link:hover {
    background: rgba(255, 107, 53, 0.05);
    padding-left: 2.5rem;
}

.mobile-nav-link .nav-icon {
    font-size: 1.8rem;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mobile-nav-link:hover .nav-icon {
    transform: scale(1.2) rotate(10deg);
}

.mobile-nav-link .nav-text {
    transition: transform 0.3s ease;
}

.mobile-nav-link:hover .nav-text {
    transform: translateX(4px);
}

/* Staggered Animation */
.mobile-menu-flyout.active .mobile-nav-link {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.mobile-menu-flyout.active .mobile-nav-link:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu-flyout.active .mobile-nav-link:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu-flyout.active .mobile-nav-link:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu-flyout.active .mobile-nav-link:nth-child(4) { animation-delay: 0.25s; }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile Menu Footer */
.mobile-menu-footer {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.mobile-social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 0;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-decoration: none;
}

.social-link:hover {
    background: linear-gradient(135deg, var(--solar-primary), var(--neon-blue));
    color: white;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(255, 107, 53, 0.3);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.mobile-menu-tagline {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
    font-style: italic;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .desktop-navigation {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Mobile header - single line */
    .site-header {
        padding: 0;
        position: relative;
    }

    .header-container {
        padding: 1rem;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        height: 70px;
    }

    /* Logo centered */
    .site-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1;
    }

    .site-logo img {
        height: 35px;
        width: auto;
    }

    /* Hamburger on the right */
    .mobile-menu-toggle {
        position: absolute;
        right: 1rem;
        z-index: 2;
    }

    /* Ensure toggle and close button align perfectly */
    .mobile-menu-toggle,
    .mobile-menu-close {
        width: 32px;
        height: 32px;
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle,
    .mobile-menu-overlay,
    .mobile-menu-flyout {
        display: none !important;
    }
}

/* Prevent body scroll when menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Touch feedback */
@media (hover: none) and (pointer: coarse) {
    .mobile-nav-link:active {
        background: rgba(255, 107, 53, 0.1);
        transform: scale(0.98);
    }

    .social-link:active {
        transform: scale(0.9);
    }
}
