/* GameVault - Premium CSS v2.0 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

/* ============================================================
   CSS VARIABLES - DARK THEME (default)
   ============================================================ */
:root {
  --bg-primary: #080c14;
  --bg-secondary: #0f1623;
  --bg-tertiary: #141d2e;
  --bg-card: rgba(15,22,35,0.92);
  --bg-glass: rgba(255,255,255,0.04);
  --bg-input: rgba(20,29,46,0.95);
  --bg-select: #0f1623;
  --bg-hover: rgba(99,102,241,0.08);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(99,102,241,0.5);
  --border-input: rgba(255,255,255,0.12);
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-2: #06b6d4;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --orange: #f97316;
  --purple: #a855f7;
  --pink: #ec4899;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.3);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  --sidebar-width: 240px;
  --topbar-height: 60px;
}

/* ============================================================
   LIGHT THEME
   ============================================================ */
body.theme-light {
  --bg-primary: #f0f4f8;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e8edf5;
  --bg-card: rgba(255,255,255,0.95);
  --bg-glass: rgba(255,255,255,0.7);
  --bg-input: #ffffff;
  --bg-select: #ffffff;
  --bg-hover: rgba(99,102,241,0.08);
  --border: rgba(0,0,0,0.1);
  --border-hover: rgba(99,102,241,0.5);
  --border-input: rgba(0,0,0,0.15);
  --accent: #4f46e5;
  --accent-hover: #6366f1;
  --accent-2: #0891b2;
  --green: #059669;
  --red: #dc2626;
  --yellow: #d97706;
  --orange: #ea580c;
  --purple: #9333ea;
  --pink: #db2777;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow: 0 4px 24px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.15);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.08);
}

body.theme-light .glass {
  background: rgba(255,255,255,0.8);
  border-color: rgba(0,0,0,0.1);
}
body.theme-light .glass-dark {
  background: rgba(240,244,248,0.9);
  border-color: rgba(0,0,0,0.1);
}
body.theme-light .glass-card {
  background: rgba(255,255,255,0.95);
  border-color: rgba(0,0,0,0.1);
}
body.theme-light .sidebar {
  background: rgba(255,255,255,0.95);
  border-right-color: rgba(0,0,0,0.1);
}
body.theme-light .topbar {
  background: rgba(255,255,255,0.95);
  border-bottom-color: rgba(0,0,0,0.1);
}
body.theme-light .nav-item:hover,
body.theme-light .nav-item.active {
  background: rgba(99,102,241,0.1);
}
body.theme-light .login-bg {
  background: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(6,182,212,0.05) 0%, transparent 50%),
              linear-gradient(135deg, #f0f4f8 0%, #e8edf5 100%);
}
body.theme-light .stat-card { background: rgba(255,255,255,0.95); }
body.theme-light .game-card { background: rgba(255,255,255,0.95); }
body.theme-light .modal { background: #ffffff; }
body.theme-light .dropdown-menu { background: #ffffff; border-color: rgba(0,0,0,0.12); }
body.theme-light .dropdown-item:hover { background: rgba(99,102,241,0.08); }
body.theme-light .tabs { background: rgba(0,0,0,0.05); }
body.theme-light .tab.active { background: var(--accent); color: #fff; }

html, body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================================
   GLASSMORPHISM
   ============================================================ */
.glass {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
}
.glass-dark {
  background: rgba(8,12,20,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
}
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}
.glass-card:hover { border-color: rgba(99,102,241,0.3); box-shadow: 0 0 30px rgba(99,102,241,0.1); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
#login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-bg {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(6,182,212,0.1) 0%, transparent 50%),
              radial-gradient(ellipse at 60% 90%, rgba(168,85,247,0.08) 0%, transparent 50%),
              linear-gradient(135deg, #080c14 0%, #0f1623 50%, #080c14 100%);
}
.login-particles { position: fixed; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.particle {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.6), transparent);
  animation: float linear infinite;
}
@keyframes float {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}
.login-card {
  position: relative; z-index: 10;
  width: 100%; max-width: 440px;
  background: var(--bg-card);
  backdrop-filter: blur(40px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg), 0 0 80px rgba(99,102,241,0.1);
  margin: 20px;
}
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.login-logo-icon { font-size: 42px; filter: drop-shadow(0 0 20px rgba(99,102,241,0.5)); }
.login-title { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; background: linear-gradient(135deg, var(--text-primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.login-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 28px; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
#app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.sidebar-header {
  padding: 20px 16px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-icon { font-size: 28px; }
.sidebar-logo-text { font-size: 16px; font-weight: 800; background: linear-gradient(135deg, var(--text-primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.sidebar-logo-sub { font-size: 9px; color: var(--accent); font-weight: 600; letter-spacing: 1.5px; display: block; margin-top: 1px; }
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-section-label { font-size: 10px; font-weight: 700; color: var(--text-muted); letter-spacing: 1.2px; text-transform: uppercase; padding: 8px 12px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  cursor: pointer; transition: var(--transition);
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  margin-bottom: 2px; text-decoration: none;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(99,102,241,0.1)); color: var(--accent); font-weight: 600; }
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius); cursor: pointer; transition: var(--transition); }
.sidebar-user:hover { background: var(--bg-hover); }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--text-muted); }

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(20px);
}
.topbar-title { font-size: 16px; font-weight: 700; flex: 1; }
.hamburger { display: none; background: none; border: none; color: var(--text-primary); font-size: 20px; cursor: pointer; padding: 6px; border-radius: 8px; transition: var(--transition); }
.hamburger:hover { background: var(--bg-hover); }
#page-container { flex: 1; padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--bg-hover); color: var(--accent); border-color: var(--accent); }

/* ============================================================
   FORMS & INPUTS - Fix mobile zoom + combobox text
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 16px; /* 16px prevents mobile zoom */
  font-family: inherit;
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.form-input::placeholder { color: var(--text-muted); font-size: 14px; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  background: var(--bg-input);
}
.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
}
/* CRITICAL: Fix for option elements - white text on dark bg */
.form-select option,
select option {
  background-color: var(--bg-select) !important;
  color: var(--text-primary) !important;
  font-size: 14px;
  padding: 8px 12px;
}
select option:hover,
select option:focus,
select option:checked {
  background-color: var(--accent) !important;
  color: #ffffff !important;
}
/* Light theme option fix */
body.theme-light .form-select option,
body.theme-light select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; pointer-events: none; }
.form-icon-right { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }
.form-input.has-icon, .form-select.has-icon { padding-left: 40px; }

/* Touch-friendly select on mobile */
@media (max-width: 768px) {
  .form-input, .form-select, .form-textarea {
    font-size: 16px !important; /* Prevent iOS zoom */
  }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  border: 1px solid transparent;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(99,102,241,0.4); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-glass); color: var(--text-secondary); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-hover); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--red); border-color: rgba(239,68,68,0.3); }
.btn-danger:hover:not(:disabled) { background: var(--red); color: #fff; }
.btn-success { background: rgba(16,185,129,0.15); color: var(--green); border-color: rgba(16,185,129,0.3); }
.btn-success:hover:not(:disabled) { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 13px 24px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; border-radius: 8px; }
.btn-icon.btn-sm { padding: 6px; }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; gap: 4px; background: var(--bg-glass); padding: 4px; border-radius: var(--radius); border: 1px solid var(--border); }
.tab { flex: 1; padding: 7px 14px; border-radius: 8px; border: none; background: none; color: var(--text-secondary); font-size: 13px; font-weight: 500; cursor: pointer; transition: var(--transition); font-family: inherit; }
.tab.active { background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(99,102,241,0.3); }
.tab:hover:not(.active) { background: var(--bg-hover); color: var(--text-primary); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Stat cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex; align-items: flex-start; gap: 14px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.3s;
}
.stat-card:hover { border-color: rgba(99,102,241,0.3); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card:hover::before { opacity: 1; }
.stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 3px; font-weight: 500; }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.stat-trend { font-size: 11px; font-weight: 600; margin-top: 3px; }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.stats-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stats-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ============================================================
   GAME CARDS
   ============================================================ */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.games-list { display: flex; flex-direction: column; gap: 8px; }

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.game-card:hover { border-color: rgba(99,102,241,0.4); transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
.game-card-cover {
  aspect-ratio: 3/4;
  width: 100%; position: relative; overflow: hidden;
  background: var(--bg-tertiary);
}
.game-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.game-card:hover .game-card-cover img { transform: scale(1.05); }
.game-card-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  color: var(--text-muted);
  font-size: 14px; gap: 8px; padding: 12px; text-align: center;
}
.game-card-cover-placeholder i { font-size: 36px; opacity: 0.4; }
.game-card-cover-placeholder span { font-size: 11px; font-weight: 600; opacity: 0.7; word-break: break-word; }
.game-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 50%);
  opacity: 0; transition: opacity 0.3s;
  display: flex; align-items: flex-end; padding: 10px;
}
.game-card:hover .game-card-overlay { opacity: 1; }
.game-card-overlay-actions { display: flex; gap: 6px; }
.game-card-info { padding: 10px 12px; }
.game-card-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.game-card-hours { font-size: 11px; color: var(--text-muted); }
.game-card-rating { font-size: 12px; font-weight: 700; color: var(--yellow); display: flex; align-items: center; gap: 3px; }
.game-card-favorite { position: absolute; top: 8px; right: 8px; color: var(--pink); font-size: 14px; z-index: 2; }

/* Game List View */
.game-list-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  cursor: pointer; transition: var(--transition);
}
.game-list-item:hover { border-color: rgba(99,102,241,0.3); background: var(--bg-hover); }
.game-list-cover { width: 48px; height: 64px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--bg-tertiary); }
.game-list-cover-placeholder { width: 48px; height: 64px; border-radius: 8px; flex-shrink: 0; background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 20px; }
.game-list-info { flex: 1; min-width: 0; }
.game-list-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-list-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.game-list-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.status-playing { background: rgba(99,102,241,0.2); color: var(--accent); }
.status-completed { background: rgba(16,185,129,0.2); color: var(--green); }
.status-hundred_percent { background: rgba(245,158,11,0.2); color: var(--yellow); }
.status-backlog { background: rgba(148,163,184,0.15); color: var(--text-secondary); }
.status-abandoned { background: rgba(239,68,68,0.15); color: var(--red); }
.status-paused { background: rgba(249,115,22,0.15); color: var(--orange); }
.status-never_started { background: rgba(100,116,139,0.15); color: var(--text-muted); }
.status-replay { background: rgba(168,85,247,0.2); color: var(--purple); }
.status-wishlist { background: rgba(236,72,153,0.2); color: var(--pink); }

/* Platform icons */
.platform-icon { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; font-size: 12px; }
.platform-steam { background: rgba(27,40,56,0.8); color: #66c0f4; }
.platform-epic { background: rgba(0,0,0,0.6); color: #fff; }
.platform-gog { background: rgba(108,47,168,0.5); color: #9b59b6; }
.platform-xbox { background: rgba(16,124,16,0.3); color: var(--green); }
.platform-ea { background: rgba(255,69,0,0.2); color: var(--orange); }
.platform-ubisoft { background: rgba(0,112,210,0.2); color: #0070d2; }
.platform-battlenet { background: rgba(0,154,228,0.2); color: #009ae4; }
.platform-amazon { background: rgba(255,153,0,0.2); color: var(--yellow); }
.platform-playstation { background: rgba(0,48,135,0.3); color: #0070cc; }
.platform-nintendo { background: rgba(230,0,18,0.2); color: var(--red); }
.platform-other { background: rgba(108,117,125,0.2); color: var(--text-muted); }

/* ============================================================
   RATING SYSTEM
   ============================================================ */
.rating-display { display: flex; align-items: center; gap: 6px; }
.rating-number { font-size: 24px; font-weight: 800; color: var(--yellow); }
.rating-max { font-size: 14px; color: var(--text-muted); }
.star { font-size: 16px; cursor: pointer; transition: var(--transition); display: inline-block; }
.star-filled { color: var(--yellow); text-shadow: 0 0 8px rgba(245,158,11,0.4); }
.star-empty { color: var(--text-muted); }
.star:hover { transform: scale(1.2); }

/* Rating slider */
.rating-slider-container { padding: 8px 0; }
.rating-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: var(--border);
  border-radius: 3px; outline: none; cursor: pointer;
}
.rating-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(99,102,241,0.4);
  border: 2px solid rgba(255,255,255,0.1);
  transition: var(--transition);
}
.rating-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.rating-value-display {
  text-align: center; font-size: 36px; font-weight: 900;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1; margin: 8px 0;
}
.rating-label-row { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); }

/* Rating saved confirmation */
.rating-saved {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--green); font-weight: 600;
  animation: fadeInUp 0.3s ease;
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  padding: 28px; position: relative;
  animation: slideUp 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--shadow-lg);
}
.modal-wide { max-width: 800px; }
.modal-xl { max-width: 1100px; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 4px; border-radius: 6px; transition: var(--transition); }
.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }
.modal-footer { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ============================================================
   TOPBAR SEARCH
   ============================================================ */
.search-box { position: relative; }
.search-input {
  padding: 8px 14px 8px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  width: 220px;
  transition: var(--transition);
  font-family: inherit;
  outline: none;
}
.search-input:focus { width: 280px; border-color: var(--accent); background: var(--bg-input); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.search-input::placeholder { color: var(--text-muted); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; pointer-events: none; }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  background: var(--bg-secondary); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13px; max-width: 360px;
  pointer-events: all;
  animation: slideInRight 0.3s cubic-bezier(0.4,0,0.2,1);
}
@keyframes slideInRight { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
.toast-success { border-color: rgba(16,185,129,0.4); background: rgba(16,185,129,0.1); }
.toast-error { border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.1); }
.toast-warning { border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.1); }
.toast-info { border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.1); }
.toast-icon { font-size: 16px; flex-shrink: 0; }

/* ============================================================
   CHECKBOX & RADIO
   ============================================================ */
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-label input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 180px;
  box-shadow: var(--shadow-lg); z-index: 200;
  overflow: hidden; animation: slideUp 0.15s ease;
}
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: 13px; cursor: pointer; transition: var(--transition); color: var(--text-secondary); border: none; background: none; width: 100%; font-family: inherit; }
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.1); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.6s cubic-bezier(0.4,0,0.2,1); background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.progress-fill.green { background: linear-gradient(90deg, var(--green), #34d399); }
.progress-fill.yellow { background: linear-gradient(90deg, var(--yellow), var(--orange)); }

/* ============================================================
   GAME DETAIL PAGE
   ============================================================ */
.game-banner {
  width: 100%; height: 260px; border-radius: var(--radius-xl);
  object-fit: cover; background: var(--bg-tertiary); margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.game-banner-img { width: 100%; height: 100%; object-fit: cover; }
.game-banner-gradient { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%); }
.game-detail-grid { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
.game-cover-large { width: 200px; aspect-ratio: 3/4; border-radius: var(--radius-lg); overflow: hidden; flex-shrink: 0; position: sticky; top: 24px; box-shadow: var(--shadow-lg); }
.game-cover-large img { width: 100%; height: 100%; object-fit: cover; }
.game-cover-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; background: var(--bg-tertiary); color: var(--text-muted); font-size: 13px; }
.game-info-title { font-size: 28px; font-weight: 900; letter-spacing: -0.5px; }
.game-info-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }

/* ============================================================
   SYNC PROGRESS
   ============================================================ */
.sync-progress-container {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  margin: 12px 0;
}
.sync-status-text { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sync-progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.sync-progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.3s ease; }
.sync-stats { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--text-muted); }

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-hover) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton-card { height: 280px; border-radius: var(--radius-lg); }
.skeleton-line { height: 14px; width: 100%; margin-bottom: 8px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }

/* ============================================================
   CHARTS
   ============================================================ */
.chart-container { position: relative; }
.chart-wrapper { position: relative; height: 300px; }

/* ============================================================
   GENRE BARS (Top Genres)
   ============================================================ */
.genre-bar-item { margin-bottom: 14px; }
.genre-bar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.genre-bar-name { font-size: 13px; font-weight: 600; }
.genre-bar-count { font-size: 12px; color: var(--text-secondary); }
.genre-bar-track { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.genre-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
.genre-bar-meta { display: flex; gap: 12px; margin-top: 3px; font-size: 11px; color: var(--text-muted); }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-header {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 28px;
  display: flex; align-items: center; gap: 24px;
  margin-bottom: 20px; position: relative; overflow: hidden;
}
.profile-header::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--purple));
}
.profile-avatar-container { position: relative; flex-shrink: 0; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
.profile-avatar-placeholder { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--purple)); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; border: 3px solid rgba(99,102,241,0.3); }
.profile-name { font-size: 22px; font-weight: 800; }
.profile-username { font-size: 13px; color: var(--text-secondary); }
.profile-stats-row { display: flex; gap: 20px; margin-top: 8px; }
.profile-stat-item { text-align: center; }
.profile-stat-value { font-size: 18px; font-weight: 800; }
.profile-stat-label { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   INTEGRATIONS
   ============================================================ */
.integration-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
  transition: var(--transition);
}
.integration-card:hover { border-color: rgba(99,102,241,0.3); }
.integration-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.integration-name { font-size: 14px; font-weight: 700; }
.integration-status { font-size: 12px; margin-top: 2px; }
.integration-status.connected { color: var(--green); }
.integration-status.disconnected { color: var(--text-muted); }
.integration-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.integration-actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }

/* Detect launchers panel */
.detect-results { background: var(--bg-tertiary); border-radius: var(--radius); padding: 14px 16px; }
.detect-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.detect-item:last-child { border-bottom: none; }
.detect-found { color: var(--green); }
.detect-not-found { color: var(--text-muted); }

/* ============================================================
   WISHLIST, GOALS, DIARY
   ============================================================ */
.wishlist-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; gap: 14px; transition: var(--transition);
}
.wishlist-card:hover { border-color: rgba(99,102,241,0.3); }
.wishlist-cover { width: 56px; height: 80px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--bg-tertiary); }

.goal-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 20px; }
.goal-title { font-size: 15px; font-weight: 700; }
.goal-meta { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

.session-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; display: flex; align-items: center; gap: 12px; transition: var(--transition); }
.session-item:hover { border-color: rgba(99,102,241,0.3); }

/* ============================================================
   RANKING
   ============================================================ */
.ranking-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 16px;
  transition: var(--transition);
}
.ranking-item:hover { border-color: rgba(99,102,241,0.3); transform: translateX(2px); }
.ranking-pos { font-size: 20px; font-weight: 900; color: var(--text-muted); min-width: 32px; text-align: center; }
.ranking-pos.gold { color: var(--yellow); }
.ranking-pos.silver { color: #94a3b8; }
.ranking-pos.bronze { color: var(--orange); }
.ranking-cover { width: 44px; height: 58px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--bg-tertiary); }
.ranking-name { font-size: 14px; font-weight: 700; flex: 1; }
.ranking-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.ranking-score { font-size: 22px; font-weight: 900; color: var(--yellow); text-align: right; }

/* ============================================================
   FILTERS BAR
   ============================================================ */
.filters-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-glass); color: var(--text-secondary);
  font-size: 12px; font-weight: 500; cursor: pointer; transition: var(--transition);
}
.filter-chip.active { background: rgba(99,102,241,0.2); border-color: var(--accent); color: var(--accent); }
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 64px; opacity: 0.3; margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 300px; margin: 0 auto 20px; }

/* ============================================================
   PAGE HEADERS
   ============================================================ */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   DIVIDERS & SEPARATORS
   ============================================================ */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.section-title { font-size: 13px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ============================================================
   BADGES & PILLS
   ============================================================ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-accent { background: rgba(99,102,241,0.2); color: var(--accent); }
.badge-green { background: rgba(16,185,129,0.2); color: var(--green); }
.badge-yellow { background: rgba(245,158,11,0.2); color: var(--yellow); }
.badge-red { background: rgba(239,68,68,0.2); color: var(--red); }
.badge-muted { background: var(--border); color: var(--text-muted); }

/* ============================================================
   COLORS UTILITIES
   ============================================================ */
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-orange { color: var(--orange); }
.text-purple { color: var(--purple); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.bg-accent { background: var(--accent); }

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 99;
  backdrop-filter: blur(4px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  :root { --sidebar-width: 220px; }
  .stats-grid-4 { grid-template-columns: repeat(3, 1fr); }
  .game-detail-grid { grid-template-columns: 160px 1fr; }
  .game-cover-large { width: 160px; position: static; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0 !important; }
  .hamburger { display: flex; align-items: center; justify-content: center; }
  .topbar { padding: 0 14px; }
  #page-container { padding: 16px; }
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .profile-header { flex-direction: column; text-align: center; }
  .profile-stats-row { justify-content: center; }
  .game-detail-grid { grid-template-columns: 1fr; }
  .game-cover-large { width: 140px; margin: 0 auto; position: static; }
  .search-input { width: 160px; }
  .search-input:focus { width: 200px; }
}

@media (max-width: 600px) {
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid-3 { grid-template-columns: 1fr 1fr; }
  .stats-grid-2 { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .modal { padding: 20px; }
  .login-card { padding: 32px 24px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .filters-bar { gap: 6px; }
  .search-input { width: 120px; }
  .search-input:focus { width: 160px; }
  #page-container { padding: 12px; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
.animate-in { animation: fadeInUp 0.3s ease forwards; }
.animate-in-delay-1 { animation-delay: 0.05s; }
.animate-in-delay-2 { animation-delay: 0.1s; }
.animate-in-delay-3 { animation-delay: 0.15s; }
.animate-in-delay-4 { animation-delay: 0.2s; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.pulse { animation: pulse 2s infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.fa-spin { animation: spin 1s linear infinite; }

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.relative { position: relative; }
.pointer { cursor: pointer; }
