/* Mobile Menu Styles - Unified design with color themes */

/* Base Mobile Menu Styles */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}

/* Desktop - Hide mobile menu */
@media (min-width: 1080px) {
    .mobile-menu {
        display: none !important;
    }
    
    .desktop-navigation {
        display: block !important;
    }
}

.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 2px solid;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    margin-right: 0.5rem;
}

.hamburger-icon span {
    width: 20px;
    height: 2px;
    margin: 2px 0;
    transition: all 0.3s ease;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

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

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-menu.active .mobile-menu-content {
    transform: translateX(0);
}

/* Mobile Menu Header */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.mobile-menu-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mobile-menu-close:hover {
    background-color: #f0f0f0;
}

.close-icon {
    font-size: 1.5rem;
    color: #666;
}

/* Mobile Menu Tabs */
.mobile-menu-tabs {
    display: flex;
    /* border-bottom: 1px solid #e0e0e0; */
    background: #f8f9fa;
}

.mobile-tab-button {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    border-bottom: 3px solid transparent;
}

.mobile-tab-button.active {
    color: #333;
    background: #fff;
}

/* Mobile Menu Main Content */
.mobile-menu-main {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.mobile-tab-content {
    display: none;
    height: 100%;
}

.mobile-tab-content.active {
    display: block;
}

/* Mobile Navigation */
.mobile-navigation {
    padding: 0;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-nav-link {
    flex: 1;
    display: block;
    padding: 1rem 1.5rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    background-color: #f8f9fa;
}

.mobile-expand-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mobile-expand-button:hover {
    background-color: #f0f0f0;
}

.expand-icon {
    font-size: 1.2rem;
    color: #666;
    transition: transform 0.3s ease;
}

.mobile-nav-item.expanded .expand-icon {
    transform: rotate(90deg);
}

/* Mobile Sub Navigation */
.mobile-sub-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    display: none;
    border-top: 1px solid #e0e0e0;
}

.mobile-sub-nav-item {
    border-bottom: 1px solid #e0e0e0;
}

.mobile-sub-nav-item:last-child {
    border-bottom: none;
}

.mobile-sub-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.mobile-sub-nav-link:hover {
    background-color: #e9ecef;
    color: #333;
}

.subcategory-arrow {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Multilevel Mobile Navigation Support */
.mobile-sub-nav-list {
    display: none;
    overflow: hidden;
}

.mobile-nav-item.expanded .mobile-sub-nav-list {
    display: block;
}

/* Level-specific styling for unlimited depth */
.mobile-sub-nav-list.level-2 {
    background: rgba(248, 249, 250, 0.95);
    border-left: 3px solid #007bff;
    margin-left: 8px;
}

.mobile-sub-nav-list.level-3 {
    background: rgba(240, 242, 245, 0.95);
    border-left: 3px solid #28a745;
    margin-left: 16px;
}

.mobile-sub-nav-list.level-4 {
    background: rgba(232, 235, 240, 0.95);
    border-left: 3px solid #ffc107;
    margin-left: 24px;
}

.mobile-sub-nav-list.level-5 {
    background: rgba(224, 228, 235, 0.95);
    border-left: 3px solid #fd7e14;
    margin-left: 32px;
}

.mobile-sub-nav-list.level-6,
.mobile-sub-nav-list.level-7,
.mobile-sub-nav-list.level-8,
.mobile-sub-nav-list.level-9,
.mobile-sub-nav-list.level-10 {
    background: rgba(216, 221, 230, 0.95);
    border-left: 3px solid #6c757d;
    margin-left: 40px;
}

/* Level-specific link styling */
.mobile-sub-nav-link.level-2 {
    padding: 12px 16px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.mobile-sub-nav-link.level-3 {
    padding: 10px 20px;
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.mobile-sub-nav-link.level-4 {
    padding: 8px 24px;
    font-size: 12px;
    color: #868e96;
    font-weight: 400;
}

.mobile-sub-nav-link.level-5,
.mobile-sub-nav-link.level-6,
.mobile-sub-nav-link.level-7,
.mobile-sub-nav-link.level-8,
.mobile-sub-nav-link.level-9,
.mobile-sub-nav-link.level-10 {
    padding: 6px 28px;
    font-size: 11px;
    color: #adb5bd;
    font-weight: 400;
}

/* Expand button styling for different levels */
.mobile-expand-button.level-2 {
    padding: 12px;
    font-size: 16px;
    color: #007bff;
}

.mobile-expand-button.level-3 {
    padding: 10px;
    font-size: 14px;
    color: #28a745;
}

.mobile-expand-button.level-4 {
    padding: 8px;
    font-size: 12px;
    color: #ffc107;
}

.mobile-expand-button.level-5,
.mobile-expand-button.level-6,
.mobile-expand-button.level-7,
.mobile-expand-button.level-8,
.mobile-expand-button.level-9,
.mobile-expand-button.level-10 {
    padding: 6px;
    font-size: 10px;
    color: #6c757d;
}

/* Visual hierarchy indicators */
.mobile-sub-nav-item.level-2::before {
    content: '↳';
    position: absolute;
    left: 8px;
    color: #007bff;
    font-weight: bold;
}

.mobile-sub-nav-item.level-3::before {
    content: '↳↳';
    position: absolute;
    left: 16px;
    color: #28a745;
    font-weight: bold;
    font-size: 12px;
}

.mobile-sub-nav-item.level-4::before {
    content: '↳↳↳';
    position: absolute;
    left: 24px;
    color: #ffc107;
    font-weight: bold;
    font-size: 10px;
}

.mobile-sub-nav-item.level-5::before,
.mobile-sub-nav-item.level-6::before,
.mobile-sub-nav-item.level-7::before,
.mobile-sub-nav-item.level-8::before,
.mobile-sub-nav-item.level-9::before,
.mobile-sub-nav-item.level-10::before {
    content: '▸';
    position: absolute;
    left: 32px;
    color: #6c757d;
    font-size: 8px;
}

/* Hover effects for different levels */
.mobile-sub-nav-link.level-2:hover {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.mobile-sub-nav-link.level-3:hover {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.mobile-sub-nav-link.level-4:hover {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.mobile-sub-nav-link.level-5:hover,
.mobile-sub-nav-link.level-6:hover,
.mobile-sub-nav-link.level-7:hover,
.mobile-sub-nav-link.level-8:hover,
.mobile-sub-nav-link.level-9:hover,
.mobile-sub-nav-link.level-10:hover {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* Mobile Settings */
.mobile-settings-content {
    padding: 1.5rem;
}

.mobile-setting-item {
    margin-bottom: 1.5rem;
}

.mobile-setting-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.mobile-setting-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
}

.mobile-setting-button {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-setting-button:hover {
    background-color: #f8f9fa;
    border-color: #ccc;
}

/* Body class when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Color Themes for Different Menu Types */

/* Extended Menu Theme - Blue */
.mobile-menu-extended .mobile-menu-toggle {
    border-color: #3498db;
    color: #3498db;
}

.mobile-menu-extended .mobile-menu-toggle:hover {
    background-color: #3498db;
    color: #fff;
}

.mobile-menu-extended .hamburger-icon span {
    background-color: #3498db;
}

.mobile-menu-extended .mobile-menu-toggle:hover .hamburger-icon span {
    background-color: #fff;
}

.mobile-menu-extended .mobile-tab-button.active {
    border-bottom-color: #3498db;
    color: #3498db;
}

.mobile-menu-extended .mobile-nav-link:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

/* Ascher Racing Menu Theme - Red */
.mobile-menu-ascher_racing .mobile-menu-toggle {
    border-color: #e74c3c;
    color: #e74c3c;
}

.mobile-menu-ascher_racing .mobile-menu-toggle:hover {
    background-color: #e74c3c;
    color: #fff;
}

.mobile-menu-ascher_racing .hamburger-icon span {
    background-color: #e74c3c;
}

.mobile-menu-ascher_racing .mobile-menu-toggle:hover .hamburger-icon span {
    background-color: #fff;
}

.mobile-menu-ascher_racing .mobile-tab-button.active {
    border-bottom-color: #e74c3c;
    color: #e74c3c;
}

.mobile-menu-ascher_racing .mobile-nav-link:hover {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* Track Time Menu Theme - Dark */
.mobile-menu-track_time .mobile-menu-toggle {
    border-color: #2c3e50;
    color: #2c3e50;
}

.mobile-menu-track_time .mobile-menu-toggle:hover {
    background-color: #2c3e50;
    color: #fff;
}

.mobile-menu-track_time .hamburger-icon span {
    background-color: #2c3e50;
}

.mobile-menu-track_time .mobile-menu-toggle:hover .hamburger-icon span {
    background-color: #fff;
}

.mobile-menu-track_time .mobile-tab-button.active {
    border-bottom-color: #2c3e50;
    color: #2c3e50;
}

.mobile-menu-track_time .mobile-nav-link:hover {
    background-color: rgba(44, 62, 80, 0.1);
    color: #2c3e50;
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
    .mobile-menu {
        display: block;
    }
    
    /* Hide desktop navigation on mobile */
    .desktop-navigation {
        display: none !important;
    }
    
    /* Ensure mobile menu toggle is visible */
    .mobile-menu-toggle {
        display: flex !important;
    }
}

/* Smaller mobile devices */
@media (max-width: 480px) {
    .mobile-menu-content {
        max-width: 100%;
    }
    
    .mobile-menu-toggle {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    .hamburger-icon span {
        width: 16px;
        height: 1.5px;
    }
}