/* Modern CSS Reset and Variables */
:root {
    /* Color Scheme */
    --primary-color: #31C48D;
    --primary-color-rgb: 49, 196, 141;
    --secondary-color: #0D9488;
    --accent-color: #059669;
    --background: #0f172a;
    --surface: rgba(15, 23, 42, 0.8);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --nav-height: 4rem;
}

/* Dark theme colors */
[data-theme="dark"] {
    --background: #0f172a;
    --surface: rgba(15, 23, 42, 0.8);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
}

/* Light theme colors */
[data-theme="light"] {
    --primary-color: #059669;
    --primary-color-rgb: 5, 150, 105;
    --secondary-color: #10B981;
    --accent-color: #34D399;
    --surface: rgba(255, 255, 255, 0.8);
    --background: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
}

/* Modern CSS Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    background-color: var(--background);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Loading Animation */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity var(--transition-normal);
}

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

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

/* Navigation Styles */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
    flex: 1;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.search-container:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

#search-input {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 0.5rem;
    width: 100%;
    font-size: 1rem;
    outline: none;
}

#search-input::placeholder {
    color: var(--text-color-muted);
}

#search-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

#search-btn:hover {
    opacity: 1;
}

#search-btn svg {
    width: 20px;
    height: 20px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.theme-toggle:hover {
    opacity: 1;
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
}

.dark-theme .sun-icon {
    display: block;
}

.dark-theme .moon-icon {
    display: none;
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

/* Adjust main content for fixed navigation */
main {
    padding-top: 80px;
}

/* Search Modal */
.search-modal {
    display: none;
}

.search-overlay {
    display: none;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(49, 196, 141, 0.1), rgba(13, 148, 136, 0.1));
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.gradient-text {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-color-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

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

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.hero-cta {
    margin-top: 2rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--primary-color-rgb), 0.3);
}

.cta-button svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .hero {
        min-height: 50vh;
        padding: 3rem 1rem;
    }

    .gradient-text {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-stats {
        gap: 2rem;
    }

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

    .cta-button {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .gradient-text {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

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

    .stat-label {
        font-size: 0.8rem;
    }
}

/* Buttons */
.primary-btn, .secondary-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 8px;
    font-weight: 500;
    transition: transform var(--transition-fast);
    cursor: pointer;
    border: none;
}

.primary-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.primary-btn:hover, .secondary-btn:hover {
    transform: translateY(-2px);
}

/* Game Cards */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.game-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.game-image {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

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

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

.game-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.game-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.game-description {
    font-size: 0.9rem;
    color: var(--text-color-muted);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.game-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.game-category {
    font-size: 0.8rem;
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.play-button {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
}

.play-button svg {
    width: 16px;
    height: 16px;
}

/* Featured Games Section */
.featured-games {
    padding: 4rem 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Categories Section */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
}

.category-card {
    background: var(--surface);
    padding: var(--spacing-lg);
    border-radius: 16px;
    text-align: center;
    transition: transform var(--transition-normal);
}

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

.category-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

/* Trending Section */
.trending-section {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(49, 196, 141, 0.05), rgba(13, 148, 136, 0.05));
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 0;
}

.trending-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(49, 196, 141, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.trending-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(49, 196, 141, 0.15);
    border-color: rgba(49, 196, 141, 0.2);
    background: rgba(49, 196, 141, 0.08);
}

.trending-image {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
}

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

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

.trending-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.trending-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
}

.trending-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.trending-category {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    background: rgba(49, 196, 141, 0.1);
    border-radius: 20px;
}

.play-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.play-link:hover {
    color: var(--primary-color);
}

.play-link svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.play-link:hover svg {
    transform: translateX(3px);
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.02);
    padding: 4rem 2rem 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 4rem;
}

.footer-logo h3 {
    font-size: 1.5rem;
    margin: 0 0 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.footer-logo p {
    color: var(--text-color-muted);
    line-height: 1.6;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-section h4 {
    font-size: 1.1rem;
    margin: 0 0 1rem;
    color: var(--text-color);
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul a {
    color: var(--text-color-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--text-color-muted);
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
}

.social-links svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-color-muted);
}

@media (max-width: 1200px) {
    .trending-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .footer-links {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .trending-section {
        padding: 3rem 1rem;
    }

    .trending-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .trending-image {
        height: 180px;
    }

    .footer {
        padding: 3rem 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .trending-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin: 0 auto;
    }

    .trending-image {
        height: 200px;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }

    .game-image {
        height: 160px;
    }

    .game-title {
        font-size: 1.1rem;
    }

    .game-description {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin: 0 auto;
    }

    .game-image {
        height: 200px;
    }
}

@media (max-width: 768px) {
    .nav-content {
        padding: 0.5rem 1rem;
        gap: 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .search-container {
        max-width: 200px;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .nav-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .search-container {
        order: 3;
        max-width: 100%;
        margin-top: 0.5rem;
    }

    .nav-links {
        order: 2;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn var(--transition-normal) forwards;
}

/* Particles Background */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
