/* ============================================
   Header Responsive - Single Menu Adaptation
   ============================================ */

/* Desktop (≥ 1200px) */
@media screen and (min-width: 1200px) {
    /* Hide mobile-specific elements */
    .mobile-menu-btn,
    .mobile-video-item,
    .mobile-favorites-item,
    .mobile-categories-btn,
    .mobile-search-item,
    .mobile-languages-item,
    .menu-close,
    .submenu-panel,
    #mobile-search-modal {
        display: none !important;
    }

    /* Desktop dropdown */
    .menu-item-dropdown .dropdown-toggle {
        display: inline;
    }

    .menu-item-dropdown .dropdown-overlay {
        display: none;
    }

    .menu-item-dropdown:hover .dropdown-overlay {
        display: block;
    }
}

/* Tablet & Mobile (< 1200px) */
@media screen and (max-width: 1199px) {
    /* Hide desktop dropdown */
    .menu-item-dropdown .dropdown-toggle,
    .menu-item-dropdown .dropdown-overlay {
        display: none !important;
    }

    /* Show mobile categories button */
    .mobile-categories-btn {
        display: block !important;
        width: 100%;
        text-align: left;
        background: none;
        border: none;
        color: #F4F4F4;
        font-family: "Noto Sans", sans-serif;
        font-weight: 500;
        font-size: 16px;
        cursor: pointer;
        padding: 15px 20px 15px 0;
    }

    .mobile-categories-btn:hover {
        color: rgba(205, 52, 51, 1);
    }

    /* Toggle button - show on mobile */
    .toggle-menu {
        display: flex !important;
    }

    /* Menu wrapper - hidden by default on mobile */
    .menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        background: #171502;
        flex-direction: column;
        gap: 0;
        padding: 20px;
        box-sizing: border-box;
        justify-content: center;
        align-items: center;
        z-index: 9999;
        overflow: auto;
        list-style: none;
        margin: 0;
    }

    /* Menu open state when menu has open class */
    .menu.open {
        display: flex;
        justify-content: flex-start;
        padding-top: 80px;
    }

    /* Menu close button */
    .menu-close {
        position: fixed;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 10001;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 5px;
        transition: opacity 0.3s ease;
    }

    .menu-close:hover {
        opacity: 0.7;
    }

    .menu-close img {
        width: 24px;
        height: 24px;
    }

    /* Menu items styling for mobile */
    .menu-item {
        width: auto;
        border-bottom: none;
        padding: 15px 0;
        text-align: center;
    }

    .menu-item:last-child {
        border-bottom: none;
    }

    .menu-item a {
        display: block;
        font-size: 18px;
        color: #F4F4F4;
        text-decoration: none;
        transition: color 0.3s ease;
    }

    .menu-item a:hover {
        color: rgba(205, 52, 51, 1);
    }

    /* Show mobile-specific items */
    .mobile-video-item,
    .mobile-favorites-item,
    .mobile-search-item,
    .mobile-languages-item {
        display: block !important;
    }

    /* Mobile Search Button */
    .mobile-search-item {
        width: 100%;
        margin: 20px 0;
    }


    .mobile-languages {
        display: flex;
        gap: 15px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .mobile-languages .language-link {
        padding: 8px 16px;
        background: rgba(205, 52, 51, 0.6);
        color: #F4F4F4;
        text-decoration: none;
        border-radius: 4px;
        font-size: 14px;
        transition: background 0.3s ease;
    }

    .mobile-languages .language-link:hover {
        background: rgba(205, 52, 51, 1);
    }

    /* Mobile search button */
    .open-mobile-search-btn {
        background: none;
        border: none;
        color: #F4F4F4;
        font-family: "Noto Sans", sans-serif;
        font-weight: 500;
        font-size: 16px;
        cursor: pointer;
        padding: 0;
        transition: color 0.3s ease;
    }

    .open-mobile-search-btn:hover {
        color: rgba(205, 52, 51, 1);
    }

    /* Submenu panel - mobile only */
    .submenu-panel {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #171502;
        padding: 20px;
        flex-direction: column;
        gap: 15px;
        z-index: 101;
        justify-content: center;
        align-items: center;
    }

    .submenu-panel.open {
        display: flex;
    }

    .submenu-back {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        background: none;
        border: none;
        color: #F4F4F4;
        font-family: "Noto Sans", sans-serif;
        font-weight: 500;
        cursor: pointer;
        transition: color 0.3s ease;
        padding: 0;
        margin-bottom: 30px;
        font-size: 16px;
    }

    .submenu-back:hover {
        color: rgba(205, 52, 51, 1);
    }

    .submenu-back img {
        transform: rotate(90deg);
    }

    .submenu-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .submenu-list li {
        border-bottom: none;
        padding: 0;
    }

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

    .submenu-list a {
        color: #F4F4F4;
        text-decoration: none;
        font-size: 18px;
        transition: color 0.3s ease;
    }

    .submenu-list a:hover {
        color: rgba(205, 52, 51, 1);
    }
}

/* Mobile specific (< 768px) */
@media screen and (max-width: 767px) {
    /* Ensure header is always visible and spans full width */
    .header {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        transform: none !important;
        max-width: 100% !important;
    }

    .menu-item {
        padding: 12px 0;
    }

    .menu-item a {
        font-size: 14px;
    }

    .mobile-categories-btn {
        font-size: 14px;
    }

    .submenu-panel {
        padding: 15px;
    }

    .submenu-list a {
        font-size: 14px;
    }

    /* Mobile languages adjustments */
    .mobile-languages .language-link {
        font-size: 12px;
        padding: 6px 12px;
    }
}
