/* ==========================================================================
   CSS Variables & Reset
   ========================================================================== */
:root {
    /* Colors */
    --bg-main: #1C1C1E;
    --bg-sidebar: #1C1C1E;
    --bg-card: #2C2C2E;
    --bg-card-hover: #3A3A3D;
    --bg-input: #2C2C2E;
    
    --text-primary: #FFFFFF;
    --text-secondary: #98989D;
    --text-muted: #636366;
    
    --accent-blue: #0A84FF;
    --accent-blue-hover: #0070E0;
    --accent-green: #30D158;
    --accent-green-hover: #28B94D;
    --accent-red: #FF453A;
    --accent-orange: #FF9F0A;
    
    --border-color: rgba(255, 255, 255, 0.08);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.25s ease-in-out;
    
    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

button, input {
    font-family: inherit;
    outline: none;
    border: none;
}

button {
    cursor: pointer;
}

ul {
    list-style: none;
}

/* ==========================================================================
   Layout Structures
   ========================================================================== */
.app-container {
    display: flex;
    height: 100vh;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;   /* above the fixed Steam background */
    overflow-y: auto;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding: 0 8px;
}

.logo-icon {
    font-size: 28px;
    color: var(--text-primary);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-accent {
    color: var(--text-secondary);
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
}

.sidebar-nav ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.nav-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 12px 0;
}

.menu-badge {
    margin-left: auto;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.sidebar-footer-note {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 30px;
    padding: 0 12px;
}

.sidebar-footer-note a {
    color: var(--accent-blue);
}

.sidebar-footer-note a:hover {
    text-decoration: underline;
}

.sidebar-copyright {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.8;
    padding: 0 12px;
}

.sidebar-copyright a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-copyright a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

/* ==========================================================================
   Main Content & Topbar
   ========================================================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    margin-left: 260px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    background: transparent;
    position: relative;
    z-index: 10;
    border-bottom: none;
}

.search-container {
    position: relative;
    width: 600px;
    max-width: 100%;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 16px 10px 44px;
    font-size: 14px;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: rgba(255,255,255,0.35);
}

.search-input:focus {
    background: rgba(255,255,255,0.11);
    border-color: rgba(10,132,255,0.5);
    box-shadow: 0 0 0 3px rgba(10,132,255,0.15);
    outline: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.lang-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.flag-icon {
    width: 18px;
    border-radius: 2px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #FFF;
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--accent-green);
    color: #FFF;
}

.btn-success:hover {
    background-color: var(--accent-green-hover);
    transform: translateY(-1px);
}

/* ==========================================================================
   Page Content
   ========================================================================== */
.page-container {
    padding: 24px 40px 60px;
    width: 100%;
    max-width: 1200px; /* Defines the narrow content area without affecting the global background */
    margin: 0 auto; /* Center page content */
    position: relative; /* For background positioning if needed */
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.title-group {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.count-badge {
    color: var(--text-muted);
    font-size: 20px;
    font-weight: 500;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.view-toggles {
    display: flex;
    background-color: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.view-btn {
    background: transparent;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.view-btn.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-card);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
}

.filter-btn i {
    font-size: 16px;
}

.filter-btn:hover {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
}

/* ==========================================================================
   Games Grid
   ========================================================================== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.game-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    cursor: pointer;
    position: relative;
    border: 1px solid transparent;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
    background-color: var(--bg-card-hover);
}

.game-cover {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-bottom: 1px solid rgba(0,0,0,0.2);
}

.game-info {
    padding: 16px;
}

.game-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
