/* Games Page Specific Styles */

/* Active nav link */
.nav-link.active {
    color: #673ab7;
    font-weight: 600;
}

/* Games Hero Section */
.games-hero {
    padding: 120px 0 60px;
    background: linear-gradient(135deg, #673ab7 0%, #9c27b0 100%);
    color: white;
    text-align: center;
}

.games-hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.games-hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Search and Filter Section */
.search-filter {
    padding: 40px 0;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 70px;
    z-index: 98;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.search-bar {
    display: flex;
    max-width: 600px;
    margin: 0 auto 30px;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #673ab7;
}

.search-btn {
    background: #673ab7;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #5e35b1;
}

.filter-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tab {
    background: transparent;
    color: #666;
    border: 2px solid #e0e0e0;
    padding: 10px 20px;
    border-radius: 25px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    border-color: #673ab7;
    color: #673ab7;
}

.filter-tab.active {
    background: #673ab7;
    color: white;
    border-color: #673ab7;
}

/* Featured Games Section */
.featured-games {
    padding: 60px 0;
    background: #f8f9fa;
}

.featured-games h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: #333;
}

.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 30px;
    height: 400px;
}

.featured-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: transform 0.3s ease;
}

.featured-card:hover {
    transform: translateY(-5px);
}

.featured-card.large {
    grid-row: span 1;
}

.featured-card img {
    width: 100%;
    height: 60%;
    object-fit: cover;
}

.featured-content {
    padding: 20px;
    height: 40%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.featured-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.featured-content p {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.featured-play-btn {
    background: #673ab7;
    color: white;
    text-decoration: none;
    padding: 10px 0;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: background 0.3s ease;
}

.featured-play-btn:hover {
    background: #5e35b1;
}

/* All Games Section */
.all-games {
    padding: 60px 0;
    background: white;
}

.all-games h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: #333;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    gap: 30px;
}

.game-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    opacity: 1;
    aspect-ratio: 1/1;
}

 /* Dress Up Game - верхній лівий */
        .item-1 {
            grid-column: 1 / 4;
            grid-row: 1 / 4;
         
        }

        /* Racing Game - верхній правий */
        .item-2 {
            grid-column: 4 / 7;
            grid-row: 1 / 4;

        }

        /* Village Builder - правий середній */
        .item-3 {
            grid-column: 7 / 10;
            grid-row: 3 / 7;
         
        }

        /* Horror Game - лівий нижній */
        .item-4 {
            grid-column: 1 / 5;
            grid-row: 4 / 9;
          
        }

        /* Adventure Game - правий нижній */
        .item-5 {
            grid-column: 6 / 10;
            grid-row: 6 / 10;
            
        }

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.game-card.hidden {
    display: none;
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-info {
    padding: 20px;
}

.game-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.game-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.category {
    background: #e8eaf6;
    color: #673ab7;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.rating {
    color: #ffc107;
    font-size: 0.9rem;
}

.game-card .play-btn {
    display: block;
    width: 100%;
    background: #673ab7;
    color: white;
    text-decoration: none;
    padding: 12px 0;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: background 0.3s ease;
}

.game-card .play-btn:hover {
    background: #5e35b1;
}

/* Load More Button */
.load-more-container {
    text-align: center;
}

.load-more-btn {
    background: transparent;
    color: #673ab7;
    border: 2px solid #673ab7;
    padding: 15px 40px;
    border-radius: 25px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: #673ab7;
    color: white;
}

/* Game Stats Section */
.game-stats {
    padding: 60px 0;
    background: #673ab7;
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    text-align: center;
}

.stat-item h3 {
    font-size: 3rem;
    font-weight: 700;
    color: #d4e157;
    margin-bottom: 10px;
}

.stat-item p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Search Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.no-results p {
    font-size: 1rem;
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #673ab7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filter Animation */
.game-card.fade-out {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.game-card.fade-in {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .featured-grid {
        grid-template-columns: 1fr 1fr;
        height: auto;
    }
    
    .featured-card.large {
        grid-column: span 2;
    }
    
    .featured-card img {
        height: 200px;
    }
    
    .featured-content {
        height: auto;
        padding: 20px;
    }

}

@media (max-width: 768px) {
    .games-hero-content h1 {
        font-size: 2.5rem;
    }
    
    .games-hero-content p {
        font-size: 1rem;
    }
    
    .search-bar {
        flex-direction: column;
        max-width: 100%;
    }
    
    .filter-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .filter-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .featured-card.large {
        grid-column: span 1;
    }

    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .stat-item h3 {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .games-hero {
        padding: 100px 0 40px;
    }
    
    .games-hero-content h1 {
        font-size: 2rem;
    }
    
    .search-filter {
        padding: 30px 0;
    }
    
    .featured-games,
    .all-games,
    .game-stats {
        padding: 40px 0;
    }
    
    .featured-games h2,
    .all-games h2 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stat-item h3 {
        font-size: 2rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .game-card,
    .featured-card,
    .filter-tab,
    .search-btn,
    .featured-play-btn,
    .play-btn,
    .load-more-btn {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .game-card {
        border: 2px solid #333;
    }
    
    .filter-tab {
        border-width: 3px;
    }
    
    .category {
        border: 1px solid #673ab7;
    }
}

/* Focus styles for keyboard navigation */
.game-card:focus-within {
    outline: 3px solid #673ab7;
    outline-offset: 2px;
}

.filter-tab:focus {
    outline: 3px solid #673ab7;
    outline-offset: 2px;
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(103, 58, 183, 0.2);
}