/**
 * Modern Hamburger Menu System
 * Brand-compliant design with orange-red gradient and auto-hide functionality
 * Fay EdTech Brand Colors: #F38E20 (Orange), #D42027 (Red)
 */

/* Modern Hamburger Button */
.modern-hamburger-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: linear-gradient(135deg, #F38E20 0%, #D42027 100%);
    border: none;
    border-radius: 12px;
    width: 56px;
    height: 56px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(243, 142, 32, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.modern-hamburger-menu:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 142, 32, 0.5);
}

.modern-hamburger-menu:active {
    transform: translateY(0px);
    box-shadow: 0 2px 8px rgba(243, 142, 32, 0.3);
}

/* Hamburger Lines Container */
.hamburger-lines {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 24px;
    height: 18px;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Animation when menu is active */
.modern-hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.modern-hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

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

/* Mobile Navigation Overlay */
.modern-mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.modern-mobile-nav.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Navigation Content Container */
.mobile-nav-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 2rem;
    text-align: center;
}

/* Navigation Header */
.mobile-nav-header {
    margin-bottom: 3rem;
}

.mobile-nav-title {
    color: #F38E20;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    font-family: 'Playfair Display', serif;
}

.mobile-nav-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin: 0.5rem 0 0 0;
}

/* Navigation Links */
.mobile-nav-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 300px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.5rem;
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.mobile-nav-link i {
    font-size: 1.3rem;
    min-width: 20px;
    opacity: 0.9;
    flex-shrink: 0;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
    background: linear-gradient(135deg, #F38E20 0%, #D42027 100%);
    border-color: #F38E20;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 142, 32, 0.3);
}

.mobile-nav-link.active {
    background: linear-gradient(135deg, #F38E20 0%, #D42027 100%);
    border-color: #F38E20;
    color: white;
}

.mobile-nav-link.active i {
    opacity: 1;
}

/* Active indicator for current page */
.nav-active-indicator {
    margin-left: auto;
    font-size: 1rem;
    opacity: 1 !important;
    flex-shrink: 0;
}

/* Navigation Divider */
.mobile-nav-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    margin: 1rem 0;
}

/* Navigation Footer */
.mobile-nav-footer {
    margin-top: 3rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Show hamburger menu on mobile */
@media (max-width: 768px) {
    .modern-hamburger-menu {
        display: flex;
    }
    
    /* Hide desktop navigation on mobile */
    .main-nav {
        display: none !important;
    }
}

/* Hide hamburger menu on desktop */
@media (min-width: 769px) {
    .modern-hamburger-menu,
    .modern-mobile-nav {
        display: none !important;
    }
}

/* Prevent body scroll when mobile menu is open */
body.modern-mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* High DPI / Retina Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hamburger-line {
        height: 2px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .modern-hamburger-menu,
    .modern-mobile-nav,
    .hamburger-line,
    .mobile-nav-link {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.modern-hamburger-menu:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(243, 142, 32, 0.5);
}

.mobile-nav-link:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(243, 142, 32, 0.5);
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .modern-hamburger-menu {
        min-width: 44px;
        min-height: 44px;
    }
    
    .mobile-nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}