/**
 * GAIAI V3 — Core Design Tokens & Theme System
 * Standard: Zinc-950 Dark Theme (Linear / Vercel Enterprise Standard)
 */

:root {
  /* Surface & Backgrounds */
  --bg-canvas: #09090b;        /* Zinc 950 */
  --bg-surface: #0f0f13;       /* Surface Elevation 1 */
  --bg-card: #141418;          /* Surface Elevation 2 */
  --bg-card-hover: #1a1a22;    /* Card Hover */
  --bg-subtle: #22222a;        /* Subtle Container */
  --bg-subtle-hover: #2c2c36;  /* Subtle Hover */
  --bg-glass: rgba(15, 15, 19, 0.75);

  /* Borders & Dividers (Zinc-800 High Density Standard) */
  --border-zinc800: #27272a;
  --border-subtle: #27272a;
  --border-muted: #3f3f46;
  --border-medium: #52525b;
  --border-focus: #6366f1;
  --border-active: #818cf8;

  /* Typography Colors */
  --text-white: #ffffff;
  --text-primary: #f4f4f5;     /* Zinc 100 */
  --text-secondary: #a1a1aa;   /* Zinc 400 */
  --text-muted: #71717a;       /* Zinc 500 */
  --text-dim: #52525b;         /* Zinc 600 */

  /* Accents & Signals */
  --accent-primary: #6366f1;       /* Indigo 500 */
  --accent-primary-hover: #4f46e5; /* Indigo 600 */
  --accent-primary-glow: rgba(99, 102, 241, 0.22);
  --accent-primary-subtle: rgba(99, 102, 241, 0.12);

  --accent-purple: #8b5cf6;        /* Violet 500 */
  --accent-purple-glow: rgba(139, 92, 246, 0.22);
  --accent-purple-subtle: rgba(139, 92, 246, 0.12);

  --accent-success: #10b981;       /* Emerald 500 */
  --accent-success-hover: #059669;
  --accent-success-glow: rgba(16, 185, 129, 0.22);
  --accent-success-subtle: rgba(16, 185, 129, 0.12);

  --accent-warning: #f59e0b;       /* Amber 500 */
  --accent-warning-glow: rgba(245, 158, 11, 0.22);
  --accent-warning-subtle: rgba(245, 158, 11, 0.12);

  --accent-danger: #ef4444;        /* Rose 500 */
  --accent-danger-hover: #dc2626;
  --accent-danger-glow: rgba(239, 68, 68, 0.22);
  --accent-danger-subtle: rgba(239, 68, 68, 0.12);

  --accent-cyan: #06b6d4;          /* Cyan 500 */
  --accent-cyan-glow: rgba(6, 182, 212, 0.22);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, monospace;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --trans-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --trans-normal: 240ms cubic-bezier(0.16, 1, 0.3, 1);
  --trans-smooth: 350ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows & Glows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.45);
  --shadow-card: 0 4px 16px -2px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--border-subtle);
  --shadow-card-hover: 0 8px 24px -4px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-muted);
  --shadow-dock: 0 16px 40px -8px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
  --shadow-drawer: -12px 0 40px -8px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--border-subtle);
  --shadow-glow-indigo: 0 0 24px -4px rgba(99, 102, 241, 0.35);
  --shadow-glow-emerald: 0 0 24px -4px rgba(16, 185, 129, 0.35);
  --shadow-glow-amber: 0 0 24px -4px rgba(245, 158, 11, 0.35);
}

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

html, body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum", "cv02", "cv03", "cv04", "cv11";
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: auto;
  -webkit-user-select: auto;
}

/* High-Contrast Modern Selection Highlight */
::selection {
  background: rgba(99, 102, 241, 0.45);
  color: #ffffff;
}

::-moz-selection {
  background: rgba(99, 102, 241, 0.45);
  color: #ffffff;
}

/* Custom Minimalist Dark Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  transition: background var(--trans-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Form Controls & Inputs */
input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
  border: none;
  background: transparent;
}

button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans-fast);
  white-space: nowrap;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Typography Utilities */
.font-mono {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums !important;
}

.text-white { color: var(--text-white) !important; }
.text-zinc-200 { color: #e4e4e7 !important; }
.text-zinc-300 { color: #d4d4d8 !important; }
.text-zinc-400 { color: #a1a1aa !important; }
.text-zinc-500 { color: #71717a !important; }
.text-zinc-600 { color: #52525b !important; }

.text-indigo-400 { color: #818cf8 !important; }
.text-purple-400 { color: #c084fc !important; }
.text-blue-400 { color: #60a5fa !important; }
.text-emerald-400 { color: #34d399 !important; }
.text-amber-400 { color: #fbbf24 !important; }
.text-red-400 { color: #f87171 !important; }

/* Micro-interaction & Keyframe Animations */
@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-amber {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes pulse-ring {
  0% { transform: scale(0.85); opacity: 0.9; }
  50% { transform: scale(1.15); opacity: 0.3; }
  100% { transform: scale(0.85); opacity: 0.9; }
}

@keyframes flash-fade {
  0% { opacity: 0.8; }
  100% { opacity: 0; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

.animate-spin {
  animation: spin 1s linear infinite;
}

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