/* Mobile Games - محسن للأداء */

/* ===== نظام التصفية الاحترافي ===== */
.filter-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem auto;
    max-width: 1200px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-header h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-header h3::before {
    content: "🔍";
    font-size: 1.2rem;
}

.clear-filters {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(255,107,107,0.3);
}

.clear-filters:hover {
    background: linear-gradient(135deg, #ee5a52, #e74c3c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,107,0.4);
}

.clear-icon {
    font-size: 1rem;
}

.filter-search {
    margin-bottom: 2rem;
}

.search-container {
    position: relative;
    max-width: 400px;
}

.search-container input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.search-container input:focus {
    outline: none;
    border-color: #2ed573;
    box-shadow: 0 0 0 3px rgba(46,213,115,0.1);
    transform: translateY(-1px);
}

.search-container input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

.filter-categories {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.filter-group {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #f1f3f4;
}

.filter-group h4 {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
}

.filter-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.filter-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.filter-btn.active {
    background: #2ed573;
    color: white;
    border-color: #1ea85a;
    box-shadow: 0 2px 8px rgba(46,213,115,0.3);
}

.filter-btn.active:hover {
    background: #25b864;
    box-shadow: 0 3px 10px rgba(46,213,115,0.4);
}

.filter-icon {
    font-size: 1rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

/* ===== تحسينات Hero Section ===== */
.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.2rem;
}

.feature-item span:last-child {
    font-weight: 600;
    color: #fff;
}

/* ===== تحسينات SEO Content ===== */
.seo-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.intro-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    text-align: center;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    border-left: 4px solid #2ed573;
}

.game-categories {
    margin: 3rem 0;
}

.game-categories h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.category-item {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.category-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.category-item h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.category-item p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* ===== تحسينات المقال المميز ===== */
.featured-article {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
}

.article-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.article-image {
    flex-shrink: 0;
    width: 200px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-content {
    flex: 1;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.article-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.article-content .btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.article-content .btn:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
    text-decoration: none;
}

/* تحسينات الموبايل للمقال المميز */
@media (max-width: 768px) {
    .article-card {
        flex-direction: column;
        text-align: center;
    }
    
    .article-image {
        width: 100%;
        height: 150px;
    }
    
    .article-content h3 {
        font-size: 1.3rem;
    }
    
    .article-content p {
        font-size: 1rem;
    }
}

/* ===== تحسينات الاستجابة ===== */
@media (max-width: 1024px) {
    .filter-container {
        padding: 1.5rem;
        margin: 1.5rem auto;
    }
    
    .filter-buttons {
        gap: 0.6rem;
    }
    
    .filter-btn {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .filter-container {
        padding: 1rem;
        margin: 1rem auto;
        border-radius: 12px;
    }
    
    .filter-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .filter-header h3 {
        font-size: 1.3rem;
    }
    
    .clear-filters {
        align-self: center;
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .filter-buttons {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.6rem 0.9rem;
        font-size: 0.8rem;
        flex: 1;
        min-width: calc(50% - 0.25rem);
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .filter-container {
        padding: 0.8rem;
        margin: 0.8rem auto;
    }
    
    .filter-group {
        padding: 1rem;
    }
    
    .filter-group h4 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .filter-buttons {
        gap: 0.4rem;
    }
    
    .filter-btn {
        padding: 0.5rem 0.7rem;
        font-size: 0.75rem;
        min-width: calc(50% - 0.2rem);
    }
    
    .filter-icon {
        font-size: 0.9rem;
    }
    
    .search-container input {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* ===== تحسينات الوضع المظلم ===== */
[data-theme="dark"] .filter-container {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .filter-header h3 {
    color: #ecf0f1;
}

[data-theme="dark"] .filter-group {
    background: #34495e;
    border-color: #4a5f7a;
}

[data-theme="dark"] .filter-group h4 {
    color: #ecf0f1;
}

[data-theme="dark"] .filter-btn {
    background: linear-gradient(135deg, #4a5f7a, #5a6f8a);
    color: #ecf0f1;
    border-color: #6a7f9a;
}

[data-theme="dark"] .filter-btn:hover {
    background: linear-gradient(135deg, #5a6f8a, #6a7f9a);
    border-color: #7a8faa;
}

[data-theme="dark"] .search-container input {
    background: #4a5f7a;
    border-color: #6a7f9a;
    color: #ecf0f1;
}

[data-theme="dark"] .search-container input:focus {
    border-color: #2ed573;
}

[data-theme="dark"] .search-container input::placeholder {
    color: #bdc3c7;
}

/* ===== الوضع الليلي لبطاقات الألعاب ===== */
[data-theme="dark"] .game-card {
    background: #2c3e50;
    border-color: #4a5f7a;
    color: #ecf0f1;
}

[data-theme="dark"] .game-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

[data-theme="dark"] .game-card h3 {
    color: #ecf0f1;
}

[data-theme="dark"] .btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

[data-theme="dark"] .btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
}

.games-grid { 
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.2rem;
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1rem;
    will-change: auto;
    contain: layout style;
}

.game-card { 
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    text-align: center;
    will-change: transform;
    contain: layout style paint;
}

.game-card:hover { 
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.game-card img { 
    width: 100%; 
    height: 180px; 
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

.game-card h3 { 
    margin: 1rem 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.card-buttons { 
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn { 
    padding: 0.7rem 1rem;
    text-decoration: none;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    width: 100%;
    background: #2ed573;
    color: white;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn:hover {
    background: #25b864;
    transform: translateY(-1px);
}


/* Mobile responsive */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin: 1rem auto;
    }
    
    .game-card img {
        height: 150px;
    }
}

@media (max-width: 576px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        margin: 0.8rem auto;
    }
    
    .game-card img {
        height: 120px;
    }
    
    .game-card h3 {
        font-size: 0.9rem;
        margin: 0.5rem 0.3rem;
    }
    
    .card-buttons {
        padding: 0.5rem;
    }
    
    .btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}
