/**
 * Denali Tech - Mobile Menu Styles
 * Shared mobile menu CSS for all pages
 * Version: 1.0.0
 * Date: January 2025
 */

/* Mobile Menu Backdrop Overlay */
.mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Enhanced Mobile Menu Container */
@media (max-width: 768px) {
    .nav-links.active {
        display: flex !important;
        position: fixed !important;
        top: var(--mobile-header-height) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        z-index: 9999 !important;
        background: var(--bg-color) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        padding: 1.5rem 1rem !important;
        gap: 0.5rem !important;
        border-bottom: 1px solid var(--border-color) !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset !important;
        pointer-events: auto !important;
        transform: translateY(0) !important;
        margin: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        align-items: stretch !important;
        flex-direction: column !important;
        animation: slideDownMenu 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        max-height: calc(100vh - var(--mobile-header-height)) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    @keyframes slideDownMenu {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .nav-links.active li {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        display: block !important;
        animation: fadeInMenuItem 0.3s ease forwards !important;
        opacity: 0;
    }
    
    .nav-links.active li:nth-child(1) { animation-delay: 0.05s; }
    .nav-links.active li:nth-child(2) { animation-delay: 0.1s; }
    .nav-links.active li:nth-child(3) { animation-delay: 0.15s; }
    .nav-links.active li:nth-child(4) { animation-delay: 0.2s; }
    .nav-links.active li:nth-child(5) { animation-delay: 0.25s; }
    .nav-links.active li:nth-child(6) { animation-delay: 0.3s; }
    .nav-links.active li:nth-child(7) { animation-delay: 0.35s; }
    
    @keyframes fadeInMenuItem {
        to {
            opacity: 1;
            transform: translateX(0);
        }
        from {
            opacity: 0;
            transform: translateX(-10px);
        }
    }
    
    .nav-links.active li a {
        color: var(--text-primary) !important;
        background: transparent !important;
        padding: 1rem 1.25rem !important;
        display: flex !important;
        align-items: center !important;
        text-decoration: none !important;
        font-weight: 500 !important;
        font-size: 1.05rem !important;
        border-radius: 12px !important;
        width: 100% !important;
        text-align: left !important;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        margin: 0.25rem 0 !important;
        box-sizing: border-box !important;
        position: relative !important;
        overflow: hidden !important;
        border: 1px solid transparent !important;
        min-height: 52px !important;
    }
    
    /* Ripple Effect on Touch */
    .nav-links.active li a::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(249, 115, 22, 0.2);
        transform: translate(-50%, -50%);
        transition: width 0.4s ease, height 0.4s ease;
        pointer-events: none;
    }
    
    /* Active Indicator Bar */
    .nav-links.active li a::before {
        content: '' !important;
        position: absolute !important;
        left: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 4px !important;
        height: 0 !important;
        background: linear-gradient(180deg, var(--accent-primary), var(--accent-interactive)) !important;
        border-radius: 0 2px 2px 0 !important;
        transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 0 0 8px rgba(249, 115, 22, 0.5) !important;
    }
    
    /* Touch/Tap Active State - Better for Mobile */
    .nav-links.active li a:active {
        background: rgba(249, 115, 22, 0.15) !important;
        color: var(--accent-primary) !important;
        padding-left: 1.5rem !important;
        transform: scale(0.98) !important;
        border-color: rgba(249, 115, 22, 0.3) !important;
    }
    
    .nav-links.active li a:active::before {
        height: 70% !important;
    }
    
    .nav-links.active li a:active::after {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
    
    /* Focus State for Accessibility */
    .nav-links.active li a:focus-visible {
        outline: 3px solid var(--accent-primary) !important;
        outline-offset: 2px !important;
        background: rgba(249, 115, 22, 0.1) !important;
        color: var(--accent-primary) !important;
    }
    
    .nav-links.active li a:focus-visible::before {
        height: 70% !important;
    }
    
    /* Current Page Indicator */
    .nav-links.active li a[style*="color: var(--accent-primary)"] {
        background: rgba(249, 115, 22, 0.12) !important;
        color: var(--accent-primary) !important;
        font-weight: 600 !important;
        border-color: rgba(249, 115, 22, 0.2) !important;
    }
    
    .nav-links.active li a[style*="color: var(--accent-primary)"]::before {
        height: 70% !important;
    }
    
    /* Hover State (for devices that support it, like tablets with stylus) */
    @media (hover: hover) and (pointer: fine) {
        .nav-links.active li a:hover {
            background: rgba(249, 115, 22, 0.1) !important;
            color: var(--accent-primary) !important;
            padding-left: 1.5rem !important;
            transform: translateX(4px) !important;
        }
        
        .nav-links.active li a:hover::before {
            height: 70% !important;
        }
    }
    
    /* Disable hover on touch devices */
    @media (hover: none) and (pointer: coarse) {
        .nav-links.active li a:hover {
            background: transparent !important;
            color: var(--text-primary) !important;
            padding-left: 1.25rem !important;
            transform: none !important;
        }
        
        .nav-links.active li a:hover::before {
            height: 0 !important;
        }
    }
    
    /* Enhanced Mobile Call Button */
    .nav-links.active .mobile-call-btn {
        margin-top: 1rem !important;
        padding-top: 1rem !important;
        border-top: 2px solid var(--border-color) !important;
        animation: fadeInMenuItem 0.4s ease forwards !important;
        opacity: 0;
        animation-delay: 0.4s !important;
    }
    
    .nav-links.active .mobile-call-btn a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        text-align: center !important;
        background: linear-gradient(135deg, var(--accent-primary), var(--accent-interactive)) !important;
        color: white !important;
        padding: 1.1rem 1.5rem !important;
        border-radius: 12px !important;
        text-decoration: none !important;
        font-weight: 700 !important;
        font-size: 1.05rem !important;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4) !important;
        border: none !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    .nav-links.active .mobile-call-btn a::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
    }
    
    .nav-links.active .mobile-call-btn a:active {
        transform: scale(0.96) !important;
        box-shadow: 0 2px 10px rgba(249, 115, 22, 0.5) !important;
        background: linear-gradient(135deg, var(--accent-interactive), var(--accent-primary)) !important;
    }
    
    .nav-links.active .mobile-call-btn a:active::before {
        left: 100%;
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }
    
    /* Enhanced Hamburger Menu Icon */
    .menu-toggle {
        position: relative;
        z-index: 10001;
        transition: transform 0.3s ease;
    }
    
    .menu-toggle:active {
        transform: scale(0.95);
    }
    
    .menu-toggle span {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .menu-toggle.active {
        transform: rotate(0deg);
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
        background: var(--accent-primary);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-10px);
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
        background: var(--accent-primary);
    }
}
