/* ===================================
   Mobile Menu Styles - HR Fiber
   =================================== */

/* Mobile Menu Button */
#mobileMenuBtn {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mobileMenuBtn:active {
    background: rgba(0, 0, 0, 0.1);
}

.dark #mobileMenuBtn:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Menu Sidebar */
#mobileMenu {
    max-height: 100vh;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Gradient border effect */
.border-gradient {
    border-image: linear-gradient(90deg, #4F46E5, #8B5CF6, #4F46E5) 1;
}

/* Background size utilities for animations */
.bg-size-200 {
    background-size: 200% auto;
}

.bg-pos-0 {
    background-position: 0% center;
}

.bg-pos-100 {
    background-position: 100% center;
}

/* Menu header styling */
#mobileMenu > div:first-child > div:first-child {
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 10;
    backdrop-filter: blur(10px);
}

/* Menu items hover effect */
#mobileMenu nav a {
    position: relative;
    overflow: hidden;
}

/* Stagger animation for menu items */
#mobileMenu nav a:nth-child(1) {
    animation: slideInLeft 0.3s ease-out 0.1s both;
}

#mobileMenu nav a:nth-child(2) {
    animation: slideInLeft 0.3s ease-out 0.2s both;
}

#mobileMenu nav a:nth-child(3) {
    animation: slideInLeft 0.3s ease-out 0.3s both;
}

#mobileMenu nav a:nth-child(4) {
    animation: slideInLeft 0.3s ease-out 0.4s both;
}

#mobileMenu nav a:nth-child(5) {
    animation: slideInLeft 0.3s ease-out 0.5s both;
}

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

/* Icon box gradient animation */
#mobileMenu nav a .w-10 {
    position: relative;
    overflow: hidden;
}

#mobileMenu nav a .w-10::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

#mobileMenu nav a:hover .w-10::after {
    transform: translateX(100%);
}

/* CTA Button animation */
#mobileMenu a[href*="order.php"] {
    animation: fadeInUp 0.4s ease-out 0.6s both, pulse-glow 3s ease-in-out 1s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
    }
    50% {
        box-shadow: 0 6px 30px rgba(79, 70, 229, 0.6);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shimmer effect for CTA button */
#mobileMenu a[href*="order.php"] .absolute {
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) skewX(-15deg);
    }
    100% {
        transform: translateX(200%) skewX(-15deg);
    }
}

/* Contact buttons animation */
#mobileMenu .grid.grid-cols-2 {
    animation: fadeInUp 0.4s ease-out 0.7s both;
}

#mobileMenu .grid.grid-cols-2 a:first-child {
    animation: scaleIn 0.4s ease-out 0.8s both;
}

#mobileMenu .grid.grid-cols-2 a:last-child {
    animation: scaleIn 0.4s ease-out 0.9s both;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Ripple effect on contact buttons */
#mobileMenu .grid.grid-cols-2 a {
    position: relative;
    overflow: hidden;
}

#mobileMenu .grid.grid-cols-2 a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.5s ease;
}

#mobileMenu .grid.grid-cols-2 a:active::before {
    transform: scale(2);
}

/* Overlay animation */
#mobileMenuOverlay {
    backdrop-filter: blur(2px);
    animation: fadeIn 0.3s ease;
}

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

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

/* Mobile menu shadow */
#mobileMenu {
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}

.dark #mobileMenu {
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}

/* Better touch targets for mobile */
@media (max-width: 767px) {
    #mobileMenu nav a {
        min-height: 48px; /* Recommended touch target size */
    }
    
    #mobileMenu button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Hamburger button animation */
.hamburger-btn {
    position: relative;
}

.hamburger-btn:active {
    transform: scale(0.95);
}

/* Icon transitions */
#mobileMenu .material-symbols-outlined {
    transition: transform 0.2s ease;
}

#mobileMenu nav a:hover .material-symbols-outlined,
#mobileMenu nav a:active .material-symbols-outlined {
    transform: scale(1.1);
}

/* Border styling for dark mode */
.dark #mobileMenu {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dark mode menu items */
.dark #mobileMenu nav a {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.05);
}

.dark #mobileMenu nav a:hover {
    background: linear-gradient(to right, rgba(79, 70, 229, 0.2), rgba(139, 92, 246, 0.2));
    border-color: rgba(79, 70, 229, 0.4);
}

/* Custom scrollbar for menu */
#mobileMenu::-webkit-scrollbar {
    width: 6px;
}

#mobileMenu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

#mobileMenu::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4F46E5, #8B5CF6);
    border-radius: 10px;
}

#mobileMenu::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6366F1, #A78BFA);
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    #mobileMenu {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Menu entrance animation */
#mobileMenu:not(.-translate-x-full) {
    animation: menuSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes menuSlideIn {
    from {
        transform: translateX(-100%);
        opacity: 0.8;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
