/* All Games Page Styles */

/* Filters Section with Header */
.filters-section {
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500), var(--primary-600), var(--secondary-600));
    background-size: 400% 400%;
    animation: gradientShift 20s ease-in-out infinite;
    color: var(--white);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 64px; /* Position below the navbar (64px height) */
    z-index: 100; /* Ensure it stays above other content */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 100% 50%;
    }
    50% {
        background-position: 100% 100%;
    }
    75% {
        background-position: 50% 0%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.filters-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 8px 0;
}

/* Mobile Search Bar - Hidden by default */
.mobile-search-bar {
    display: none;
    width: 100%;
}

.mobile-search-input-wrapper {
    position: relative;
    width: 100%;
    padding: 0;
    margin-bottom: 8px;
}

.mobile-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    box-sizing: border-box;
    height: auto;
}

.mobile-search-input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

.mobile-search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
    background: var(--white);
}

.mobile-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.filters-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

/* Custom Select Styling */
.custom-select {
    position: relative;
    min-width: 150px;
}

.select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    gap: 0.5rem;
}

.select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: var(--white);
}

.custom-select.open .select-trigger {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
    background: var(--white);
}

.select-arrow {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.custom-select.open .select-arrow {
    transform: rotate(180deg);
}

.select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 32px var(--shadow);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    max-height: 200px;
    overflow-y: auto;
}

.custom-select.open .select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.select-option {
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
}

.select-option:last-child {
    border-bottom: none;
}

.select-option:hover {
    background: var(--primary-50);
    color: var(--primary-700);
}

.select-option.active {
    background: var(--primary-100);
    color: var(--primary-700);
    font-weight: 600;
}

/* Games Section */
.games-section {
    padding: 3rem 0;
}

/* Games Grid - 4 columns */
.games-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Responsive grid adjustments */
@media (min-width: 640px) {
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (min-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.75rem;
    }
}

@media (min-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* Game Card - Updated to match home.css */
.game-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    position: relative;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-200);
}

.game-card:active {
    transform: translateY(-2px);
}

.game-card:focus {
    outline: 2px solid var(--primary-400);
    outline-offset: 2px;
}

.game-card-image {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, var(--primary-100), var(--secondary-100));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.game-card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.game-card:hover .game-card-image::before {
    transform: translateX(100%);
}

.game-card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.75rem;
}

.game-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.game-card-description {
    color: var(--text-secondary);
    font-size: 0.813rem;
    line-height: 1.4;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.game-card-difficulty {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.difficulty-easy { color: var(--success-600); }
.difficulty-medium { color: var(--warning-600); }
.difficulty-hard { color: var(--error-600); }

.game-card-players {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Coming Soon Game Cards */
.game-card[data-coming-soon="true"] {
    opacity: 0.7;
    cursor: not-allowed;
}

.game-card[data-coming-soon="true"]:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: var(--border);
}

.game-card[data-coming-soon="true"]:focus {
    outline: 2px solid var(--neutral-400);
}

.game-card[data-coming-soon="true"] .game-card-image {
    background: linear-gradient(135deg, var(--neutral-100), var(--neutral-200));
}

.game-card[data-coming-soon="true"] .game-card-title {
    color: var(--text-muted);
}

.game-card[data-coming-soon="true"] .game-card-description {
    color: var(--text-muted);
}

/* Coming Soon Badge */
.coming-soon-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--neutral-600);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

.no-results-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.no-results-description {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filters-section {
        padding: 1rem 0;
    }
    
    .filters-wrapper {
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        width: 100%;
        gap: 0;
    }
    
    .mobile-search-bar {
        display: block;
    }
    
    .filters-controls {
        justify-content: center;
        gap: 1rem;
        width: 100%;
        max-width: none;
    }
    
    .filter-group {
        min-width: 140px;
        flex: 1;
        max-width: 200px;
    }
    
    .custom-select {
        width: 100%;
    }
    
    .games-section {
        padding: 2rem 0;
    }
    
    .games-grid {
        gap: 1rem;
    }
    
    .game-card-content {
        padding: 1rem;
    }
    
    .game-card-title {
        font-size: 1rem;
    }
    
    .game-card-description {
        font-size: 0.75rem;
    }
    
    .game-card-meta {
        margin-bottom: 0.75rem;
    }
    
    .game-card-difficulty,
    .game-card-players {
        font-size: 0.65rem;
    }
}

@media (max-width: 640px) {
    .games-grid {
        gap: 1rem;
        grid-template-columns: 1fr;
    }
    
    .game-card {
        border-radius: 12px;
    }
    
    .game-card-image {
        height: 120px;
        font-size: 2rem;
    }
    
    .game-card-content {
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .game-card-title {
        font-size: 1rem;
    }
    
    .game-card-description {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }
    
    .game-card-meta {
        padding-top: 0.375rem;
    }
}

@media (max-width: 480px) {
    .filters-section {
        padding: 0.5rem 0;
    }
    
    .filters-controls {
        flex-direction: row;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .filter-group {
        min-width: auto;
        flex: 1;
        max-width: 160px;
    }
    
    .custom-select {
        min-width: auto;
        width: 100%;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
}

/* Stats Section */
.stats-section {
    padding: 3rem 0;
    background: var(--primary-600);
    color: var(--white);
}

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

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
