/* ===== GENERAL STYLES ===== */
:root {
    --primary-color: #4a69bd;
    --secondary-color: #6a89cc;
    --accent-color: #f39c12;
    --light-color: #f9f9f9;
    --dark-color: #2c3e50;
    --text-color: #333;
    --gray-color: #95a5a6;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-weight: 500;
    font-size: 1rem;
    text-align: center;
}

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

section {
    padding: 80px 0;
}

h1, h2, h3, h4 {
    margin-bottom: 20px;
    color: var(--dark-color);
    font-weight: 600;
}

/* ===== LOADER ===== */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

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

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

/* ===== HEADER ===== */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #f1f2f6;
    border-radius: 50px;
    padding: 8px 16px;
    width: 100%;
    max-width: 400px;
    margin: 0 20px;
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    padding: 8px;
    font-size: 0.9rem;
}

.search-bar button {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--gray-color);
    transition: var(--transition);
}

.search-bar button:hover {
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-color);
}

.main-nav ul {
    display: flex;
    gap: 20px;
}

.main-nav a {
    color: var(--dark-color);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.main-nav a:hover, 
.main-nav a.active {
    color: var(--primary-color);
    background-color: rgba(74, 105, 189, 0.1);
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 120px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1511512578047-dfb367046420?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2071&q=80');
    background-size: cover;
    background-position: center;
    opacity: 0.2;
}

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

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: white;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero .btn {
    background-color: var(--accent-color);
    padding: 14px 30px;
    font-size: 1.1rem;
}

.hero .btn:hover {
    background-color: #e67e22;
}

/* ===== GAMES SECTION ===== */
.games-section {
    background-color: #f9f9f9;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0;
    position: relative;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

#category-filter {
    padding: 10px 16px;
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    background-color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

#category-filter:focus {
    border-color: var(--primary-color);
}

.games-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.game-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.game-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

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

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

.game-image .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    transition: var(--transition);
}

.game-card:hover .play-button {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.game-info {
    padding: 20px;
}

.game-info h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--dark-color);
    transition: var(--transition);
}

.game-card:hover .game-info h3 {
    color: var(--primary-color);
}

.game-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.game-category {
    background-color: rgba(74, 105, 189, 0.1);
    color: var(--primary-color);
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 30px;
}

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

.load-more {
    text-align: center;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    font-size: 2rem;
    color: var(--primary-color);
}

/* ===== CATEGORIES SECTION ===== */
.categories-section {
    background-color: white;
    text-align: center;
}

.categories-section h2 {
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
}

.categories-section h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}

.category-card {
    background-color: white;
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.category-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.category-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.category-card p {
    font-size: 0.9rem;
    color: var(--gray-color);
}

/* ===== MODAL ===== */
.game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    width: 90%;
    max-width: 900px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    z-index: 10;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.modal-body {
    padding: 0;
}

.game-details {
    display: flex;
    flex-direction: column;
}

.modal-game-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.game-info {
    padding: 30px;
}

.game-info h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.modal-game-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-game-category {
    background-color: rgba(74, 105, 189, 0.1);
    color: var(--primary-color);
    font-size: 0.85rem;
    padding: 5px 12px;
    border-radius: 30px;
}

.game-description {
    margin-bottom: 20px;
    line-height: 1.6;
}

.game-instructions {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.game-instructions h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.play-btn {
    background-color: var(--accent-color);
    width: 100%;
    padding: 14px;
    font-weight: 600;
}

.play-btn:hover {
    background-color: #e67e22;
}

/* ===== FOOTER ===== */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 70px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-logo p {
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer-links h3,
.footer-categories h3,
.footer-newsletter h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links ul li,
.footer-categories ul li {
    margin-bottom: 12px;
}

.footer-links a,
.footer-categories a {
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover,
.footer-categories a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.footer-newsletter p {
    opacity: 0.8;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.newsletter-form {
    display: flex;
    gap: 10px;
}

.newsletter-form input {
    padding: 12px;
    border-radius: var(--border-radius);
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    flex-grow: 1;
    outline: none;
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.newsletter-form .btn {
    padding: 12px 15px;
    background-color: var(--accent-color);
}

.newsletter-form .btn:hover {
    background-color: #e67e22;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    opacity: 0.7;
    font-size: 0.9rem;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--accent-color);
    transform: translateY(-5px);
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 992px) {
    .navbar {
        flex-wrap: wrap;
    }
    
    .search-bar {
        order: 3;
        width: 100%;
        margin: 20px 0 0;
        max-width: none;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .game-details {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .main-nav {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 80%;
        height: calc(100vh - 80px);
        background-color: white;
        transition: 0.3s;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        z-index: 100;
    }
    
    .main-nav.active {
        left: 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        padding: 30px;
    }
    
    .main-nav a {
        display: block;
        padding: 15px;
    }
    
    .hero {
        padding: 80px 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .section-header h2::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .games-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-logo a {
        justify-content: center;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .navbar {
        justify-content: space-between;
    }
    
    .games-container {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .modal-content {
        margin: 20px auto;
    }
    
    section {
        padding: 60px 0;
    }
}

/* Loading Indicator for Infinite Scroll */
.loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px 0;
}

.loading-indicator .spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
    font-size: 1.5rem;
}

.loading-indicator .spinner i {
    animation: spin 1s linear infinite;
}

#scroll-sentinel {
    width: 100%;
    height: 1px;
    margin-top: 20px;
    visibility: hidden;
}

/* Hide the load more button since we're using infinite scroll */
.load-more {
    display: none;
} 