/* Epic Games Free Games History - Main Styles */

:root {
    /* Epic Games color scheme */
    --color-primary: #0078f2;
    --color-primary-dark: #0066cc;
    --color-background: #0a0a0a;
    --color-surface: #1a1a1a;
    --color-surface-light: #2a2a2a;
    --color-text: #ffffff;
    --color-text-muted: #a0a0a0;
    --color-border: #333333;
    --color-success: #0db060;
    --color-warning: #ff9800;

    /* Platform colors */
    --color-pc: #0078f2;
    --color-ios: #999999;
    --color-android: #3ddc84;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-background) 100%);
    padding: var(--spacing-xxl) 0;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.site-header h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--color-primary) 0%, #00d4ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--color-text-muted);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-sm);
}

.last-updated {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Hero Section - Current Free Games */
.hero-section {
    background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-background) 100%);
    padding: var(--spacing-xxl) 0;
}

.hero-section h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.current-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    justify-items: center;
    justify-content: center;
}

.hero-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: transform 0.2s, box-shadow 0.2s;
    max-width: 400px;
    width: 100%;
    justify-self: center;
}

.hero-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 120, 242, 0.2);
}

.hero-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-surface-light);
}

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

.hero-card-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--color-text-muted);
}

.hero-card-content {
    padding: var(--spacing-lg);
}

.hero-card-content h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
}

.game-start-date {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
}

.game-price {
    color: var(--color-success, #10b981);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.countdown {
    color: var(--color-warning);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

.cta-button {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
    text-align: center;
    width: 100%;
}

.cta-button:hover {
    background: var(--color-primary-dark);
}

/* Platform Badges - PC only */
.platform-badge {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--color-pc);
}

/* Statistics Section */
.stats-section {
    padding: var(--spacing-xxl) 0;
}

.stats-section h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xxl);
}

.stat-card {
    background: var(--color-surface);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.stat-label {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chart-container {
    background: var(--color-surface);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    max-width: 800px;
    margin: 0 auto;
}

/* Search Section */
.search-section {
    background: var(--color-surface);
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.search-controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--spacing-md);
}

.search-input,
.filter-select {
    padding: var(--spacing-md);
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 1rem;
    font-family: inherit;
}

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

/* Upcoming Games Section */
.upcoming-section {
    padding: var(--spacing-xxl) 0;
    background: linear-gradient(180deg, var(--color-background) 0%, var(--color-surface) 50%, var(--color-background) 100%);
    border-top: 2px solid var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}

.upcoming-section h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-xl);
    text-align: center;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

.upcoming-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    justify-items: center;
    justify-content: center;
}

.upcoming-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid var(--color-primary);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    max-width: 400px;
    width: 100%;
    justify-self: center;
}

.upcoming-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 120, 242, 0.4);
}

.upcoming-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-surface-light);
}

.upcoming-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.upcoming-card:hover .upcoming-card-image img {
    transform: scale(1.05);
}

.upcoming-badge {
    position: absolute;
    top: var(--spacing-md);
    left: var(--spacing-md);
    background: var(--color-primary);
    color: white;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0, 120, 242, 0.5);
}

.upcoming-card-content {
    padding: var(--spacing-lg);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.upcoming-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.upcoming-card-title a {
    color: var(--color-text);
    text-decoration: none;
}

.upcoming-card-title a:hover {
    color: var(--color-primary);
}

.upcoming-card-date {
    margin-bottom: var(--spacing-md);
    color: var(--color-text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

.upcoming-card-date strong {
    display: block;
    color: var(--color-primary);
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
}

.upcoming-card-date .date-range {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.upcoming-card-price {
    color: var(--color-success, #10b981);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.upcoming-card-rating {
    color: var(--color-warning);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
}

.upcoming-card-rating::before {
    content: '⭐ ';
}

.upcoming-cta-button {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
    text-align: center;
    width: 100%;
    margin-top: auto;
}

.upcoming-cta-button:hover {
    background: var(--color-primary-dark);
}

/* Timeline Section */
.timeline-section {
    padding: var(--spacing-xxl) 0;
}

.timeline-section h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.loading {
    text-align: center;
    padding: var(--spacing-xxl);
    color: var(--color-text-muted);
}

.no-results {
    text-align: center;
    padding: var(--spacing-xxl);
    color: var(--color-text-muted);
    font-size: 1.125rem;
}

.no-games {
    text-align: center;
    color: var(--color-text-muted);
    padding: var(--spacing-xl);
}


/* Footer */
.site-footer {
    background: var(--color-surface);
    padding: var(--spacing-xxl) 0;
    border-top: 1px solid var(--color-border);
    margin-top: var(--spacing-xxl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-section h3 {
    color: var(--color-primary);
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-section p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.footer-section a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--color-border);
}

.footer-bottom p {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 120, 242, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 120, 242, 0.4);
}

.back-to-top:active {
    transform: translateY(-2px);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

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

    .hero-section h2,
    .stats-section h2,
    .upcoming-section h2,
    .timeline-section h2 {
        font-size: 1.5rem;
    }

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

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

    .search-controls {
        grid-template-columns: 1fr;
    }

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

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }

    /* GitHub corner - make smaller on mobile */
    .github-corner svg {
        width: 60px !important;
        height: 60px !important;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}
