/* Simple Mobile Menu CSS - Reliable and Lightweight */

/* Mobile Menu Styles */
@media (max-width: 767.98px) {
    /* Menu toggle button */
    .menu-toggle {
        background: transparent;
        border: none;
        color: white;
        font-size: 1.3rem;
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        z-index: 1035;
    }
    
    /* Mobile menu container */
    .main-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background-color: #222;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1020;
        overflow-y: auto;
        padding-top: 60px;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
    }
    
    .main-menu.active {
        transform: translateX(0);
    }
    
    /* Mobile menu wrapper */
    .main-menu .container,
    .main-menu-wrapper {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    /* Mobile navigation items */
    .mobile-nav-items {
        list-style: none;
        margin: 0;
        padding: 0;
        width: 100%;
    }
    
    .mobile-nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .mobile-nav-link {
        display: flex;
        align-items: center;
        padding: 15px 20px;
        color: white;
        text-decoration: none;
        transition: background-color 0.2s ease;
    }
    
    .mobile-nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: white;
    }
    
    /* Mobile submenu */
    .mobile-submenu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background-color: #333;
    }
    
    .mobile-nav-item.active .mobile-submenu {
        max-height: 500px;
    }
    
    .mobile-submenu-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .mobile-submenu-link {
        display: block;
        padding: 12px 40px;
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        font-size: 0.9rem;
        transition: background-color 0.2s ease;
    }
    
    .mobile-submenu-link:hover {
        background-color: rgba(255, 255, 255, 0.05);
        color: white;
    }
    
    /* Mobile overlay */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 1010;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Mobile search panel */
    .mobile-search-panel {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background-color: #333;
        padding: 15px;
        z-index: 1015;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    }
    
    .mobile-search-panel.active {
        transform: translateY(0);
    }
    
    .mobile-search-panel .search-container {
        display: flex;
        align-items: center;
        background-color: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
        overflow: hidden;
    }
    
    .mobile-search-panel .search-input {
        flex: 1;
        padding: 12px 15px;
        border: none;
        background: transparent;
        color: white;
        font-size: 1rem;
        outline: none;
    }
    
    .mobile-search-panel .search-input::placeholder {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .mobile-search-panel .search-icon {
        background: transparent;
        border: none;
        color: white;
        padding: 12px 15px;
        cursor: pointer;
        font-size: 1.1rem;
    }
    
    /* Mobile search toggle */
    .mobile-search-toggle {
        background: transparent;
        border: none;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1035;
    }
    
    /* Body scroll prevention */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
    
    body.search-open {
        overflow-x: hidden;
    }
    
    /* Header positioning */
    header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        background-color: #222;
        padding: 10px 0;
    }
    
    /* Main content padding */
    main {
        padding-top: 60px;
    }
    
    /* Hide desktop search on mobile */
    .expandable-search {
        display: none !important;
    }
}

/* Desktop styles - ensure proper display */
@media (min-width: 768px) {
    /* Reset mobile menu positioning for desktop */
    .main-menu {
        position: static;
        transform: none;
        width: auto;
        height: auto;
        box-shadow: none;
        padding-top: 0;
        overflow: visible;
    }
    
    /* Hide mobile elements on desktop */
    .menu-toggle,
    .mobile-search-toggle,
    .mobile-overlay,
    .mobile-search-panel {
        display: none !important;
    }
    
    /* Reset body styles */
    body {
        overflow: visible !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
    }
    
    /* Reset header */
    header {
        position: relative;
        z-index: auto;
    }
    
    /* Reset main content */
    main {
        padding-top: 0;
    }
}

/* Mobile Content Layouts */
@media (max-width: 767.98px) {
    /* Mobile sections */
    .mobile-section {
        margin-bottom: 20px;
        padding: 0 15px;
        background-color: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-section .section-title {
        font-size: 1.1rem;
        font-weight: 600;
        padding: 15px 0 10px;
        margin: 0;
        color: #333;
        border-bottom: 2px solid #e9ecef;
        margin-bottom: 15px;
    }
    
    /* Live carousel optimizations */
    .live-carousel {
        position: relative;
        overflow: hidden;
        padding: 15px 0;
    }
    
    .live-carousel-wrapper {
        display: flex;
        transition: transform 0.3s ease;
        gap: 15px;
    }
    
    .live-carousel-item {
        flex: 0 0 280px;
        background: #fff;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .live-carousel-image {
        position: relative;
        height: 160px;
        overflow: hidden;
    }
    
    .live-carousel-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .live-carousel-content {
        padding: 12px;
    }
    
    .live-carousel-content h3 {
        font-size: 14px;
        line-height: 1.4;
        margin: 0 0 8px 0;
        color: #333;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Mobile banner optimizations */
    .mobile-banner-container {
        margin: 0 -15px 20px -15px;
        border-radius: 0;
    }
    
    .mobile-banner {
        padding: 10px 15px;
    }
    
    .banner-image,
    .banner-video {
        width: 100%;
        height: auto;
        border-radius: 6px;
        overflow: hidden;
    }
    
    /* Article cards for mobile */
    .article-card {
        background: #fff;
        border-radius: 8px;
        margin-bottom: 15px;
        overflow: hidden;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .article-card-image {
        position: relative;
        height: 200px;
        overflow: hidden;
    }
    
    .article-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .article-card-content {
        padding: 15px;
    }
    
    .article-card-title {
        font-size: 1rem;
        line-height: 1.4;
        margin: 0 0 8px 0;
        color: #333;
        font-weight: 600;
    }
    
    .article-card-excerpt {
        font-size: 0.9rem;
        line-height: 1.4;
        color: #666;
        margin: 0;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}
