/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
}

/* Header and Navigation */
header {
    background-color: #2c3e50;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 50px;
    width: auto;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links li a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.nav-links li a:hover {
    color: #3498db;
}

.auth-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.auth-container .username {
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    background-color: #27ae60;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.auth-container .username:hover {
    background-color: #219653;
}

.auth-container .logout-btn {
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    background-color: #e74c3c;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.auth-container .logout-btn:hover {
    background-color: #c0392b;
}

.auth-btn {
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    background-color: #e74c3c;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    display: none; /* Hidden when user is logged in */
}

.auth-btn:hover {
    background-color: #c0392b;
}

/* Hero Section (for homepage) */
.hero {
    padding: 100px 2rem 4rem;
    text-align: center;
    background-color: #fff;
    min-height: calc(100vh - 100px); /* Account for fixed header */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-buttons .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    text-decoration: none;
    border-radius: 5px;
    margin: 0 0.5rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn.primary {
    background-color: #3498db;
    color: #fff;
}

.btn.primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn.secondary {
    background-color: #f1c40f;
    color: #2c3e50;
}

.btn.secondary:hover {
    background-color: #f39c12;
    transform: translateY(-2px);
}

/* About Section (for homepage) */
.about {
    padding: 4rem 2rem;
    background-color: #ecf0f1;
    text-align: center;
}

.about h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.about p {
    font-size: 1.1rem;
    color: #7f8c8d;
    max-width: 800px;
    margin: 0 auto 1rem;
}

/* Games Section */
.games-section {
    padding: 100px 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.games-section h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 2rem;
    text-align: center;
}

.search-bar {
    width: 100%;
    max-width: 500px;
    padding: 0.8rem;
    margin: 0 auto 2rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    box-sizing: border-box;
    display: block;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Two columns on desktop */
    gap: 2rem;
    padding: 1rem;
}

.game-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.game-link {
    text-decoration: none;
    color: #333;
    display: block;
    padding: 1rem;
}

.game-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
}

.game-card h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin: 1rem 0 0.5rem;
}

.game-card p {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 0;
}

/* Popups */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Darker overlay */
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background-color: #ffffff; /* White background for popups */
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 300px;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
}

.popup-content h2 {
    color: #2c3e50; /* Dark blue for headers */
    margin-bottom: 20px;
    font-size: 24px;
}

.popup-content input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.popup-content button {
    width: 100%;
    padding: 12px;
    margin: 5px 0;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.popup-content button[type="submit"] {
    background-color: #3498db; /* Blue for submit buttons */
    color: #ffffff;
}

.popup-content button[type="submit"]:hover {
    background-color: #2980b9; /* Darker blue on hover */
}

.popup-content button[type="button"] {
    background-color: #e74c3c; /* Red for secondary buttons */
    color: #ffffff;
}

.popup-content button[type="button"]:hover {
    background-color: #c0392b; /* Darker red on hover */
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 1rem;
    position: relative;
    bottom: 0;
    width: 100%;
}

footer p {
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .auth-container {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .auth-container .username, .auth-container .logout-btn {
        width: 100%;
        text-align: center;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .about {
        padding: 2rem 1rem;
    }

    .about h2 {
        font-size: 1.5rem;
    }

    .games-section {
        padding: 80px 1rem 2rem;
    }

    .games-section h2 {
        font-size: 1.5rem;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* One column on mobile */
    }

    .game-card {
        margin: 0 auto;
    }
}