/**
 * Qvickis Design System (QDS) — Master CSS Tokens & Primitives
 * Architecture: Endorsed Brand (byQvickis + Domain Accents)
 * Aesthetic: Light Precision Terminal
 * Registered Decisions: 2026-10-11 (Ägarbeslut 1: A, 2: A, 3: D)
 */

:root {
  /* ==========================================================================
     1. MASTER BRAND — byQvickis (Royal Purple)
     ========================================================================== */
  --qv-purple-deep: #4c1d95;    /* WCAG AAA on white, link hover, dark accents */
  --qv-purple: #6d28d9;         /* Brand primary, main buttons, active states */
  --qv-purple-accent: #7c3aed;  /* Bright accent, focus rings, highlights */
  --qv-purple-soft: #ede9fe;    /* Badge backgrounds, subtle row selections */
  --qv-purple-glow: rgba(109, 40, 217, 0.15);

  /* ==========================================================================
     2. LIGHT PRECISION CANVAS & SURFACES
     ========================================================================== */
  --qv-bg-canvas: #f8fafc;      /* Clean off-white app background */
  --qv-bg-surface: #ffffff;     /* Card, modal, and panel background */
  --qv-bg-subtle: #f1f5f9;      /* Table headers, neutral hover, inputs */
  --qv-bg-muted: #e2e8f0;       /* Disabled backgrounds */

  /* 1px Surgical Micro-Borders */
  --qv-border: #e2e8f0;         /* Default 1px borders & dividers */
  --qv-border-hover: #cbd5e1;
  --qv-border-active: #7c3aed;

  /* Typography */
  --qv-text-primary: #0f172a;   /* Slate-900: High-contrast numbers & headers */
  --qv-text-secondary: #334155; /* Slate-700: Body prose & labels */
  --qv-text-muted: #64748b;     /* Slate-500: Timestamps, units, metadata */
  --qv-text-inverted: #ffffff;  /* Text on dark/solid buttons */

  --qv-font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --qv-font-mono: 'JetBrains Mono', 'Geist Mono', monospace;

  /* Geometry & Elevation */
  --qv-radius-sm: 4px;
  --qv-radius-md: 8px;
  --qv-radius-lg: 12px;
  --qv-radius-full: 9999px;
  --qv-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --qv-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);

  /* Tabular Figures (Mandatory for scores, odds, stats) */
  --qv-tnum: tabular-nums;

  /* ==========================================================================
     3. DOMAIN ACCENTS (Product Identities under byQvickis)
     ========================================================================== */

  /* Qodellen.se (Trav-AI & Matematisk modell) */
  --qod-indigo: #6366f1;
  --qod-indigo-dark: #4f46e5;
  --qod-indigo-soft: #e0e7ff;
  --qod-amber: #fbbf24;
  --qod-amber-dark: #f59e0b;

  /* Syndiqatet.se (Social travtävling) */
  --synd-turf: #059669;         /* Racing Turf Green */
  --synd-turf-dark: #047857;
  --synd-turf-soft: #d1fae5;
  --synd-gold: #d97706;         /* Svenskt Travguld / Vinnarcirkel */
  --synd-gold-soft: #fef3c7;

  /* Sista Laget (Sport / Survival) */
  --sport-emerald: #10b981;
  --sport-pitch: #064e3b;
  --sport-soft: #ecfdf5;

  /* 3-mans Whist (Kortspel / Protokoll) */
  --card-felt: #1e293b;
  --card-suit-red: #dc2626;
  --card-suit-black: #0f172a;

  /* ==========================================================================
     4. OFFICIELLA SVENSKA VOJLOCKSFÄRGER (Trav 1-12)
     ========================================================================== */
  --vojlock-1-bg: #facc15; --vojlock-1-text: #0f172a; /* 1: Gul */
  --vojlock-2-bg: #2563eb; --vojlock-2-text: #ffffff; /* 2: Blå */
  --vojlock-3-bg: #dc2626; --vojlock-3-text: #ffffff; /* 3: Röd */
  --vojlock-4-bg: #16a34a; --vojlock-4-text: #ffffff; /* 4: Grön */
  --vojlock-5-bg: #ffffff; --vojlock-5-text: #0f172a; /* 5: Vit (kräver border) */
  --vojlock-6-bg: #0f172a; --vojlock-6-text: #ffffff; /* 6: Svart */
  --vojlock-7-bg: #92400e; --vojlock-7-text: #ffffff; /* 7: Ljusbrun */
  --vojlock-8-bg: #9333ea; --vojlock-8-text: #ffffff; /* 8: Lila */
  --vojlock-9-bg: #86efac; --vojlock-9-text: #0f172a; /* 9: Ljusgrön */
  --vojlock-10-bg: #f472b6; --vojlock-10-text: #0f172a; /* 10: Rosa */
  --vojlock-11-bg: #ea580c; --vojlock-11-text: #ffffff; /* 11: Orange */
  --vojlock-12-bg: #1e3a8a; --vojlock-12-text: #ffffff; /* 12: Mörkblå */
}

/* ==========================================================================
   5. MIKRO-INTERAKTIONER & ANIMAIONER (The Qvickis Feel)
   ========================================================================== */

/* 1. Taktil knappfjädring (Mechanical Snap) */
.qv-btn-tactile,
.qv-card-tactile {
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.12s ease;
}

.qv-btn-tactile:active,
.qv-card-tactile:active {
  transform: translateY(1.5px);
}

/* 2. Sifferdisciplin */
.qv-tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* 3. Siffer-blixt vid live-uppdatering */
@keyframes qv-tick-up {
  0%   { background-color: rgba(16, 185, 129, 0.25); color: #047857; }
  100% { background-color: transparent; }
}

@keyframes qv-tick-down {
  0%   { background-color: rgba(217, 119, 6, 0.25); color: #b45309; }
  100% { background-color: transparent; }
}

.qv-tick-positive { animation: qv-tick-up 1.2s ease-out; }
.qv-tick-negative { animation: qv-tick-down 1.2s ease-out; }

/* 4. Spelvärdes-aurora (Edge Glow) */
@keyframes qv-edge-pulse {
  0%, 100% {
    box-shadow: 0 0 0 1px #d97706, 0 0 8px rgba(217, 119, 6, 0.2);
  }
  50% {
    box-shadow: 0 0 0 1.5px #f59e0b, 0 0 14px rgba(245, 158, 11, 0.4);
  }
}

.qv-edge-glow {
  animation: qv-edge-pulse 2.5s infinite ease-in-out;
}

/* 5. Live Heartbeat (Pulserande synk-indikator) */
@keyframes qv-heartbeat {
  0%   { transform: scale(0.95); opacity: 0.8; }
  50%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.qv-live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--synd-turf);
  animation: qv-heartbeat 2s infinite ease-in-out;
}
