/* Mobile Menu - Synthesia Style Vertical */

/* Variables */
:root {
    --menu-width: 320px;
    --menu-transition: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile Menu Button */
#mobile-menu-btn {
    position: relative;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

#mobile-menu-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(0,0,0,0.1) 0%, transparent 70%);
    transition: width 0.3s, height 0.3s;
    transform: translate(-50%, -50%);
}

#mobile-menu-btn:hover::before {
    width: 100px;
    height: 100px;
}

#mobile-menu-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

/* Burger Icon Animation */
.burger-line {
    display: block;
    width: 16px;
    height: 2px;
    background: #1e293b !important;
    margin: 3px auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

#mobile-menu-btn.active .burger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#mobile-menu-btn.active .burger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#mobile-menu-btn.active .burger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu Overlay */
#mobile-menu-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

#mobile-menu-overlay.hidden {
    animation: fadeOut 0.3s ease;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
    }
    to { 
        opacity: 1;
    }
}

@keyframes fadeOut {
    from { 
        opacity: 1;
    }
    to { 
        opacity: 0;
    }
}

/* Mobile Menu Panel - Left Side */
#mobile-menu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: var(--menu-width);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
}

#mobile-menu.menu-open {
    transform: translateX(0);
}

/* Mobile Menu Header */
.mobile-menu-header {
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Mobile Menu Close Button */
.mobile-menu-close {
    position: relative;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

/* Mobile Menu Links */
.mobile-menu-link {
    position: relative;
    background: transparent;
    border: none;
    padding: 12px 16px;
    margin: 0;
    transition: all 0.3s ease;
    border-radius: 12px;
    display: flex;
    align-items: center;
    text-decoration: none;
    overflow: hidden;
}

.mobile-menu-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.5s;
}

.mobile-menu-link:hover::before {
    left: 100%;
}

.mobile-menu-link:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateX(4px);
}

.mobile-menu-link:active {
    transform: translateX(2px) scale(0.98);
}

/* Menu Item Icons */
.mobile-menu-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    transition: all 0.3s ease;
}

.mobile-menu-link:hover .mobile-menu-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Stagger Animation for Menu Items */
.mobile-menu-link {
    opacity: 0;
    animation: slideInLeft 0.4s forwards;
}

.mobile-menu-link:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu-link:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu-link:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu-link:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu-link:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu-link:nth-child(6) { animation-delay: 0.35s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Section Headers */
.menu-section-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    margin: 16px 0 8px 0;
}

/* Mobile Menu Footer */
.mobile-menu-footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* CTA Button in Menu */
.menu-cta-button {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.menu-cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transition: width 0.3s, height 0.3s;
    transform: translate(-50%, -50%);
}

.menu-cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.menu-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -5px rgba(37, 99, 235, 0.5);
}

/* Touch Feedback */
@media (hover: none) {
    .mobile-menu-link:active {
        background: rgba(0, 0, 0, 0.1);
    }
    
    #mobile-menu-btn:active {
        transform: scale(0.95);
    }
}

/* Landscape Adjustments */
@media (max-height: 500px) {
    #mobile-menu {
        overflow-y: auto;
    }
    
    .mobile-menu-header {
        padding: 12px 16px;
    }
    
    .mobile-menu-link {
        padding: 10px 16px;
    }
}

/* Smooth Transitions */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Swipe Gesture Support */
#mobile-menu {
    will-change: transform;
}

/* Performance Optimizations */
.mobile-menu-link,
#mobile-menu-btn,
.mobile-menu-close {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}