/* ═══════════════════════════════════════════════════════════════════════════
   RetroSpec - Premium Anime-inspired Design
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ── CSS Variables ─────────────────────────────────────────────────────────── */
:root {
  /* Colors - Light Theme */
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-surface: #f5f5f5;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --border-light: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.12);
  --text-primary: #111111;
  --text-secondary: #666666;
  --text-muted: #999999;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-rgb: 139, 92, 246;
  --accent-secondary: #ec4899;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  
  /* Transitions */
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.16);
  --shadow-glow: 0 0 40px rgba(var(--accent-rgb), 0.3);
  
  /* Layout */
  --navbar-height: 64px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
  --border-radius-full: 9999px;
}

/* ── Dark Theme ─────────────────────────────────────────────────────────────── */
[data-theme=dark] {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-surface: #1a1a25;
  --bg-glass: rgba(18, 18, 26, 0.9);
  --border-light: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-muted: #606060;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* ── Cyberpunk Theme ────────────────────────────────────────────────────────── */
[data-theme=cyberpunk] {
  --bg-primary: #0d0015;
  --bg-secondary: #1a0025;
  --bg-surface: #250035;
  --accent: #00ff41;
  --accent-rgb: 0, 255, 65;
  --accent-secondary: #ff00ff;
  --text-primary: #00ff41;
  --text-secondary: #00cc33;
  --border-light: rgba(0, 255, 65, 0.15);
  --border-medium: rgba(0, 255, 65, 0.3);
  --shadow-glow: 0 0 40px rgba(0, 255, 65, 0.4);
}

/* ── Reset & Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

::selection {
  background: rgba(var(--accent-rgb), 0.2);
  color: var(--text-primary);
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.5);
}

/* ── Particles Container ────────────────────────────────────────────────────── */
.particles-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
}

/* ── Typography ─────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}

a:hover {
  color: var(--accent);
}

/* ── Navigation ─────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: all 0.3s var(--ease-out);
}

.navbar.scrolled {
  background: var(--bg-primary);
  box-shadow: var(--shadow-md);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-logo svg {
  width: 32px;
  height: 32px;
}

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

.nav-logo:hover svg rect {
  fill: var(--accent);
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
}

.nav-link {
  position: relative;
  padding: var(--space-sm) 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s var(--ease-out);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  border-radius: 1px;
  transition: width 0.3s var(--ease-out);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.nav-btn:hover {
  background: var(--bg-surface);
  border-color: var(--border-medium);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.nav-btn:active {
  transform: translateY(0) scale(0.95);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-sm);
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.3s var(--ease-out);
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-lg);
  z-index: 999;
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s var(--ease-out);
}

.mobile-menu.active {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

.mobile-menu-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.mobile-menu-content .nav-link {
  font-size: 1.1rem;
  padding: var(--space-sm) 0;
  text-align: center;
}

/* ── Hero Section ───────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--navbar-height) + var(--space-3xl)) var(--space-lg) var(--space-3xl);
  text-align: center;
  overflow: hidden;
}

.hero-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.hero-shape-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.4), transparent 70%);
  top: 5%;
  left: -15%;
  animation: float1 20s ease-in-out infinite;
}

.hero-shape-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.3), transparent 70%);
  bottom: 10%;
  right: -10%;
  animation: float2 18s ease-in-out infinite;
}

.hero-shape-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25), transparent 70%);
  top: 40%;
  right: 15%;
  animation: float3 22s ease-in-out infinite;
}

.hero-shape-4 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.2), transparent 70%);
  bottom: 30%;
  left: 20%;
  animation: float1 25s ease-in-out infinite reverse;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(50px, -30px) scale(1.1); }
  66% { transform: translate(-30px, 50px) scale(0.9); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-40px, 40px) rotate(180deg); }
}

@keyframes float3 {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-60px) scale(1.2); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: var(--border-radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: var(--space-lg);
}

.hero-badge .pulse {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.4); }
  50% { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0); }
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-lg);
  line-height: 1.1;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary), #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--border-radius-lg);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  border: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s var(--ease-out);
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.4);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
  background: var(--bg-primary);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-sm {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.85rem;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: none;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.icon-btn:hover {
  background: var(--accent);
  color: white;
}

/* Stats */
.hero-stats {
  display: flex;
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
  flex-wrap: wrap;
  justify-content: center;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-xs);
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: 0.8rem;
  animation: bounce 2s ease-in-out infinite;
}

.scroll-arrow {
  opacity: 0.5;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ── Sections ───────────────────────────────────────────────────────────────── */
.section {
  padding: var(--space-3xl) var(--space-xl);
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-header h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Models Section ─────────────────────────────────────────────────────────── */
.models-toolbar {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: var(--space-md) var(--space-md) var(--space-md) calc(var(--space-md) + 30px);
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--border-radius-lg);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s var(--ease-out);
}

.search-box input:focus {
  background: var(--bg-primary);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.filter-pills {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.filter-pill {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface);
  border: none;
  border-radius: var(--border-radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.filter-pill:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.filter-pill.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.3);
}

.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--border-radius-md);
}

.view-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.view-btn:hover {
  color: var(--text-primary);
}

.view-btn.active {
  background: var(--bg-primary);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* Models Grid */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg);
}

.models-grid.list-view {
  grid-template-columns: 1fr;
}

.models-grid.list-view .model-card {
  flex-direction: row;
  align-items: center;
}

.models-grid.list-view .model-card-header {
  margin-bottom: 0;
  margin-right: var(--space-lg);
}

.models-grid.list-view .model-card-description {
  -webkit-line-clamp: 1;
}

.models-grid.list-view .model-card-footer {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.model-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-xl);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.model-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

.model-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.model-card:hover::before {
  transform: scaleX(1);
}

.model-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.model-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--bg-surface);
  transition: all 0.3s var(--ease-out);
}

.model-card:hover .model-card-icon {
  transform: scale(1.1) rotate(-5deg);
  background: rgba(var(--accent-rgb), 0.1);
}

.model-card-title {
  flex: 1;
}

.model-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.model-card-provider {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.model-card-badges {
  display: flex;
  gap: var(--space-xs);
}

.badge {
  padding: 4px 10px;
  border-radius: var(--border-radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-tier1 {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.badge-tier2 {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.badge-tier3 {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.badge-category {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

.model-card-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.model-card-meta {
  display: flex;
  gap: var(--space-md);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.model-card-caps {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.cap-badge {
  padding: 4px 8px;
  background: var(--bg-surface);
  border-radius: var(--border-radius-sm);
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.model-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.quality-indicator {
  display: flex;
  gap: 4px;
}

.quality-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-surface);
  transition: all 0.2s var(--ease-out);
}

.quality-dot.filled {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
}

.model-card:hover .quality-dot.filled {
  transform: scale(1.2);
}

.speed-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

mark {
  background: rgba(var(--accent-rgb), 0.2);
  color: var(--accent);
  padding: 0 2px;
  border-radius: 2px;
}

/* Loading More */
.loading-more {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  color: var(--text-muted);
}

.loading-more.active {
  display: flex;
}

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

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

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
  text-align: center;
}

/* ── Chat Section ───────────────────────────────────────────────────────────── */
.chat-section {
  min-height: 100vh;
  padding-top: var(--navbar-height);
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}

.chat-container {
  flex: 1;
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: var(--space-lg);
  gap: var(--space-lg);
}

.chat-sidebar {
  width: 300px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.chat-sidebar-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
}

.chat-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  margin-bottom: 2px;
}

.chat-item:hover {
  background: var(--bg-surface);
}

.chat-item.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
}

.chat-item-icon {
  font-size: 1rem;
}

.chat-item-title {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item.active .chat-item-title {
  color: rgba(255, 255, 255, 0.9);
}

.delete-conversation {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--border-radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s var(--ease-out);
  font-size: 1rem;
}

.chat-item:hover .delete-conversation {
  opacity: 1;
}

.delete-conversation:hover {
  background: var(--error);
  color: white;
}

.chat-sidebar-footer {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.chat-sidebar-footer .btn {
  flex: 1;
}

.chat-main {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.model-selector {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.model-selector label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.model-select {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--border-radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: all 0.2s var(--ease-out);
}

.model-select:hover {
  border-color: var(--accent);
}

.model-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.chat-header-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Parameters Panel */
.parameters-panel {
  display: none;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
}

.parameters-panel.active {
  display: block;
  animation: slideDown 0.3s var(--ease-out);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.param-row {
  display: flex;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.param-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
  min-width: 200px;
}

.param-group label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 120px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.param-group input[type='range'] {
  flex: 1;
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.param-group input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out);
}

.param-group input[type='range']::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.param-value {
  width: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-align: right;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
}

.welcome-message {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl);
}

.welcome-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--accent-rgb), 0.1);
  border-radius: 50%;
  margin-bottom: var(--space-lg);
  color: var(--accent);
}

.welcome-message h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.welcome-message p {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.quick-prompts {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.quick-prompt {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-full);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.quick-prompt:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-2px);
}

/* Messages */
.message {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  animation: messageIn 0.4s var(--ease-out);
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  background: var(--bg-surface);
}

.message.assistant .message-avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: white;
}

.message.user .message-avatar {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.message-content {
  max-width: 70%;
  padding: var(--space-md);
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  font-size: 0.95rem;
  line-height: 1.7;
}

.message.user .message-content {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
}

.message-content pre {
  background: var(--text-primary);
  color: #e5e5e5;
  padding: var(--space-md);
  border-radius: var(--border-radius-md);
  overflow-x: auto;
  margin: var(--space-sm) 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.message-content code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

.message.user .message-content code {
  background: rgba(255, 255, 255, 0.2);
}

.message-content a {
  color: var(--accent);
  text-decoration: underline;
}

.message.user .message-content a {
  color: white;
}

.message-actions {
  display: none;
  position: absolute;
  top: 50%;
  right: var(--space-md);
  transform: translateY(-50%);
}

.message:hover .message-actions {
  display: flex;
  gap: var(--space-xs);
}

.copy-message {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border: none;
  border-radius: var(--border-radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.copy-message:hover {
  background: var(--accent);
  color: white;
}

/* Typing Indicator */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

/* Chat Input */
.chat-input-area {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
}

.chat-input-wrapper {
  display: flex;
  gap: var(--space-md);
  align-items: flex-end;
}

.chat-input-wrapper textarea {
  flex: 1;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--border-radius-lg);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  resize: none;
  outline: none;
  min-height: 50px;
  max-height: 200px;
  transition: all 0.2s var(--ease-out);
}

.chat-input-wrapper textarea:focus {
  background: var(--bg-primary);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.chat-input-wrapper textarea::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: none;
  border-radius: var(--border-radius-lg);
  color: white;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(var(--accent-rgb), 0.4);
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.input-hints {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.input-hints kbd {
  padding: 2px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.char-count {
  font-family: var(--font-mono);
}

/* ── API Section ─────────────────────────────────────────────────────────────── */
.api-section {
  background: var(--bg-secondary);
}

.api-tabs {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.api-tab {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  border: none;
  border-radius: var(--border-radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.api-tab:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.api-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
}

.api-content {
  max-width: 900px;
  margin: 0 auto;
}

.code-examples {
  display: grid;
  gap: var(--space-lg);
}

.code-example {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
}

.code-lang {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.copy-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.code-example pre {
  padding: var(--space-lg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.code-example code {
  font-family: inherit;
}

/* API Features */
.api-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-3xl);
}

.feature-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-xl);
  padding: var(--space-xl);
  text-align: center;
  transition: all 0.3s var(--ease-out);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.feature-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  background: rgba(var(--accent-rgb), 0.1);
  border-radius: 50%;
  color: var(--accent);
  transition: all 0.3s var(--ease-out);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(-5deg);
  background: rgba(var(--accent-rgb), 0.2);
}

.feature-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Status Section ─────────────────────────────────────────────────────────── */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}

.status-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-xl);
  padding: var(--space-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  transition: all 0.3s var(--ease-out);
}

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

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.status-indicator.healthy {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
  animation: statusPulse 2s ease-in-out infinite;
}

.status-indicator.degraded {
  background: var(--warning);
}

.status-indicator.down {
  background: var(--error);
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.1); }
}

.status-info {
  flex: 1;
}

.status-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.status-meta {
  display: flex;
  gap: var(--space-md);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-surface);
  border-radius: 2px;
  margin-top: var(--space-md);
  overflow: hidden;
}

.status-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  border-radius: 2px;
  transition: width 1s var(--ease-out);
}

/* RPM Counter */
.rpm-counter {
  margin-top: var(--space-2xl);
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-xl);
  padding: var(--space-2xl);
  text-align: center;
}

.rpm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: rgba(var(--accent-rgb), 0.1);
  border-radius: 50%;
  margin-bottom: var(--space-md);
  color: var(--accent);
}

.rpm-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rpm-value {
  display: block;
  font-size: 4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: var(--space-sm) 0;
}

/* Status Legend */
.status-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot.healthy { background: var(--success); }
.status-dot.degraded { background: var(--warning); }
.status-dot.down { background: var(--error); }

/* ── Settings Modal ─────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal.active {
  display: flex;
  animation: fadeIn 0.3s var(--ease-out);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-primary);
  border-radius: var(--border-radius-xl);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.3s var(--ease-spring);
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: none;
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.modal-close:hover {
  background: var(--error);
  color: white;
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
}

.settings-group {
  margin-bottom: var(--space-xl);
}

.settings-group:last-child {
  margin-bottom: 0;
}

.settings-group h4 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.theme-option {
  padding: var(--space-md);
  background: var(--bg-surface);
  border: 2px solid transparent;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  text-align: center;
}

.theme-option:hover {
  border-color: var(--border-medium);
}

.theme-option.active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
}

.theme-preview {
  position: relative;
  width: 100%;
  height: 40px;
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--space-sm);
}

.theme-preview.dark {
  background: linear-gradient(135deg, #0a0a0f, #1a1a25);
}

.theme-preview.light {
  background: linear-gradient(135deg, #ffffff, #f5f5f5);
  border: 1px solid var(--border-light);
}

.theme-preview.cyberpunk {
  background: linear-gradient(135deg, #0d0015, #1a0025);
}

.theme-check {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
}

.theme-option.active .theme-check {
  display: block;
}

.theme-option span {
  font-size: 0.85rem;
  font-weight: 500;
}

.toggle-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
}

.toggle-setting span {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-surface);
  border-radius: 28px;
  transition: all 0.3s var(--ease-out);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.3s var(--ease-out);
  box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: white;
}

/* ── Toast Notifications ────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 350px;
  border-left: 4px solid var(--accent);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.info { border-left-color: #3b82f6; }

.toast-icon {
  font-size: 1.3rem;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.toast-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.footer {
  padding: var(--space-2xl) var(--space-xl);
  border-top: 1px solid var(--border-light);
  text-align: center;
}

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

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

.footer-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .navbar {
    padding: 0 var(--space-lg);
  }
  
  .nav-links {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .chat-sidebar {
    display: none;
  }
  
  .models-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .section {
    padding: var(--space-2xl) var(--space-lg);
  }
  
  .hero {
    padding: calc(var(--navbar-height) + var(--space-2xl)) var(--space-lg) var(--space-2xl);
  }
  
  .hero-stats {
    gap: var(--space-xl);
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .models-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-sm);
  }
  
  .models-grid {
    grid-template-columns: 1fr;
  }
  
  .message-content {
    max-width: 85%;
  }
  
  .api-tabs {
    flex-wrap: wrap;
  }
  
  .api-features {
    grid-template-columns: 1fr;
  }
  
  .param-row {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .param-group {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  
  .param-group label {
    width: 100%;
  }
  
  .param-value {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-actions .btn {
    width: 100%;
  }
  
  .chat-container {
    padding: var(--space-sm);
  }
  
  .status-grid {
    grid-template-columns: 1fr;
  }
  
  .rpm-value {
    font-size: 2.5rem;
  }
  
  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
    bottom: var(--space-md);
  }
  
  .toast {
    max-width: none;
  }
}

/* ── Reduced Motion ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}