:root {
    --bg-page: #050811;
    --bg-sidebar: #0b111e;
    --bg-card: #151e2e;
    --accent: #6366f1; /* Indigo */
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.05);
    --nav-height: 70px;
    --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    overflow: hidden; /* Main layout handles scrolling */
}

/* Top Nav */
.top-nav {
    height: var(--nav-height);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
}

/* Top Nav Elements Alignment */
.nav-container {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 1px;
    flex-shrink: 0;
}

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

.search-container {
    flex: 1;
    max-width: 450px;
    height: 42px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.75rem;
    transition: border-color 0.2s ease;
}

.search-container:focus-within {
    border-color: var(--accent);
}

.search-container i {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-container input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    outline: none;
    height: 100%;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.sort-icon {
    position: absolute;
    left: 0.85rem;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.sort-dropdown {
    height: 42px; /* Match Search Box Height */
    background: var(--bg-card);
    color: white;
    border: 1px solid var(--border);
    padding: 0 1.5rem 0 2.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    transition: border-color 0.2s ease;
}

.sort-dropdown:focus, .search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Main Layout */
.main-layout {
    display: flex;
    height: 100vh;
    padding-top: var(--nav-height);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 2rem 1rem;
    overflow-y: auto;
}

.sidebar-section { margin-bottom: 2.5rem; }

.sidebar-section h4 {
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.platform-list, .genre-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.plat-item, .genre-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.plat-item i { width: 18px; height: 18px; }

.plat-item:hover, .genre-item:hover {
    background: rgba(255,255,255,0.03);
    color: white;
}

.plat-item.active, .genre-item.active {
    background: var(--accent);
    color: white;
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    min-height: 100vh; /* Keep height stable */
}

.content-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.seo-text {
    color: var(--text-muted);
    font-size: 1rem;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    min-height: 600px; /* Prevent layout collapse */
}

/* Cards */
.game-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.game-img-wrapper { aspect-ratio: 16/9; overflow: hidden; }

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

.game-info { padding: 1.25rem; }

.game-tag {
    font-size: 0.65rem;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 0.5rem;
    display: block;
}

.game-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

/* New: Deals Styling */
.game-price-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.price-box {
    display: flex;
    flex-direction: column;
}

.old-price {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.current-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #4ade80; /* Success Green */
}

.current-price.free {
    color: var(--accent);
}

.savings-badge {
    background: #ef4444; /* Alert Red */
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.store-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 0.35rem 0.6rem;
    border-radius: 20px;
}

.store-icon {
    width: 14px;
    height: 14px;
}

/* Intelligence Banner */
.intelligence-banner {
    background: linear-gradient(90deg, rgba(99,102,241,0.2), transparent);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { border-color: rgba(99,102,241,0.3); }
    50% { border-color: rgba(99,102,241,0.6); }
}

.banner-icon { color: var(--accent); }
.banner-text { font-size: 0.9rem; font-weight: 600; }
.banner-text span { color: #4ade80; }

/* Loader */
.loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5,8,17,0.8);
    display: flex;
    justify-content: center;
    padding-top: 100px;
    z-index: 10;
}

.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbars */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Footer */
.site-footer {
    background: #0a0d17;
    border-top: 1px solid var(--border);
    padding: 4rem 2.5rem 2rem;
    margin-top: auto;
}

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

.footer-info {
    max-width: 500px;
    margin-bottom: 3rem;
}

.footer-logo {
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.footer-info p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom a {
    color: var(--accent);
    text-decoration: none;
    transition: filter 0.2s;
}

.footer-bottom a:hover {
    filter: brightness(1.2);
}

@media (max-width: 768px) {
    .main-layout { flex-direction: column; }
    .sidebar { 
        width: 100%; 
        height: auto; 
        position: relative; 
        border-right: none; 
        border-bottom: 1px solid var(--border);
        padding: 1.5rem;
    }
    .nav-container { padding: 0 1rem; gap: 1rem; }
    .search-container { max-width: none; }
    .footer-bottom { justify-content: center; text-align: center; }
}
