/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --steam-color: #1b2838;
    --epic-color: #0078f2;
    --gog-color: #86328a;
    --amazon-color: #00a8e1;
    --ubisoft-color: #0080ff;
    --ea-color: #000000;
    --fanatical-color: #ff6600;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.header-content h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Filter Bar */
.filter-bar {
    background: var(--bg-secondary);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.filters {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-select {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Search Box */
.search-box {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-search {
    background: var(--success-color);
    color: white;
}

.btn-search:hover {
    background: #059669;
}

.btn-get-game {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-get-game:hover {
    background: var(--secondary-color);
}

/* Statistics Bar */
.stats-bar {
    background: var(--bg-secondary);
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.stat-card {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Loading */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Main Content */
.main-content {
    padding: 40px 0;
    min-height: 60vh;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

/* Game Card */
.game-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.game-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.game-card.platform-steam:hover {
    border-color: var(--steam-color);
}

.game-card.platform-epic:hover {
    border-color: var(--epic-color);
}

.game-card.platform-gog:hover {
    border-color: var(--gog-color);
}

.game-card.platform-amazon:hover {
    border-color: var(--amazon-color);
}

.game-card.platform-ubisoft:hover {
    border-color: var(--ubisoft-color);
}

.game-card.platform-ea:hover {
    border-color: var(--ea-color);
}

.game-card.platform-fanatical:hover {
    border-color: var(--fanatical-color);
}

.game-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

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

.platform-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    backdrop-filter: blur(10px);
}

.badge-steam {
    background: rgba(27, 40, 56, 0.9);
}

.badge-epic {
    background: rgba(0, 120, 242, 0.9);
}

.badge-gog {
    background: rgba(134, 50, 138, 0.9);
}

.badge-amazon {
    background: rgba(0, 168, 225, 0.9);
}

.badge-ubisoft {
    background: rgba(0, 128, 255, 0.9);
}

.badge-ea {
    background: rgba(0, 0, 0, 0.9);
}

.badge-fanatical {
    background: rgba(255, 102, 0, 0.9);
}

.game-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.game-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.original-price {
    text-decoration: line-through;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.current-price {
    color: var(--success-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.temporary {
    background: #fef3c7;
    color: #d97706;
}

.free-until {
    font-size: 0.85rem;
    color: var(--danger-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.game-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.added-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.no-results p {
    color: var(--text-secondary);
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin: 40px 0;
}

.error-message h2 {
    color: var(--danger-color);
    margin-bottom: 10px;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
}

.footer p {
    opacity: 0.8;
    font-size: 0.9rem;
    margin: 5px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 1.8rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .search-box {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
