* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #0b0f1a;
    color: #e6f0ff;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 40px;
}

/* Navigation */
nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

nav a {
    color: #6cb6ff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

nav a:hover {
    color: #9ad0ff;
}

nav span {
    color: #9ad0ff;
}

/* Headings */
h1, h2, h3 {
    text-align: center;
    color: #6cb6ff;
}

h1 {
    margin-bottom: 10px;
}

h2 {
    margin-top: 40px;
    margin-bottom: 20px;
}

/* Paragraphs */
p {
    line-height: 1.6;
    text-align: center;
}

/* Forms */
form {
    max-width: 400px;
    margin: 30px auto;
    background-color: #12172a;
    padding: 25px;
    border-radius: 8px;
}

label {
    font-size: 0.9em;
    display: block;
    margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    border: none;
    border-radius: 4px;
    background-color: #1f2a44;
    color: #e6f0ff;
}

input::placeholder {
    color: #7a8a9e;
}

button,
input[type="submit"] {
    width: 100%;
    padding: 10px;
    background-color: #6cb6ff;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    color: #0b0f1a;
    transition: background-color 0.3s;
}

button:hover,
input[type="submit"]:hover {
    background-color: #9ad0ff;
}

/* Horizontal Rule */
hr {
    border: 0;
    height: 1px;
    background: #1f2a44;
    margin: 30px 0;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.game-card {
    background-color: #12172a;
    border: 1px solid #1f2a44;
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(108, 182, 255, 0.2);
    border-color: #6cb6ff;
}

.game-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #6cb6ff;
    font-size: 1.1em;
    text-align: left;
}

.game-card p {
    margin: 8px 0;
    color: #9ad0ff;
    text-align: left;
    font-size: 0.9em;
}

.game-card form {
    width: 100%;
    margin: 10px 0 0 0;
    padding: 0;
    background: transparent;
}

.game-card button {
    width: 100%;
    margin: 0;
    padding: 10px;
}

.game-card a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    background-color: #1f2a44;
    color: #6cb6ff;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.game-card a:hover {
    background-color: #2a3a5a;
}

/* Game Card Image */
.game-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
}

/* Error and Success Messages */
p[style*="color: red"],
p[style*="color: green"] {
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

p[style*="color: red"] {
    background-color: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
}

p[style*="color: green"] {
    background-color: rgba(100, 255, 100, 0.1);
    border: 1px solid rgba(100, 255, 100, 0.3);
}

/* Library-specific styles */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.library-card {
    background-color: #12172a;
    border: 1px solid #1f2a44;
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.library-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(108, 182, 255, 0.2);
    border-color: #6cb6ff;
}

.library-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #6cb6ff;
    font-size: 1.1em;
    text-align: left;
}

.library-card p {
    margin: 8px 0;
    color: #9ad0ff;
    text-align: left;
    font-size: 0.9em;
}

.library-card form {
    width: 100%;
    margin: 10px 0 0 0;
    padding: 0;
    background: transparent;
}

.library-card button {
    width: 100%;
    margin: 0;
    padding: 10px;
    background-color: #ff6b6b;
}

.library-card button:hover {
    background-color: #ff5252;
}

.empty-library {
    text-align: center;
    padding: 40px;
    background-color: #12172a;
    border-radius: 8px;
    margin-top: 30px;
}

.empty-library p {
    color: #7a8a9e;
    margin-bottom: 20px;
}

.empty-library a {
    color: #6cb6ff;
    text-decoration: none;
    font-weight: bold;
}

.empty-library a:hover {
    color: #9ad0ff;
}

button:disabled,
button[disabled] {
    background-color: #4a5568 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* Search and Filter Section */
.search-filter-section {
    background-color: #12172a;
    padding: 15px 25px;
    border-radius: 8px;
    margin: 0 auto 30px auto;
    max-width: 800px;
    border: 1px solid #1f2a44;
}

.search-box {
    margin-bottom: 0;
}

#searchInput {
    width: 100%;
    max-width: 600px;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #1f2a44;
    border-radius: 8px;
    background-color: #0b0f1a;
    color: #e6f0ff;
    transition: border-color 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: #6cb6ff;
}

#searchInput::placeholder {
    color: #7a8a9e;
}

/* Filters Container */
.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 20px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group h4 {
    color: #6cb6ff;
    margin-bottom: 12px;
    font-size: 16px;
    text-align: left;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    color: #9ad0ff;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: color 0.2s;
}

.filter-group label:hover {
    color: #e6f0ff;
}

.filter-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* Clear Filters Button */
.clear-btn {
    background-color: #1f2a44;
    color: #9ad0ff;
    border: 1px solid #6cb6ff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    align-self: flex-start;
}

.clear-btn:hover {
    background-color: #6cb6ff;
    color: #0b0f1a;
}

/* Results Info */
.results-info {
    text-align: center;
    margin-top: 15px;
}

.results-info p {
    color: #9ad0ff;
    font-size: 14px;
}

.results-info strong {
    color: #6cb6ff;
}

/* No Results Message */
#noResults {
    background-color: #12172a;
    border: 2px dashed #1f2a44;
    border-radius: 8px;
    color: #7a8a9e;
}

/* Game Card Visibility (for filtering) */
.game-card.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    #searchInput {
        font-size: 14px;
    }
}

.oauth-btn {
    display: block;
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    text-decoration: none;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.google-btn {
    background-color: #4285F4;
    color: white;
}

.google-btn:hover {
    background-color: #357ABD;
}

.steam-btn {
    background-color: #1b2838;
    color: #c6d4df;
    border: 1px solid #4c6b22;
    margin-top: 10px;
}

.steam-btn:hover {
    background-color: #2a475e;
}

/* --- NEW: Recommendations Row Styling --- */
.recommendations-section {
    margin-bottom: 40px;
}

.recommendations-section h2, .section-title {
    text-align: left;
    margin-bottom: 20px;
    font-size: 1.5em;
    padding-left: 5px;
    border-left: 4px solid #6cb6ff;
}

.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.rec-card {
    background-color: #12172a;
    border: 1px solid #1f2a44;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.rec-card:hover {
    transform: scale(1.03);
    border-color: #6cb6ff;
}

.rec-card a, .game-card a.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.rec-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.rec-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rec-title {
    font-size: 0.9em;
    font-weight: bold;
    color: #e6f0ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rec-price {
    font-size: 0.85em;
    color: #6cb6ff;
}

/* Layout for the bar containing Search + Filter Button */
.search-main-bar {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

/* The Toggle Button */
.filter-toggle-btn {
    width: auto !important; /* Overriding your global button width */
    padding: 10px 25px;
    background-color: #1f2a44;
    color: #6cb6ff;
    border: 1px solid #1f2a44;
    white-space: nowrap;
}

.filter-toggle-btn:hover {
    background-color: #2a3a5a;
    border-color: #6cb6ff;
}

/* The Collapsible Content */
.filters-collapse-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    background-color: #0b0f1a;
    border-radius: 8px;
    padding: 0 20px; /* Horizontal padding only while closed */
}

/* When active (via JS) */
.filters-collapse-content.active {
    max-height: 500px; /* Adjust based on your filter height */
    padding: 20px;
    border: 1px solid #1f2a44;
    margin-top: 10px;
}