/* Base Styles & Modern Gaming Theme */
:root {
    --primary-color: #4CAF50; /* Green - Action color */
    --secondary-color: #333; /* Dark Grey - Text color */
    --background-color: #121212; /* Very dark background */
    --card-background: #1e1e1e; /* Darker card background */
    --text-light: #f0f0f0;
    --text-muted: #aaa;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    --border-radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-light);
    line-height: 1.6;
    padding-bottom: 50px; /* Space for footer/bottom content */
}

/* Header & Logo */
.header {
    background-color: var(--card-background);
    padding: 20px 0;
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    box-shadow: var(--shadow);
}

.logo h1 {
    font-size: 2em;
    color: var(--primary-color);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.logo i {
    margin-right: 10px;
}

/* Search Section */
.search-section {
    padding: 30px 20px;
    text-align: center;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

#game-search {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: none;
    border-radius: 50px;
    background-color: var(--card-background);
    color: var(--text-light);
    font-size: 1.1em;
    outline: none;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
}

#game-search:focus {
    box-shadow: 0 0 0 3px var(--primary-color);
}

.search-container .fa-search {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.2em;
}

/* Main Content Headings */
.games-main, .trending-section {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    font-size: 2.2em;
    color: var(--text-light);
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 1px solid var(--card-background);
    padding-bottom: 10px;
}

/* Game Grid Layout (Responsive) */
.game-grid, .trending-grid {
    display: grid;
    gap: 30px; /* Space between cards */
}

/* Mobile: 2 columns */
.game-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.trending-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}


/* Desktop: 4 columns */
@media (min-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .trending-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* Game Card Styling */
.game-box {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.game-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
}

.game-image {
    width: 100%;
    height: 180px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #333;
}

.game-info {
    padding: 15px;
    flex-grow: 1; /* Allows info section to take available space */
    display: flex;
    flex-direction: column;
}

.game-name {
    font-size: 1.4em;
    color: var(--primary-color);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-desc {
    font-size: 0.9em;
    color: var(--text-muted);
    margin-bottom: 10px;
    flex-grow: 1; /* Pushes button to bottom */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit description to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.game-rating .star {
    color: gold;
    margin-left: 2px;
}

.game-platforms .platform-icon {
    margin-left: 8px;
    color: var(--primary-color);
    font-size: 1.1em;
}

/* Download Button */
.download-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: auto; /* Ensures it sticks to the bottom */
    background-color: var(--primary-color);
    color: var(--background-color);
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.1s;
}

.download-btn:hover {
    background-color: #66BB6A;
    transform: scale(1.02);
}

.download-btn i {
    margin-right: 5px;
}

/* Safety Zone */
.safety-zone {
    max-width: 1200px;
    margin: 50px auto 0;
    padding: 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-top: 2px solid var(--primary-color);
}

.safe-icon {
    text-align: center;
    font-size: 1em;
    color: var(--text-light);
}

.safe-icon i {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.safe-icon span {
    display: block;
    font-weight: bold;
}

@media (max-width: 600px) {
    .safety-zone {
        flex-wrap: wrap;
        gap: 20px;
    }
    .safe-icon {
        flex-basis: 45%; /* Two icons per line on small screens */
    }
}