/* Mobile Menu Redesign - Clean, LEFT-Aligned, Accordion Style */

/* Hide desktop language selector and other desktop elements on mobile */
@media (max-width: 768px) {
    /* Hide desktop language selector completely */
    .language-selector.desktop {
        display: none !important;
    }
    
    /* Hide desktop socials dropdown */
    .socials-dropdown {
        display: none !important;
    }
    
    /* Hide desktop binance dropdown */
    .binance-dropdown {
        display: none !important;
    }
    
    /* Hide desktop music button */
    .music-modal-btn:not(.mobile-only) {
        display: none !important;
    }
    
    /* Show mobile header icons */
    .mobile-header-icons {
        display: flex !important;
    }
    
    .col-md-3 > .d-flex {
        display: none !important;
    }
    
    .mobile-only {
        display: flex !important;
    }
}

/* Mobile Header Icons */
.mobile-header-icons {
    display: none;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

/* Music button mobile - NO BORDER, proper spacing */
.music-modal-btn.mobile-only {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--matrix-green-bright);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.music-modal-btn.mobile-only i {
    font-size: 1.2rem;
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
    
    .mobile-header-icons {
        display: none !important;
    }
}

/* Hamburger Menu Icon */
.hamburger-menu {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background: var(--matrix-green-bright);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hamburger to X animation with pulsing red */
.hamburger-menu.open span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
    background: #ff0000;
}

.hamburger-menu.open span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.open span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
    background: #ff0000;
}

/* Pulsing red animation for X */
.hamburger-menu.open span {
    animation: pulseRed 1.5s ease-in-out infinite;
}

@keyframes pulseRed {
    0%, 100% {
        background: #ff0000;
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    }
    50% {
        background: #ff3333;
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
    }
}

/* Mobile Menu Container - BELOW HEADER */
.mobile-menu {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 300px;
    max-width: 85%;
    height: calc(100vh - 70px);
    background: rgba(0, 0, 0, 0.98);
    border-left: 2px solid var(--matrix-green-medium);
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 999;
    padding: 0;
    margin: 0;
}

.mobile-menu.open {
    right: 0;
}

/* Mobile Menu Sections - NO GAPS, NO BUFFER */
.mobile-menu-section {
    border-bottom: 1px solid var(--matrix-green-medium);
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
}

/* Section Headings - NO GREEN BACKGROUND, JUST BORDER, 100% WIDTH */
.mobile-menu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    border-bottom: 1px solid var(--matrix-green-medium);
    margin: 0 !important;
    width: 100%;
    box-sizing: border-box;
}

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

.mobile-menu-toggle span {
    color: var(--matrix-green-bright);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-toggle i {
    color: var(--matrix-green-bright);
    transition: transform 0.3s ease;
    font-size: 1rem;
    margin-left: auto;
}

.mobile-menu-toggle.active i {
    transform: rotate(180deg);
}

/* Mobile Submenus - BLACK BACKGROUND, GREEN TEXT, START COLLAPSED */
.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    list-style: none;
    padding: 0;
    margin: 0;
    background: #000000;
    width: 100%;
    box-sizing: border-box;
}

.mobile-submenu.open {
    max-height: 1000px !important;
    overflow-y: auto;
}

.mobile-submenu li {
    border-bottom: 1px solid rgba(0, 255, 0, 0.1);
}

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

/* LEFT-ALIGNED menu items - 100% WIDTH */
.mobile-submenu li a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 20px;
    color: var(--matrix-green-bright);
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: left;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.mobile-submenu li a i {
    font-size: 1.1rem;
    min-width: 20px;
}

.mobile-submenu li a img {
    width: 24px;
    height: 18px;
    border-radius: 2px;
}

.mobile-submenu li a:hover {
    background: rgba(0, 255, 0, 0.15);
    color: #ffffff;
}

.mobile-submenu li a.active {
    background: rgba(0, 255, 0, 0.2);
    color: #ffffff;
}

/* Current flag in language toggle */
.current-flag {
    width: 24px;
    height: 18px;
    border-radius: 2px;
}

/* Binance submenu hero thumbnails */
.mobile-submenu.binance-submenu li a img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--matrix-green-medium);
}

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

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

.mobile-menu::-webkit-scrollbar-thumb {
    background: var(--matrix-green-medium);
    border-radius: 3px;
}

.mobile-menu::-webkit-scrollbar-thumb:hover {
    background: var(--matrix-green-bright);
}

.mobile-submenu::-webkit-scrollbar {
    width: 4px;
}

.mobile-submenu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}

.mobile-submenu::-webkit-scrollbar-thumb {
    background: var(--matrix-green-medium);
    border-radius: 2px;
}



/* Prevent massive flag popup overlay */
@media (max-width: 768px) {
    /* Force hide any language selector dropdowns that appear as overlays */
    .language-selector-dropdown:not(.mobile-submenu .language-selector-dropdown) {
        display: none !important;
    }
    
    /* Hide mobile language selector that's not in menu */
    .language-selector.mobile:not(.mobile-menu .language-selector.mobile) {
        display: none !important;
    }
}

/* Ensure desktop language selector is completely hidden on mobile */
@media (max-width: 768px) {
    .language-selector:not(.mobile-menu *) {
        display: none !important;
    }
    
    /* Hide any flag images outside mobile menu */
    img[alt*="flag"]:not(.mobile-menu *),
    img[src*="/flags/"]:not(.mobile-menu *) {
        display: none !important;
    }
}

