/* ============================================
   MODERN HAMBURGER MENU NAVIGATION
   ============================================ */

/* Reset any conflicting styles */
.modern-hamburger-menu,
.modern-hamburger-menu *,
.hamburger-menu-toggle,
.hamburger-menu-toggle * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Ensure menu elements are not affected by theme styles */
.modern-hamburger-menu {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
    background: none !important;
    transform: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.modern-hamburger-menu.active {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Hamburger Menu Toggle Button */
.hamburger-menu-toggle {
    position: fixed;
    top: 30px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: rgba(6, 3, 109, 0.9);
    border: 2px solid rgba(242, 129, 32, 0.3);
    border-radius: 12px;
    cursor: pointer;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* WordPress Admin Bar Compatibility */
.admin-bar .hamburger-menu-toggle {
    top: 62px; /* Account for WordPress admin bar */
}

.hamburger-menu-toggle:hover {
    background: rgba(242, 129, 32, 0.9);
    border-color: rgba(242, 129, 32, 0.8);
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(242, 129, 32, 0.4);
}

.hamburger-menu-toggle:focus {
    outline: 2px solid #f28120;
    outline-offset: 4px;
}

/* Hamburger Lines */
.hamburger-line {
    width: 28px;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.hamburger-menu-toggle:hover .hamburger-line {
    background: #ffffff;
}

/* Animated X Transformation */
.hamburger-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

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

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

/* Full-Screen Overlay Menu */
.modern-hamburger-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    background: linear-gradient(135deg, #06036d 0%, #0a0854 50%, #06036d 100%);
    z-index: 99998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    -webkit-overflow-scrolling: touch;
}

/* Ensure menu covers entire viewport including admin bar */
.admin-bar .modern-hamburger-menu {
    top: 32px;
    height: calc(100vh - 32px);
    min-height: calc(100vh - 32px);
}

/* Glassmorphism Overlay */
.modern-hamburger-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(242, 129, 32, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(45, 99, 115, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Grid Pattern Overlay */
.modern-hamburger-menu::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(0deg, transparent 24%, rgba(242, 129, 32, 0.03) 25%, rgba(242, 129, 32, 0.03) 26%, transparent 27%, transparent 74%, rgba(242, 129, 32, 0.03) 75%, rgba(242, 129, 32, 0.03) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(242, 129, 32, 0.03) 25%, rgba(242, 129, 32, 0.03) 26%, transparent 27%, transparent 74%, rgba(242, 129, 32, 0.03) 75%, rgba(242, 129, 32, 0.03) 76%, transparent 77%, transparent);
    background-size: 50px 50px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

/* Menu Active State */
.modern-hamburger-menu.active {
    opacity: 1;
    visibility: visible;
}

/* Menu Container */
.hamburger-menu-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    padding: 60px 40px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 100vh;
    -webkit-overflow-scrolling: touch;
}

/* Menu Logo */
.hamburger-menu-logo {
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(-30px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-hamburger-menu.active .hamburger-menu-logo {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.hamburger-menu-logo img {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(242, 129, 32, 0.3));
}

/* Navigation Links */
.hamburger-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.hamburger-nav-item {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Staggered Animation */
.modern-hamburger-menu.active .hamburger-nav-item:nth-child(1) { 
    opacity: 1; 
    transform: translateX(0); 
    transition-delay: 0.15s; 
}
.modern-hamburger-menu.active .hamburger-nav-item:nth-child(2) { 
    opacity: 1; 
    transform: translateX(0); 
    transition-delay: 0.2s; 
}
.modern-hamburger-menu.active .hamburger-nav-item:nth-child(3) { 
    opacity: 1; 
    transform: translateX(0); 
    transition-delay: 0.25s; 
}
.modern-hamburger-menu.active .hamburger-nav-item:nth-child(4) { 
    opacity: 1; 
    transform: translateX(0); 
    transition-delay: 0.3s; 
}
.modern-hamburger-menu.active .hamburger-nav-item:nth-child(5) { 
    opacity: 1; 
    transform: translateX(0); 
    transition-delay: 0.35s; 
}
.modern-hamburger-menu.active .hamburger-nav-item:nth-child(6) { 
    opacity: 1; 
    transform: translateX(0); 
    transition-delay: 0.4s; 
}
.modern-hamburger-menu.active .hamburger-nav-item:nth-child(7) { 
    opacity: 1; 
    transform: translateX(0); 
    transition-delay: 0.45s; 
}

.hamburger-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 15px 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
}

/* Link Icon */
.hamburger-nav-icon {
    font-size: 28px;
    color: #f28120;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Effect */

/* Modern Active State - Professional Design */
.hamburger-nav-link {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modern Indicator Bar - Enhanced Visibility */
.hamburger-nav-link::before {
    content: '';
    position: absolute;
    left: -20px; /* Move further left for better visibility */
    top: 50%; /* Center vertically */
    width: 6px; /* Increased width */
    height: 0;
    background: linear-gradient(180deg, #F28120 0%, #E67300 100%); /* Gradient always */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px; /* Rounded corners */
    opacity: 0;
    transform: translateY(-50%) scale(0); /* Center and scale */
    transform-origin: center;
    box-shadow: 0 2px 8px rgba(242, 129, 32, 0.2); /* Subtle glow */
}

/* Hover State */
.hamburger-nav-link:hover {
    color: #F28120;
    transform: translateX(8px);
}

.hamburger-nav-link:hover::before {
    height: 24px;
    opacity: 0.7;
    transform: translateY(-50%) scale(1); /* Show with scale */
    box-shadow: 0 3px 12px rgba(242, 129, 32, 0.4); /* Enhanced glow */
}

.hamburger-nav-link:hover .hamburger-nav-icon {
    transform: scale(1.1) rotate(3deg);
    color: #F28120;
}

/* Active State - Modern Professional */
.hamburger-nav-item.active .hamburger-nav-link {
    color: #F28120 !important;
    transform: translateX(12px);
    font-weight: 700;
}

.hamburger-nav-item.active .hamburger-nav-link::before {
    height: 36px; /* Increased height */
    opacity: 1;
    transform: translateY(-50%) scale(1); /* Show with scale */
    background: linear-gradient(180deg, #F28120 0%, #E67300 100%);
    box-shadow: 0 4px 16px rgba(242, 129, 32, 0.5); /* Enhanced glow */
}

.hamburger-nav-item.active .hamburger-nav-icon {
    color: #F28120;
    transform: scale(1.15);
}

/* Active state animation */
@keyframes slideInIndicator {
    from {
        height: 0;
        opacity: 0;
        transform: translateY(-50%) scale(0);
    }
    to {
        height: 36px; /* Updated height */
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

.hamburger-nav-item.active .hamburger-nav-link::before {
    animation: slideInIndicator 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}


/* CTA Button */
.hamburger-cta-button {
    margin-top: 30px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-hamburger-menu.active .hamburger-cta-button {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

.hamburger-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    background: linear-gradient(135deg, #f28120 0%, #e67315 100%);
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 50px;
    letter-spacing: 1.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 30px rgba(242, 129, 32, 0.4);
    border: 2px solid transparent;
}

.hamburger-cta-link:hover {
    background: linear-gradient(135deg, #e67315 0%, #f28120 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 40px rgba(242, 129, 32, 0.6);
    border-color: rgba(255, 255, 255, 0.3);
}

.hamburger-cta-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.hamburger-cta-link:hover .hamburger-cta-icon {
    transform: translateX(5px);
}

/* Social Media Icons */
.hamburger-social-links {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-hamburger-menu.active .hamburger-social-links {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.55s;
}

.hamburger-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(242, 129, 32, 0.3);
    border-radius: 50%;
    color: #ffffff;
    font-size: 20px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hamburger-social-link:hover {
    background: #f28120;
    border-color: #f28120;
    transform: translateY(-5px) rotate(360deg);
    box-shadow: 0 8px 25px rgba(242, 129, 32, 0.5);
}

/* Disable Body Scroll - Position fixed approach */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

/* Prevent scroll behavior conflicts */
html {
    scroll-behavior: auto !important;
}

body.menu-open html {
    scroll-behavior: auto !important;
}

/* Ensure smooth scrolling works properly */
.modern-hamburger-menu {
    scroll-behavior: auto !important;
}

/* Prevent layout shift during menu transitions */
.modern-hamburger-menu.active {
    will-change: opacity, visibility;
}

.modern-hamburger-menu:not(.active) {
    will-change: auto;
}

/* Ensure menu is always on top */
.modern-hamburger-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateZ(0);
}

/* Fix for iOS Safari viewport issues */
@supports (-webkit-touch-callout: none) {
    .modern-hamburger-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Fix for Android viewport issues */
.modern-hamburger-menu {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Fix for mobile viewport height issues */
.modern-hamburger-menu {
    height: 100vh;
    height: -webkit-fill-available;
    max-height: 100vh;
    max-height: -webkit-fill-available;
}

/* Additional mobile viewport fixes */
@media (max-height: 600px) {
    .hamburger-menu-container {
        padding: 30px 20px;
        gap: 20px;
    }
    
    .hamburger-nav-links {
        gap: 10px;
    }
    
    .hamburger-nav-link {
        font-size: 20px;
        padding: 8px 15px;
    }
    
    .hamburger-cta-link {
        padding: 12px 25px;
        font-size: 14px;
    }
}

/* Focus States for Accessibility */
.hamburger-nav-link:focus,
.hamburger-cta-link:focus,
.hamburger-social-link:focus {
    outline: 3px solid #f28120;
    outline-offset: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger-menu-toggle {
        top: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .admin-bar .hamburger-menu-toggle {
        top: 52px; /* Adjust for admin bar on mobile */
    }
    
    .hamburger-line {
        width: 24px;
        height: 2.5px;
    }
    
    .modern-hamburger-menu {
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .admin-bar .modern-hamburger-menu {
        top: 0;
        height: 100vh;
        min-height: 100vh;
    }
    
    .hamburger-menu-container {
        padding: 40px 20px;
        gap: 30px;
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .hamburger-menu-logo img {
        max-width: 150px;
    }
    
    .hamburger-nav-links {
        gap: 15px;
    }
    
    .hamburger-nav-link {
        font-size: 24px;
        padding: 12px 20px;
        letter-spacing: 1.5px;
    }
    
    /* Mobile Active State Adjustments */
    .hamburger-nav-link::before {
        left: -15px; /* Adjusted for mobile */
        width: 4px; /* Increased width */
        border-radius: 2px;
    }
    
    .hamburger-nav-link:hover::before {
        height: 18px;
        transform: translateY(-50%) scale(1);
        box-shadow: 0 2px 10px rgba(242, 129, 32, 0.3);
    }
    
    .hamburger-nav-item.active .hamburger-nav-link::before {
        height: 28px;
        width: 4px;
        transform: translateY(-50%) scale(1);
        box-shadow: 0 3px 14px rgba(242, 129, 32, 0.4);
    }
    
    .hamburger-nav-icon {
        font-size: 22px;
    }
    
    .hamburger-cta-link {
        padding: 15px 35px;
        font-size: 16px;
    }
    
    .hamburger-social-link {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .hamburger-menu-toggle {
        width: 40px;
        height: 40px;
        gap: 5px;
    }
    
    .hamburger-line {
        width: 22px;
        height: 2px;
    }
    
    .hamburger-nav-link {
        font-size: 20px;
        padding: 10px 15px;
        gap: 10px;
    }
    
    /* Small Mobile Active State Adjustments */
    .hamburger-nav-link::before {
        left: -12px; /* Adjusted for small mobile */
        width: 3px; /* Increased width */
        border-radius: 1.5px;
    }
    
    .hamburger-nav-link:hover::before {
        height: 16px;
        transform: translateY(-50%) scale(1);
        box-shadow: 0 2px 8px rgba(242, 129, 32, 0.3);
    }
    
    .hamburger-nav-item.active .hamburger-nav-link::before {
        height: 24px;
        width: 3px;
        transform: translateY(-50%) scale(1);
        box-shadow: 0 3px 12px rgba(242, 129, 32, 0.4);
    }
    
    .hamburger-nav-icon {
        font-size: 18px;
    }
    
    .hamburger-cta-link {
        padding: 12px 30px;
        font-size: 14px;
    }
    
    .hamburger-social-links {
        gap: 15px;
    }
    
    .hamburger-social-link {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .hamburger-menu-toggle {
        border-width: 3px;
    }
    
    .hamburger-nav-link {
        font-weight: 800;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .hamburger-menu-toggle,
    .hamburger-line,
    .modern-hamburger-menu,
    .hamburger-nav-item,
    .hamburger-nav-link,
    .hamburger-cta-button,
    .hamburger-social-links {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .hamburger-menu-toggle,
    .modern-hamburger-menu {
        display: none;
    }
}
