/* ═══════════════════════════════════════════════════════════════════════════
   LAYER 1: DESIGN TOKENS & BASE RESETS (`styles/tokens.css`)
   AtletIQ + Webxtek Chatbot Dark Glassmorphism & X Timeline Design System
   Rule 1: Only CSS Custom Properties & Global Resets live here.
   Rule 4: 5-Tier Z-Index Scale & 100% Solid Floating Surfaces (`--bg-surface-solid`).
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* — Typography — */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* — Deep Obsidian & Liquid Glass Surfaces (AtletIQ + Webxtek Dark Theme) — */
  --bg-root: #080a0f;
  --bg-primary: #080a0f;
  --bg-secondary: #0d111a;
  --bg-surface: rgba(18, 24, 38, 0.72);
  --bg-surface-solid: #141926;
  --bg-surface-hover: rgba(28, 36, 56, 0.82);
  --bg-elevated: rgba(26, 34, 52, 0.78);
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-glass: rgba(11, 15, 25, 0.78);
  --bg-overlay: rgba(4, 6, 12, 0.78);

  /* — Borders & Highlights — */
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --border-focus: rgba(29, 155, 240, 0.55);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.14);

  /* — Text Hierarchy — */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* — Brand & Telemetry Accents — */
  --accent: #1d9bf0;
  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;
  --accent-hover: #1a8cd8;
  --accent-soft: rgba(29, 155, 240, 0.14);
  --accent-brand-gradient: linear-gradient(135deg, #1d9bf0 0%, #06b6d4 50%, #10b981 100%);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --purple: #8b5cf6;

  /* — Spacing & Radius Scale — */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* — Shadows & Blur — */
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --liquid-blur: blur(24px) saturate(180%);

  /* — 5-Tier Z-Index Scale (Rule 4) — */
  --z-base: 1;
  --z-toolbar: 20;
  --z-sticky: 100;
  --z-bottom-nav: 200;
  --z-dropdown: 99999;
  --z-overlay: 999990;
  --z-modal: 999999;

  /* — Safe Area Insets — */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

html, body {
  background-color: var(--bg-root);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(29, 155, 240, 0.08), transparent 38%),
    radial-gradient(circle at 88% 10%, rgba(16, 185, 129, 0.06), transparent 36%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button, a, [role="button"], [role="tab"] {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

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

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

@keyframes agxScaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
