/* Basic Reset and Body Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    background-color: #f0f0f0; /* Light grey background */
    color: #333;
    line-height: 1.6;
}

/* Header Styling */
.header {
    background-color: #343a40; /* Dark header background */
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 20px; /* Space between header sections */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-icon {
    font-size: 24px;
    cursor: pointer;
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #ffc107; /* Yellow logo color */
}

.header-center {
    flex-grow: 1; /* Search bar takes available space */
    display: flex;
    align-items: center;
    max-width: 500px; /* Limit search bar width */
    background-color: #495057; /* Slightly lighter dark for search background */
    border-radius: 5px;
    overflow: hidden; /* Ensure button stays inside */
}

.search-input {
    flex-grow: 1;
    padding: 8px 15px;
    border: none;
    background-color: transparent;
    color: white;
    outline: none;
    font-size: 1em;
}

.search-input::placeholder {
    color: #ced4da; /* Light grey placeholder */
}

.search-button {
    background-color: #6c757d; /* Dark grey button */
    border: none;
    color: white;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #5a6268;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9em;
}

.top-nav-link {
    color: #ced4da; /* Light grey links */
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 3px;
    transition: color 0.3s ease;
}

.top-nav-link:hover,
.top-nav-link.active {
    color: white;
    /* border-bottom: 2px solid #ffc107; Yellow underline for active/hover */
}

.top-nav-link.active {
     font-weight: bold;
     color: white;
}


.top-nav-icon {
    font-size: 1.2em; /* Trophy icon size */
}


/* Main Container Layout (Sidebar + Game Area) */
.main-container {
    display: flex;
    min-height: calc(100vh - 60px); /* Adjust based on header height */
}

/* Sidebar Styling */
.sidebar {
    width: 220px; /* Fixed width for sidebar */
    background-color: #343a40; /* Dark background */
    color: #ced4da; /* Light grey text */
    padding: 20px 0; /* Add padding top/bottom */
    flex-shrink: 0; /* Prevent sidebar from shrinking */
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 5px; /* Space between list items */
}

.sidebar a {
    display: flex; /* Use flex to align icon, text, and count */
    align-items: center;
    color: #ced4da;
    text-decoration: none;
    padding: 8px 20px; /* Padding for clickable area */
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar a:hover {
    background-color: #495057; /* Darker background on hover */
    color: white;
}

.sidebar .icon {
    margin-right: 10px; /* Space between icon and text */
    font-size: 1.1em;
}

.sidebar .count {
    margin-left: auto; /* Push count to the right */
    background-color: #ffc107; /* Yellow count background */
    color: #343a40; /* Dark text for count */
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.sidebar .indicator {
    margin-left: auto; /* Push indicator to the right */
    width: 8px;
    height: 8px;
    background-color: #ffc107; /* Yellow indicator dot */
    border-radius: 50%;
}

.sidebar .separator {
    border-top: 1px solid #495057; /* Separator line */
    margin: 15px 20px;
}


/* Game Area Styling */
.game-area {
    flex-grow: 1; /* Game area takes remaining space */
    padding: 20px;
    background-color: #f8f9fa; /* Slightly lighter grey background */
}

.game-grid {
    display: grid;
    /* Responsive grid: auto-fill columns of min 150px, max 1fr */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px; /* Space between grid items */
    margin-bottom: 30px; /* Space below the main grid */
}

.game-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden; /* Hide parts of overlay if they go outside */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-decoration: none; /* Remove underline from link */
    color: #333; /* Text color for game title */
    position: relative; /* For positioning overlay indicators */
    display: block; /* Make the whole card clickable */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
    transform: translateY(-5px); /* Slight lift effect on hover */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.game-card img {
    width: 100%;
    height: 120px; /* Fixed height for images */
    object-fit: cover; /* Ensure image covers the area without distortion */
    display: block; /* Remove extra space below image */
}

.game-card p {
    padding: 10px;
    font-size: 0.9em;
    text-align: center;
    white-space: nowrap; /* Prevent title from wrapping */
    overflow: hidden; /* Hide overflow text */
    text-overflow: ellipsis; /* Add ellipsis if text overflows */
}

.overlay-indicators {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex; /* Use flex for multiple indicators */
    gap: 5px; /* Space between indicators */
    z-index: 1; /* Ensure indicators are above the image */
}

.indicator-yellow {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid #ffc107; /* Yellow triangle */
    transform: rotate(45deg); /* Rotate to match image */
}

.indicator-green {
     background-color: #28a745; /* Green background */
     color: white;
     font-size: 0.7em;
     padding: 2px 5px;
     border-radius: 3px;
     font-weight: bold;
}


/* Popular Games Section Styling */
.popular-games {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6; /* Separator line above popular section */
}

.popular-games h3 {
    font-size: 1.2em;
    color: #6c757d; /* Dark grey heading */
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.popular-games h3::before {
    content: '⭐'; /* Star icon or similar */
    font-size: 1em;
}


.popular-games ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap */
    gap: 10px; /* Space between list items */
}

.popular-games li {
    flex: 1 1 200px; /* Flex item grows, shrinks, basis 200px */
    max-width: 300px; /* Max width for popular items */
}


.popular-games a {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 12px 15px;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.popular-games a:hover {
    background-color: #e9ecef; /* Light grey on hover */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.popular-games .icon {
    margin-right: 10px;
    font-size: 1.2em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
     .header-left, .header-right {
        flex-basis: 100%; /* Stack header sections on small screens */
        justify-content: center;
     }
     .header-center {
         flex-basis: 100%;
     }

    .main-container {
        flex-direction: column; /* Stack sidebar and game area */
    }

    .sidebar {
        width: 100%; /* Sidebar takes full width */
        padding: 10px 0;
    }
    .sidebar ul {
        display: flex; /* Make sidebar items horizontal/wrap */
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    .sidebar li {
        margin-bottom: 0;
    }
    .sidebar a {
        padding: 5px 10px; /* Reduce padding */
        flex-direction: row;
        justify-content: center;
        gap: 5px;
    }
     .sidebar .count, .sidebar .indicator {
        margin-left: 0; /* Remove auto margin */
     }
     .sidebar .separator {
        display: none; /* Hide separator in mobile view */
     }

    .game-area {
        padding: 10px;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Smaller cards on mobile */
        gap: 10px;
    }

    .game-card img {
        height: 100px; /* Smaller image height */
    }

    .popular-games ul {
        flex-direction: column; /* Stack popular items */
    }
    .popular-games li, .popular-games a {
        width: 100%;
        max-width: none;
    }
}

