/* ─────────────────────────────────────────────────────────────────────────
   Media Verse — Colors & Type
   Derived from tts/frontend/src/app.css (Tailwind v4 @theme tokens).
   Light-first, with dark-theme overrides under [data-theme="dark"].
   ───────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Geist";
  src: url("./fonts/GeistRegular.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("./fonts/GeistMonoRegular.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* DM Sans + DM Mono are loaded from Google Fonts in each HTML file:
   https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300..700&family=DM+Mono:wght@400;500&display=swap
*/

:root {
  color-scheme: light;

  /* ── Type ── */
  --font-sans: "DM Sans", "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "DM Mono", "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ── Brand / base color ── */
  --mv-violet-50:  #F5F1FF;
  --mv-violet-100: #EDE9FE;
  --mv-violet-200: #DDD4FE;
  --mv-violet-300: #C4B5FD;
  --mv-violet-400: #A78BFA;
  --mv-violet-500: #8B5CF6; /* primary */
  --mv-violet-600: #7C3AED;
  --mv-violet-700: #6D28D9;
  --mv-violet-800: #5B21B6;
  --mv-violet-900: #4C1D95;

  /* Voice palette — from VoiceCard.svelte VOICE_COLORS */
  --voice-1: #6C5CE7;
  --voice-2: #00B894;
  --voice-3: #E17055;
  --voice-4: #FDCB6E;
  --voice-5: #A29BFE;
  --voice-6: #0984E3;
  --voice-7: #E84393;
  --voice-8: #00CEC9;

  /* ── Semantic / surface tokens (light) ── */
  --background:           #F8F7FA;
  --foreground:           #1F2937;

  --card:                 #ffffff;
  --card-foreground:      #1F2937;

  --popover:              #ffffff;
  --popover-foreground:   #1F2937;

  --primary:              #8B5CF6;
  --primary-foreground:   #ffffff;

  --secondary:            #F3F4F6;
  --secondary-foreground: #374151;

  --muted:                #F3F4F6;
  --muted-foreground:     #6B7280;

  --accent:               #EDE9FE;
  --accent-foreground:    #4C1D95;

  --destructive:            #EF4444;
  --destructive-foreground: #ffffff;

  --border:         rgba(0, 0, 0, 0.12);
  --border-subtle:  rgba(0, 0, 0, 0.08);
  --input:          rgba(0, 0, 0, 0.06);
  --ring:           #8B5CF6;
  --hover-border:   rgba(0, 0, 0, 0.15);

  --sidebar:                    #ffffff;
  --sidebar-foreground:         #374151;
  --sidebar-border:             rgba(0, 0, 0, 0.07);
  --sidebar-accent:             rgba(139, 92, 246, 0.08);
  --sidebar-accent-foreground:  #1F2937;
  --sidebar-primary:            #8B5CF6;

  /* Status */
  --status-active:  #22C55E;
  --status-busy:    #EAB308;
  --status-offline: #EF4444;
  --status-queued:  #3B82F6;

  /* Charts */
  --chart-1: #8B5CF6;
  --chart-2: #00B894;
  --chart-3: #FDCB6E;
  --chart-4: #3B82F6;
  --chart-5: #E84393;

  /* Radii */
  --radius-sm: 0.375rem;   /* 6px  */
  --radius-md: 0.5rem;     /* 8px  */
  --radius-lg: 0.625rem;   /* 10px */
  --radius-xl: 0.875rem;   /* 14px — cards, textarea, voice cards */
  --radius-2xl: 1rem;      /* 16px — primary textareas */
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md:      0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg:      0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-bar-top: 0 -2px 16px rgba(0, 0, 0, 0.04);
  --shadow-primary-soft: 0 4px 20px rgba(139, 92, 246, 0.25);
  --shadow-primary-hover: 0 6px 28px rgba(139, 92, 246, 0.35);
  --shadow-primary-glow: 0 0 20px -5px rgba(139, 92, 246, 0.30);

  /* Spacing scale (multiples of 4) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Control heights */
  --h-sm: 32px;
  --h-md: 36px;
  --h-lg: 40px;

  /* Scrollbar */
  --scrollbar-thumb:       rgba(0, 0, 0, 0.10);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 0.18);

  /* Gradients */
  --grad-primary:   linear-gradient(135deg, #8B5CF6, #7C3AED);
  --grad-primary-h: linear-gradient(90deg,  #8B5CF6, #A78BFA);
  --grad-shimmer:   linear-gradient(90deg,  #8B5CF6, #6D28D9, #8B5CF6);
}

[data-theme="dark"] {
  color-scheme: dark;

  --background:           #0B0B10;
  --foreground:           #F5F5F7;

  --card:                 #15151B;
  --card-foreground:      #F5F5F7;

  --popover:              #1A1A22;
  --popover-foreground:   #F5F5F7;

  --primary:              #8B5CF6;
  --primary-foreground:   #ffffff;

  --secondary:            #1F1F28;
  --secondary-foreground: #E5E5EA;

  --muted:                #1F1F28;
  --muted-foreground:     #9CA3AF;

  --accent:               rgba(139, 92, 246, 0.18);
  --accent-foreground:    #E9D5FF;

  --destructive:            #F87171;
  --destructive-foreground: #ffffff;

  --border:        rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --input:         rgba(255, 255, 255, 0.04);
  --ring:          #A78BFA;
  --hover-border:  rgba(255, 255, 255, 0.12);

  --sidebar:                   #0F0F15;
  --sidebar-foreground:        #C7C7D1;
  --sidebar-border:            rgba(255, 255, 255, 0.06);
  --sidebar-accent:            rgba(139, 92, 246, 0.16);
  --sidebar-accent-foreground: #F5F5F7;

  --status-active:  #22C55E;
  --status-busy:    #EAB308;
  --status-offline: #F87171;
  --status-queued:  #60A5FA;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);
  --shadow-bar-top: 0 -2px 16px rgba(0, 0, 0, 0.4);

  --scrollbar-thumb:       rgba(255, 255, 255, 0.10);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.20);
}

/* ─────────────────────────────────────────────────────────────────────────
   Base element rules
   ───────────────────────────────────────────────────────────────────────── */
html, body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

/* Type scale (semantic) — sizes and weights follow the product's in-use values */
h1, .mv-h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--foreground);
}
h2, .mv-h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--foreground);
}
h3, .mv-h3 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--foreground);
}
.mv-eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.mv-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--foreground);
}
.mv-body {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--foreground);
}
.mv-small {
  font-size: 13px;
  color: var(--muted-foreground);
}
.mv-tiny {
  font-size: 11px;
  color: var(--muted-foreground);
  font-weight: 500;
}
.mv-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

/* Primary button recipe */
.mv-btn-primary {
  background: var(--grad-primary);
  color: #fff;
  font: 650 14.5px/1 var(--font-sans);
  letter-spacing: -0.01em;
  border: 0;
  border-radius: var(--radius-xl);
  padding: 16px 24px;
  box-shadow: var(--shadow-primary-soft);
  cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.1s ease;
}
.mv-btn-primary:hover { box-shadow: var(--shadow-primary-hover); }
.mv-btn-primary:active { transform: translateY(1px); }
.mv-btn-primary:disabled {
  background: var(--muted);
  color: var(--muted-foreground);
  box-shadow: none;
  cursor: not-allowed;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* Slider thumb (range) */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: 0 1px 4px rgba(139, 92, 246, 0.3);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: 0 1px 4px rgba(139, 92, 246, 0.3);
  cursor: pointer;
}

/* Keyframes the product uses */
@keyframes mv-shimmer   { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes mv-spin      { to { transform: rotate(360deg); } }
@keyframes mv-pulse-ring { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.8); opacity: 0; } }
