/* Responsive Styles for W3W GAME */

/* Tablet Devices */
@media screen and (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .content-area {
        margin-left: 200px;
        margin-right: 250px;
    }
    
    .right-sidebar {
        width: 250px;
    }
}

/* Mobile Devices */
@media screen and (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    /* Top Bar Mobile Styles */
    .top-bar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px;
        margin-bottom: 15px;
    }

    .search-container {
        flex: 1;
        min-width: 0;
        max-width: none;
        margin-bottom: 0;
        order: 1;
    }

    .language-selector {
        width: auto;
        margin-left: auto;
        padding: 6px 12px;
        order: 2;
    }

    .search-container input {
        font-size: 14px;
        padding: 8px;
    }

    .language-selector select {
        font-size: 14px;
        padding: 4px 8px;
    }
    
    .content-area {
        margin-left: 0;
        margin-right: 0;
    }
    
    .right-sidebar {
        display: none;
    }
    
    /* Sidebar for mobile - drawer style */
    .sidebar {
        width: 80%;
        max-width: 300px;
        height: 100vh;
        position: fixed;
        top: 0;
        left: -100%;
        padding: 20px;
        z-index: 1000;
        transition: transform 0.3s ease;
        transform: translateX(-100%);
        overflow-y: auto;
        will-change: transform;
        backface-visibility: hidden;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .right-sidebar {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        width: 250px;
        will-change: transform;
        backface-visibility: hidden;
        transform: translateZ(0);
    }
    
    /* Sidebar open state */
    .sidebar.open {
        left: 0;
    }
    
    /* Menu toggle button */
    .menu-toggle {
        display: none;
    }
    
    /* Overlay for mobile menu */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .mobile-overlay.active {
        display: block;
    }
    
    /* Prevent body scrolling when menu is open */
    body.menu-open {
        overflow: hidden;
    }
    
    .logo-container {
        margin-bottom: 15px;
    }
    
    .main-nav ul {
        display: block;
    }
    
    .main-nav ul li {
        margin-bottom: 10px;
    }
    
    .donation-container {
        display: none;
    }
    
    /* Ensure contact email is visible at bottom of mobile menu */
    .contact-email {
        position: relative;
        margin-top: 30px;
        padding-top: 15px;
        bottom: 0;
    }
    
    .content-area {
        margin-left: 0;
        padding: 15px;
    }
    
    /* Top bar layout for mobile */
    .top-bar {
        padding: 10px;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    
    .search-container {
        flex: 1;
        min-width: 0;
        margin-right: 10px;
    }
    
    .language-selector {
        margin-left: 0;
    }
    
    .banner-slider {
        height: 400px;
    }
    
    .banner-content {
        max-width: 100%;
    }
    
    .banner-content h2 {
        font-size: 24px;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .secondary-ad {
        height: 200px;
    }
    
    .section-header h2 {
        font-size: 20px;
    }
    
    .modal-header {
        padding: 10px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
}

/* Small Mobile Devices */
@media screen and (max-width: 480px) {
    .logo-container h1 {
        font-size: 20px;
    }
    
    .main-nav ul li a {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .banner-slider {
        height: 200px;
    }
    
    .banner-content h2 {
        font-size: 20px;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .game-card-image {
        height: 120px;
    }
    
    .game-card-info {
        padding: 10px;
    }
    
    .secondary-ad {
        height: 150px;
    }
    
    .load-more-btn {
        padding: 8px 20px;
        font-size: 12px;
    }
    
    .main-footer {
        text-align: center;
        padding: 20px 15px;
    }
    
    .main-footer * {
        justify-content: center;
        align-items: center;
    }
}

/* RTL Support for Arabic */
[dir="rtl"] {
    .sidebar {
        right: 0;
        left: auto;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    }
    
    .content-area {
        margin-right: 250px;
        margin-left: 0;
    }
    
    .main-nav ul li a img,
    .main-nav ul li a i {
        margin-right: 0;
        margin-left: 10px;
    }
    
    .search-container i {
        margin-right: 0;
        margin-left: 10px;
    }
    
    .language-selector i {
        margin-right: 0;
        margin-left: 10px;
    }
    
    .section-header h2 i {
        margin-left: 0;
        margin-right: 10px;
    }
    
    @media screen and (max-width: 768px) {
        .content-area {
            margin-right: 0;
        }
    }
}
    .menu-toggle {
        order: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #f8f9fa;
        border: none;
        width: 40px;
        height: 40px;
        font-size: 18px;
        color: #333;
        margin-right: 10px;
        border-radius: 8px;
        cursor: pointer;
        transition: background-color 0.3s;
    }

    .menu-toggle:hover {
        background-color: #e9ecef;
    }

    .menu-toggle i {
        font-size: 18px;
        color: #333;
    }