/* ========================================
   UNIFIED MOBILE MENU SYSTEM
   Universal mobile menu styles for all pages
   ======================================== */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem;
    min-width: 48px;
    min-height: 48px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    z-index: 1001;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 165, 0, 0.1);
    transform: scale(1.05);
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #ffa500;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hamburger Animation */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
    background: #ff6b35;
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
    background: #ff6b35;
}

/* Main Mobile Menu Container */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(10, 20, 40, 0.98);
    backdrop-filter: blur(20px);
    z-index: 9999;
    transition: left 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu.active {
    left: 0;
}

/* Mobile Menu List */
.mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(10, 20, 40, 0.98);
    backdrop-filter: blur(20px);
    height: 100vh;
    overflow-y: auto;
    padding-top: 2rem;
}

.mobile-menu li {
    border-bottom: 1px solid rgba(255, 165, 0, 0.1);
    transition: all 0.3s ease;
}

/* Regular Menu Links */
.mobile-menu .menu-link {
    display: flex;
    align-items: center;
    padding: 1.25rem 2rem;
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    min-height: 56px;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 165, 0, 0.2);
}

.mobile-menu .menu-link:hover {
    background: rgba(255, 165, 0, 0.1);
    padding-left: 2.5rem;
    color: #ffa500;
}

/* Parent Menu Categories */
.mobile-menu .menu-parent {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 56px;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 165, 0, 0.3);
    user-select: none;
}

/* Category-Specific Colors */
.mobile-menu .menu-parent.gaming {
    background: rgba(255, 165, 0, 0.08);
    border-left: 4px solid #ffa500;
    color: #ffa500;
}

.mobile-menu .menu-parent.runes {
    background: rgba(78, 205, 196, 0.08);
    border-left: 4px solid #4ecdc4;
    color: #4ecdc4;
}

.mobile-menu .menu-parent.bitcoin {
    background: rgba(255, 107, 53, 0.08);
    border-left: 4px solid #ff6b35;
    color: #ff6b35;
}

.mobile-menu .menu-parent:hover {
    background: rgba(255, 255, 255, 0.05);
    padding-left: 2.25rem;
}

/* Dropdown Arrow */
.mobile-menu .menu-parent .arrow {
    font-size: 1rem;
    transition: transform 0.3s ease;
    color: inherit;
}

.mobile-menu .menu-parent.expanded .arrow {
    transform: rotate(180deg);
}

/* Submenu Container */
.mobile-menu .submenu {
    max-height: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.mobile-menu .submenu.expanded {
    max-height: 500px;
    opacity: 1;
}

.mobile-menu .submenu li {
    border-bottom: none;
}

/* Submenu Links */
.mobile-menu .submenu a {
    display: flex;
    align-items: center;
    padding: 1rem 3rem;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1rem;
    min-height: 48px;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Category-Specific Submenu Colors */
.mobile-menu .submenu.gaming a {
    border-bottom-color: rgba(255, 165, 0, 0.1);
}

.mobile-menu .submenu.runes a {
    border-bottom-color: rgba(78, 205, 196, 0.1);
}

.mobile-menu .submenu.bitcoin a {
    border-bottom-color: rgba(255, 107, 53, 0.1);
}

.mobile-menu .submenu a:hover {
    background: rgba(255, 255, 255, 0.05);
    padding-left: 3.5rem;
    color: white;
}

.mobile-menu .submenu a:last-child {
    border-bottom: none;
}

/* Special Menu Items */
.mobile-menu .special-item {
    margin: 0.5rem 0;
}

.mobile-menu .special-item a {
    display: flex;
    align-items: center;
    padding: 1.25rem 2rem;
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    min-height: 56px;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 165, 0, 0.2);
}

.mobile-menu .special-item a:hover {
    background: rgba(255, 165, 0, 0.1);
    padding-left: 2.5rem;
    color: #ffa500;
}

/* Close overlay when clicking outside */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .nav-menu { 
        display: none !important; 
    }
    
    .mobile-menu-toggle { 
        display: flex !important; 
    }
}

@media (max-width: 480px) {
    .mobile-menu .menu-parent,
    .mobile-menu .menu-link {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .mobile-menu .submenu a {
        padding-left: 2.5rem;
    }
    
    .mobile-menu .menu-parent:hover {
        padding-left: 1.75rem;
    }
    
    .mobile-menu .submenu a:hover {
        padding-left: 3rem;
    }
}

/* Animation for smooth transitions */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.mobile-menu.active ul {
    animation: slideInFromLeft 0.3s ease-out;
}

/* Fix for z-index stacking issues */
.mobile-menu,
.mobile-menu * {
    -webkit-tap-highlight-color: transparent;
}

/* Scrollbar styling for webkit browsers */
.mobile-menu::-webkit-scrollbar {
    width: 4px;
}

.mobile-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 165, 0, 0.5);
    border-radius: 2px;
}

.mobile-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 165, 0, 0.8);
}