/* ===== CSS VARIABLES ===== */
:root {
    --bg-dark: #0a0a0f;
    --bg-card: #13131d;
    --bg-card-hover: #1a1a2e;
    --bg-surface: #16162a;
    --bg-nav: rgba(10, 10, 18, 0.92);
    --accent: #b14aed;
    --accent-bright: #c96ff5;
    --accent-glow: rgba(177, 74, 237, 0.35);
    --accent-dim: rgba(177, 74, 237, 0.12);
    --text-primary: #e8e6f0;
    --text-secondary: #8a87a0;
    --text-muted: #5a576e;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(177, 74, 237, 0.3);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(177, 74, 237, 0.15);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --nav-height: 60px;
    --font-display: 'Rajdhani', sans-serif;
    --font-body: 'Exo 2', sans-serif;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-dark);
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

::selection { background: var(--accent); color: #fff; }

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}

.nav-left, .nav-right { display: flex; align-items: center; gap: 8px; }
.nav-center { display: flex; align-items: center; gap: 4px; }

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 2px;
}

.logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.logo-accent { color: var(--accent-bright); }

.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.nav-tab:hover { color: var(--text-primary); background: var(--accent-dim); }
.nav-tab.active {
    color: var(--accent-bright);
    background: var(--accent-dim);
}

.nav-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
}

.nav-icon-btn:hover {
    color: var(--accent-bright);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.filter-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discord-btn {
    text-decoration: none;
    color: var(--text-secondary);
}
.discord-btn:hover { color: #5865F2; border-color: #5865F2; }

/* ===== SEARCH ===== */
.search-container {
    display: flex;
    align-items: center;
    position: relative;
}

.search-input {
    width: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.search-container.active .search-input {
    width: 200px;
    padding: 8px 12px;
    opacity: 1;
    border-bottom: 2px solid var(--accent);
}

.search-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
    transition: color 0.2s;
}

.search-close:hover { color: var(--text-primary); }
.search-container.active .search-close { display: block; }
.search-container.active .search-toggle { display: none; }

/* ===== FILTER PANEL ===== */
.filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1100;
}

.filter-overlay.active { display: block; }

.filter-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 360px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    z-index: 1200;
    padding: 24px;
    overflow-y: auto;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-panel.active { right: 0; }

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.filter-header h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.filter-clear {
    background: none;
    border: none;
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s;
}

.filter-clear:hover { color: var(--accent-bright); }

.filter-section { margin-bottom: 24px; }

.filter-section h4 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.chip:hover {
    border-color: var(--accent);
    color: var(--accent-bright);
}

.chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-glow);
}

.filter-apply {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 16px;
}

.filter-apply:hover {
    background: var(--accent-bright);
    box-shadow: var(--shadow-glow);
}

/* ===== HERO ===== */
.hero {
    position: relative;
    padding: calc(var(--nav-height) + 60px) 24px 50px;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, var(--accent-glow) 0%, transparent 60%);
    pointer-events: none;
}

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

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.15;
    margin-bottom: 12px;
}

.text-accent { color: var(--accent-bright); }

.hero p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== ACTIVE FILTERS BAR ===== */
.active-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.active-filters-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.active-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.active-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: 20px;
    color: var(--accent-bright);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.active-chip:hover { background: var(--accent); color: #fff; }
.active-chip .remove { font-size: 0.9rem; line-height: 1; }

/* ===== RESULTS BAR ===== */
.results-bar {
    padding: 0 24px 16px;
    max-width: 1400px;
    margin: 0 auto;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== GAME GRID ===== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 0 24px 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.game-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 460 / 215;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--border-hover);
    box-shadow: var(--shadow), var(--shadow-glow);
}

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

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

.game-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px;
    pointer-events: none;
}

.game-card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1.2;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.game-card-meta {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.game-card-tag {
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--accent-dim);
    color: var(--accent-bright);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(177, 74, 237, 0.2);
}

.game-card-mod-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px var(--accent-glow);
    pointer-events: none;
}

/* ===== NO RESULTS ===== */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.no-results svg { margin-bottom: 16px; opacity: 0.5; }
.no-results h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px 24px 48px;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.page-btn:hover:not(.active):not(:disabled) {
    border-color: var(--border-hover);
    color: var(--accent-bright);
}

.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-glow);
}

.page-btn:disabled { opacity: 0.3; cursor: default; }

.page-input {
    width: 50px;
    height: 38px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.page-input:focus { border-color: var(--accent); }

.page-total {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active { display: block; }

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    z-index: 2100;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), var(--shadow-glow);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.modal-close:hover { background: var(--accent); }

.modal-image {
    width: 100%;
    aspect-ratio: 460 / 215;
    overflow: hidden;
}

.modal-image img { width: 100%; height: 100%; object-fit: cover; }

.modal-body { padding: 24px; }

.modal-body h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

.modal-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-tag.coop {
    background: var(--accent-dim);
    border: 1px solid rgba(177, 74, 237, 0.3);
    color: var(--accent-bright);
}

.modal-tag.genre {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.modal-info { display: flex; gap: 20px; margin-bottom: 16px; }

.modal-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.modal-info-item svg { color: var(--accent); flex-shrink: 0; }

.modal-desc {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Mod info */
.modal-mod-info {
    background: rgba(177, 74, 237, 0.06);
    border: 1px solid rgba(177, 74, 237, 0.15);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}

.mod-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-bright);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.mod-tool { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 6px; }
.mod-tool strong { color: var(--text-primary); }
.mod-notes { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px; }

.mod-link {
    display: inline-block;
    color: var(--accent-bright);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.mod-link:hover { color: #fff; }

.modal-steam-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    color: #fff;
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
}

.modal-steam-btn:hover {
    background: var(--accent-bright);
    box-shadow: var(--shadow-glow);
}

.modal-comments {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.modal-comments h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* ===== DISCUSSION SECTION ===== */
.discussion-section {
    padding: calc(var(--nav-height) + 40px) 24px 60px;
    max-width: 800px;
    margin: 0 auto;
}

.discussion-container h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.discussion-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

/* Disqus placeholder */
.disqus-placeholder {
    text-align: center;
    padding: 48px 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
}

.disqus-placeholder p { margin-top: 12px; font-size: 0.9rem; }
.disqus-placeholder .disqus-hint { font-size: 0.75rem; margin-top: 8px; }
.disqus-placeholder.small { padding: 24px 16px; }
.disqus-placeholder.small p { font-size: 0.8rem; margin-top: 0; }

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    text-align: center;
}

.footer-content { max-width: 600px; margin: 0 auto; }

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.footer p { color: var(--text-muted); font-size: 0.85rem; margin-top: 8px; }

.footer-links { margin-top: 16px; display: flex; justify-content: center; gap: 20px; }

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent-bright); }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-card {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

/* Stagger the animation for cards */
.game-card:nth-child(1) { animation-delay: 0.02s; }
.game-card:nth-child(2) { animation-delay: 0.04s; }
.game-card:nth-child(3) { animation-delay: 0.06s; }
.game-card:nth-child(4) { animation-delay: 0.08s; }
.game-card:nth-child(5) { animation-delay: 0.1s; }
.game-card:nth-child(6) { animation-delay: 0.12s; }
.game-card:nth-child(7) { animation-delay: 0.14s; }
.game-card:nth-child(8) { animation-delay: 0.16s; }
.game-card:nth-child(9) { animation-delay: 0.18s; }
.game-card:nth-child(10) { animation-delay: 0.2s; }
.game-card:nth-child(n+11) { animation-delay: 0.22s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .navbar { padding: 0 12px; }
    .nav-center { display: none; }
    .logo-text { font-size: 1.1rem; }

    .hero { padding: calc(var(--nav-height) + 30px) 16px 30px; }
    .hero h1 { font-size: 1.6rem; }

    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
        padding: 0 12px 24px;
    }

    .game-card-title { font-size: 0.8rem; }
    .game-card-meta { display: none; }

    .filter-panel { width: 300px; right: -320px; }

    .modal { width: 95%; max-height: 90vh; }
    .modal-body { padding: 16px; }
    .modal-body h2 { font-size: 1.2rem; }

    .search-container.active .search-input { width: 140px; }

    /* Mobile bottom nav */
    .nav-right { gap: 4px; }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .game-card-overlay { padding: 10px; }
    .game-card-title { font-size: 0.75rem; }
}
