/* ═══════════════════════════════════════════════════════════════════
   OPUS 4.8 — Infinite LLM Gateway
   Dark Cinematic SaaS Design System
   ═══════════════════════════════════════════════════════════════════ */

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

:root {
  --bg-void: #050508;
  --bg-base: #0a0a0e;
  --bg-surface: #111116;
  --bg-elevated: #18181e;
  --bg-card: rgba(17, 17, 22, 0.6);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(255, 255, 255, 0.15);

  --text-primary: #f0f0f2;
  --text-secondary: #8a8a98;
  --text-tertiary: #55555e;
  --text-accent: #ffffff;

  --accent-green: #34d399;
  --accent-blue: #60a5fa;
  --accent-purple: #a78bfa;
  --accent-orange: #fb923c;
  --accent-red: #f87171;
  --accent-cyan: #22d3ee;
  --accent-pink: #f472b6;
  --accent-yellow: #fbbf24;

  --glow-green: rgba(52, 211, 153, 0.15);
  --glow-blue: rgba(96, 165, 250, 0.15);
  --glow-purple: rgba(167, 139, 250, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-void);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
code { font-family: var(--font-mono); }

/* ── Ambient Canvas ─────────────────────────────────────────────── */
#ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* ── Film Grain ─────────────────────────────────────────────────── */
.film-grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ── Navbar ─────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 24px;
  height: 64px;
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  background: rgba(5, 5, 8, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-base);
}

.navbar.scrolled {
  background: rgba(5, 5, 8, 0.92);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
}

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

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  transition: color var(--transition-fast);
  position: relative;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-green);
  transition: width var(--transition-base);
}

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

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
}

.status-dot.pulse {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

.status-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 2;
  padding: 160px 24px 100px;
  text-align: center;
}

.hero-inner {
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--accent-green);
  margin-bottom: 32px;
  animation: fadeInDown 0.6s ease-out;
}

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

.hero-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 24px;
  animation: fadeInUp 0.7s ease-out 0.1s both;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.7;
  animation: fadeInUp 0.7s ease-out 0.2s both;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 48px;
  animation: fadeInUp 0.7s ease-out 0.3s both;
}

.hero-stat {
  background: var(--bg-surface);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-stat-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.hero-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  animation: fadeInUp 0.7s ease-out 0.4s both;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-green);
  color: #000;
}

.btn-primary:hover {
  background: #4ade80;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(52, 211, 153, 0.25);
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-accent);
  transform: translateY(-1px);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ── Sections ───────────────────────────────────────────────────── */
.section {
  position: relative;
  z-index: 2;
  padding: 100px 24px;
}

.section-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--accent-green);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
}

.section-desc {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

.section-desc code {
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--accent-green);
}

/* ── Glass Cards ────────────────────────────────────────────────── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
}

.glass-card:hover {
  border-color: var(--border-medium);
  background: rgba(20, 20, 26, 0.7);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon.green { background: rgba(52, 211, 153, 0.1); color: var(--accent-green); }
.card-icon.blue { background: rgba(96, 165, 250, 0.1); color: var(--accent-blue); }
.card-icon.purple { background: rgba(167, 139, 250, 0.1); color: var(--accent-purple); }
.card-icon.orange { background: rgba(251, 146, 60, 0.1); color: var(--accent-orange); }
.card-icon.red { background: rgba(248, 113, 113, 0.1); color: var(--accent-red); }
.card-icon.cyan { background: rgba(34, 211, 238, 0.1); color: var(--accent-cyan); }
.card-icon.pink { background: rgba(244, 114, 182, 0.1); color: var(--accent-pink); }

.card-title {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}

.card-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
}

.card-badge.live {
  background: rgba(52, 211, 153, 0.1);
  color: var(--accent-green);
  animation: pulse-opacity 2s ease-in-out infinite;
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.card-footer-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mini-stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.mini-stat-value {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mini-stat-value.green { color: var(--accent-green); }
.mini-stat-value.red { color: var(--accent-red); }
.mini-stat-value.yellow { color: var(--accent-yellow); }

/* ── Dashboard Grid ─────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card-span-2 { grid-column: span 2; }
.card-span-full { grid-column: 1 / -1; }

/* ── Request Chart ──────────────────────────────────────────────── */
.chart-container {
  height: 160px;
  position: relative;
}

#requestCanvas {
  width: 100%;
  height: 100%;
}

/* ── Success Donut ──────────────────────────────────────────────── */
.donut-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.donut {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-bg {
  fill: none;
  stroke: rgba(255,255,255,0.04);
  stroke-width: 8;
}

.donut-fill {
  fill: none;
  stroke: var(--accent-blue);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.donut-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.donut-value {
  font-size: 24px;
  font-weight: 800;
}

.donut-unit {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ── Pool Grid ──────────────────────────────────────────────────── */
.pool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.pool-node {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}

.pool-node.active {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--accent-green);
}

.pool-node.cycling {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.25);
  color: var(--accent-yellow);
  animation: cycle-blink 1.5s ease-in-out infinite;
}

@keyframes cycle-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Latency ────────────────────────────────────────────────────── */
.latency-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 12px;
}

.latency-value {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}

.latency-unit {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 600;
}

.latency-bar-container {
  height: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 2px;
  overflow: hidden;
}

.latency-bar {
  height: 100%;
  width: 35%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
  transition: width 1s ease;
}

/* ── Tokens ─────────────────────────────────────────────────────── */
.token-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.token-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
}

.token-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.token-value {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.token-value.green { color: var(--accent-green); }

/* ── Region ─────────────────────────────────────────────────────── */
.region-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 0;
}

.region-flag {
  font-size: 48px;
  line-height: 1;
}

.region-name {
  font-size: 20px;
  font-weight: 700;
}

.region-code {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ── Model Filters ──────────────────────────────────────────────── */
.model-filters {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 100px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-medium);
}

.filter-btn.active {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--accent-green);
}

/* ── Models Grid ────────────────────────────────────────────────── */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.model-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.model-card:hover {
  border-color: var(--border-medium);
  background: rgba(20, 20, 26, 0.7);
  transform: translateY(-2px);
}

.model-card.hidden {
  display: none;
}

.model-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.model-dot.anthropic { background: var(--accent-orange); }
.model-dot.openai { background: var(--accent-green); }
.model-dot.google { background: var(--accent-blue); }
.model-dot.meta { background: var(--accent-purple); }
.model-dot.other { background: var(--accent-cyan); }

.model-info {
  flex: 1;
  min-width: 0;
}

.model-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-provider {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.model-status {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.model-status.online {
  background: rgba(52, 211, 153, 0.1);
  color: var(--accent-green);
}

.model-status.degraded {
  background: rgba(251, 191, 36, 0.1);
  color: var(--accent-yellow);
}

/* ── API Grid ───────────────────────────────────────────────────── */
.api-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.url-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.url-code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-green);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.url-code.mono {
  color: var(--accent-purple);
  font-size: 12px;
  letter-spacing: -0.3px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--border-medium);
}

.copy-btn.copied {
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--accent-green);
}

/* ── Endpoints ──────────────────────────────────────────────────── */
.endpoint-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.endpoint-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
}

.endpoint-method {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.endpoint-method.post {
  background: rgba(52, 211, 153, 0.1);
  color: var(--accent-green);
}

.endpoint-method.get {
  background: rgba(96, 165, 250, 0.1);
  color: var(--accent-blue);
}

.endpoint-item code {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Keygen ─────────────────────────────────────────────────────── */
.keygen-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.keygen-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.keygen-input:focus {
  border-color: var(--accent-green);
}

.keygen-input::placeholder {
  color: var(--text-tertiary);
}

.key-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--accent-yellow);
  font-weight: 500;
  margin-bottom: 12px;
}

.generated-key-container {
  margin-top: 16px;
  animation: fadeInUp 0.3s ease-out;
}

/* ── Keys List ──────────────────────────────────────────────────── */
.keys-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.empty-keys {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 16px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  animation: fadeInUp 0.3s ease-out;
}

.key-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.key-item-label {
  font-size: 13px;
  font-weight: 600;
}

.key-item-preview {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

.key-item-actions {
  display: flex;
  gap: 6px;
}

.key-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
}

.key-delete-btn:hover {
  background: rgba(248, 113, 113, 0.1);
  color: var(--accent-red);
}

/* ── Code Block ─────────────────────────────────────────────────── */
.code-block-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.code-tabs {
  display: flex;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border-subtle);
}

.code-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.code-tab:hover { color: var(--text-secondary); }

.code-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-green);
}

.code-panel {
  display: none;
}

.code-panel.active {
  display: block;
}

.code-block {
  position: relative;
  padding: 20px 24px;
  background: rgba(0,0,0,0.3);
  overflow-x: auto;
}

.code-block pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
}

.code-block code {
  color: var(--text-secondary);
}

.code-comment { color: var(--text-tertiary); }
.code-key { color: var(--accent-cyan); }
.code-string { color: var(--accent-green); }

.code-copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.code-copy-btn:hover {
  background: rgba(255,255,255,0.1);
}

.code-copy-btn.copied {
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--accent-green);
}

/* ── Health Grid ────────────────────────────────────────────────── */
.health-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.health-json-container {
  max-height: 300px;
  overflow-y: auto;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
}

.health-json {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre;
}

/* ── Error Log ──────────────────────────────────────────────────── */
.error-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.error-item {
  padding: 10px 14px;
  background: rgba(248, 113, 113, 0.04);
  border: 1px solid rgba(248, 113, 113, 0.1);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-red);
}

.error-time {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  margin-bottom: 3px;
}

.error-msg {
  font-size: 12px;
  color: var(--accent-red);
  font-weight: 500;
}

.error-detail {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ── Uptime Grid ────────────────────────────────────────────────── */
.uptime-grid {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 3px;
  margin-bottom: 8px;
}

.uptime-bar {
  height: 24px;
  border-radius: 2px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.uptime-bar.up { background: rgba(52, 211, 153, 0.3); }
.uptime-bar.up:hover { background: rgba(52, 211, 153, 0.5); }
.uptime-bar.degraded { background: rgba(251, 191, 36, 0.3); }
.uptime-bar.down { background: rgba(248, 113, 113, 0.3); }

/* ── Footer ─────────────────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 2;
  padding: 32px 24px;
  border-top: 1px solid var(--border-subtle);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: 16px;
}

.footer-right {
  display: flex;
  gap: 24px;
}

.footer-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ── Scroll Reveal ──────────────────────────────────────────────── */
.glass-card,
.model-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out, border-color var(--transition-base), background var(--transition-base);
}

.glass-card.visible,
.model-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-span-2 { grid-column: span 2; }
  .health-grid { grid-template-columns: 1fr; }
  .api-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero { padding: 120px 16px 60px; }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .card-span-2 { grid-column: span 1; }
  .card-span-full { grid-column: span 1; }
  .hero-actions { flex-direction: column; align-items: center; }
  .section { padding: 60px 16px; }
  .uptime-grid { grid-template-columns: repeat(15, 1fr); }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
  .footer-copy { margin-left: 0; display: block; margin-top: 4px; }
  .footer-right { flex-direction: column; align-items: center; gap: 8px; }
  .models-grid { grid-template-columns: 1fr; }
}
