/*
 * GameAtlas - IGDB-inspired Premium CSS Design System
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* Dark Theme Variables (Default) */
:root, html.dark {
  --bg-main: #0b1326;
  --bg-surface: #131b2e;
  --bg-surface-hover: #1e293b;
  --bg-card: #171f33;
  --bg-input: #131b2e;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-color-hover: rgba(124, 58, 237, 0.5);
  
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --brand-primary: #7214ff;
  --brand-secondary: #00e676;
  --brand-gradient: linear-gradient(135deg, #7214ff 0%, #a259ff 100%);
  --castyr-gradient: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
  --rating-high: #10b981;
  --rating-mid: #f59e0b;
  --rating-low: #ef4444;

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 15px rgba(114, 20, 255, 0.4);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --scrollbar-thumb: linear-gradient(180deg, #a259ff, #7214ff);
}

/* Light Theme Variables */
html.light {
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  
  --border-color: #e2e8f0;
  --border-color-hover: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
  --scrollbar-thumb: linear-gradient(180deg, #a259ff, #7c3aed);
}

/* Global Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: none;
  outline: none;
  color: inherit;
}

/* Theme Utilities */
.theme-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.theme-card:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.theme-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.theme-input {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.theme-input:focus-within,
.theme-input:focus {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px rgba(124, 58, 237, 0.5);
}

.theme-text-title {
  color: var(--text-primary);
}

.theme-text-muted {
  color: var(--text-secondary);
}

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.4) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb);
}

/* Gentle entrance for page content so navigating doesn't feel like a hard cut */
@keyframes content-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  main {
    animation: content-fade-in 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  }
}
