/*=====================================================================
  [1] Global & Variables
=====================================================================*/
:root {
    /* Light Theme Colors (Clean, Modern UI) */
    --color-light-bg: #f8f9fa;      /* Main Filter Background */
    --color-light-surface: #ffffff; /* Card/Group Background */
    --color-light-border: #e9ecef;  /* Primary Border */
    --color-light-border-subtle: #f1f3f4;
    --color-text-dark: #2c3e50;     /* Primary Text */
    --color-text-medium: #495057;   /* Secondary Text */
    --color-success: #2ed573;       /* Active/CTA Green */
    --color-success-hover: #25b864;
    --color-danger: #ff6b6b;        /* Clear/Danger Red */
    --color-danger-hover: #ee5a52;
}

/* Dark Theme Variables (Based on [data-theme="dark"]) */
[data-theme="dark"] {
    --color-dark-bg: #2c3e50;       /* Filter Background (Blue/Grey) */
    --color-dark-surface: #34495e;  /* Card/Group Background */
    --color-dark-border: #4a5f7a;
    --color-dark-text: #ecf0f1;
    --color-dark-text-medium: #bdc3c7;
    --color-dark-accent-blue: #3498db;
    --color-dark-accent-blue-hover: #2980b9;
}


/*=====================================================================
  [2] Filter System (Light Mode)
=====================================================================*/
.filter-container {
    background: var(--color-light-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem auto;
    max-width: 1200px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border: 1px solid var(--color-light-border);
}

/* 2.1 Filter Header */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.filter-header h3 {
    color: var(--color-text-dark);
    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 Button */
.clear-filters {
    background: linear-gradient(135deg, var(--color-danger), var(--color-danger-hover));
    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, var(--color-danger-hover), #e74c3c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,107,0.4);
}
.clear-icon {
    font-size: 1rem;
}

/* 2.2 Search Input */
.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: var(--color-light-surface);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.search-container input:focus {
    outline: none;
    border-color: var(--color-success);
    box-shadow: 0 0 0 3px rgba(46,213,115,0.1);
    transform: translateY(-1px);
}
.search-container input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* 2.3 Filter Groups */
.filter-categories {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.filter-group {
    background: var(--color-light-surface);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--color-light-border-subtle);
}
.filter-group h4 {
    color: var(--color-text-medium);
    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;
}

/* 2.4 Filter Buttons */
.filter-btn {
    background: var(--color-light-bg);
    border: 1px solid #dee2e6;
    color: var(--color-text-medium);
    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: var(--color-success);
    color: white;
    border-color: #1ea85a;
    box-shadow: 0 2px 8px rgba(46,213,115,0.3);
}
.filter-btn.active:hover {
    background: var(--color-success-hover);
    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));
}


/*=====================================================================
  [3] Game Cards Grid
=====================================================================*/
.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;
    /* Performance optimizations */
    will-change: auto;
    contain: layout style;
}

.game-card { 
    background: var(--color-light-surface);
    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;
}

/* 3.1 General Button (CTA on cards) */
.btn { 
    padding: 0.7rem 1rem;
    text-decoration: none;
    border-radius: 8px;
    /* Fallback font (assuming Cairo is defined elsewhere) */
    font-family: sans-serif; 
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    width: 100%;
    background: var(--color-success);
    color: white;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
.btn:hover {
    background: var(--color-success-hover);
    transform: translateY(-1px);
}


/*=====================================================================
  [4] SEO Content & Featured Sections
=====================================================================*/

/* 4.1 Hero Features (Assumes these are inside the Hero Banner) */
.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;
}

/* 4.2 SEO Content Area */
.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, var(--color-light-bg), #e9ecef);
    border-radius: 15px;
    border-left: 4px solid var(--color-success);
}
.game-categories {
    margin: 3rem 0;
}
.game-categories h2 {
    text-align: center;
    color: var(--color-text-dark);
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.category-item {
    background: var(--color-light-surface);
    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 var(--color-light-border);
}
.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: var(--color-text-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}
.category-item p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* 4.3 Featured Article */
.featured-article {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Purple/Blue Gradient */
    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;
}


/*=====================================================================
  [5] Dark Mode Overrides (Using [data-theme="dark"])
=====================================================================*/

/* 5.1 Filter System Dark Mode */
[data-theme="dark"] .filter-container {
    background: linear-gradient(135deg, var(--color-dark-bg), var(--color-dark-surface));
    border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .filter-header h3 {
    color: var(--color-dark-text);
}
[data-theme="dark"] .filter-group {
    background: var(--color-dark-surface);
    border-color: var(--color-dark-border);
}
[data-theme="dark"] .filter-group h4 {
    color: var(--color-dark-text);
}
[data-theme="dark"] .filter-btn {
    background: linear-gradient(135deg, #4a5f7a, #5a6f8a);
    color: var(--color-dark-text);
    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: var(--color-dark-text);
}
[data-theme="dark"] .search-container input:focus {
    border-color: var(--color-success); /* Keeping success green as focus highlight */
}
[data-theme="dark"] .search-container input::placeholder {
    color: var(--color-dark-text-medium);
}

/* 5.2 Game Cards Dark Mode */
[data-theme="dark"] .game-card {
    background: var(--color-dark-bg);
    border-color: var(--color-dark-border);
    color: var(--color-dark-text);
}
[data-theme="dark"] .game-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}
[data-theme="dark"] .game-card h3 {
    color: var(--color-dark-text);
}
[data-theme="dark"] .btn {
    background: linear-gradient(135deg, var(--color-dark-accent-blue), var(--color-dark-accent-blue-hover));
    color: white;
}
[data-theme="dark"] .btn:hover {
    background: linear-gradient(135deg, var(--color-dark-accent-blue-hover), #1f618d);
}

/* 5.3 SEO Content Dark Mode (Needs definition) */
[data-theme="dark"] .intro-text {
    color: var(--color-dark-text);
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border-left: 4px solid var(--color-success);
}
[data-theme="dark"] .game-categories h2 {
    color: var(--color-dark-text);
}
[data-theme="dark"] .category-item {
    background: var(--color-dark-surface);
    border: 1px solid var(--color-dark-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}
[data-theme="dark"] .category-item h3 {
    color: var(--color-dark-text);
}
[data-theme="dark"] .category-item p {
    color: var(--color-dark-text-medium);
}


/*=====================================================================
  [6] Media Queries (Responsiveness)
=====================================================================*/

/* Desktop & Tablet Adjustments */
@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;
    }
}

/* Tablet & Mobile Adjustments */
@media (max-width: 768px) {
    /* Filter System */
    .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;
    }

    /* Game Cards Grid */
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin: 1rem auto;
    }
    .game-card img {
        height: 150px;
    }

    /* Featured Article Mobile */
    .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;
    }
}

/* Small Mobile Adjustments */
@media (max-width: 576px) {
    /* Filter System */
    .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;
    }

    /* Game Cards Grid */
    .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;
    }
}
/* ====================================
 * FOOTER
 * ==================================== */
footer {
    background-color: var(--background-light);
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: 80px;
    text-align: center;
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-nav a {
    color: var(--text-secondary);
    font-weight: 600;
}

.footer-nav a:hover {
    color: var(--primary-color);
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

