/* tars-theme.css — palette custom "TARS" dark, moderna.
   Override delle CSS custom properties del tema base (:root), non tocca
   selettori/markup: cascata pura, caricato dopo lo stylesheet principale.
   Riapplicabile dopo update via tools/rebrand-control-ui.sh (vedi script). */

html,
html[data-theme-mode=dark],
html[data-theme-mode=light],
:root,
:root[data-theme-mode=dark],
:root[data-theme-mode=light] {
  /* Superfici: nero quasi puro, leggermente blu-freddo per profondità */
  --bg: #0a0b0f;
  --bg-accent: #0e1015;
  --bg-elevated: #14171d;
  --bg-hover: #1a1e26;
  --bg-muted: #1a1e26;
  --bg-content: #0e1015;

  --card: #12141a;
  --card-foreground: #f2f2f4;
  --card-highlight: #ffffff0d;

  --popover: #14171d;
  --popover-foreground: #f2f2f4;

  --panel: #0a0b0f;
  --panel-strong: #14171d;
  --panel-hover: #1a1e26;

  --chrome: #0a0b0ff5;
  --chrome-strong: #0a0b0ffa;

  /* Testo */
  --text: #d6d7dc;
  --text-strong: #f6f6f8;
  --chat-text: #d6d7dc;
  --muted: #8a8d98;
  --muted-strong: #a4a7b2;
  --muted-foreground: #8a8d98;

  /* Bordi */
  --border: #1e222a;
  --border-strong: #2c313c;
  --border-hover: #3d4350;
  --input: #1e222a;

  /* Accento primario: ambra/oro — richiama la linea del monolite TARS */
  --ring: #f5a623;
  --accent: #f5a623;
  --accent-hover: #ffb84d;
  --accent-muted: #f5a623;
  --accent-subtle: #f5a6231a;
  --accent-foreground: #0a0b0f;
  --accent-glow: #f5a62340;

  --selection-bg: #f5a623;
  --selection-fg: #0a0b0f;

  --primary: #f5a623;
  --primary-foreground: #0a0b0f;
  --secondary: #12141a;
  --secondary-foreground: #f2f2f4;

  /* Accento secondario: teal, per contrasto e stati info/collegati */
  --accent-2: #2dd4bf;
  --accent-2-muted: #2dd4bfb3;
  --accent-2-subtle: #2dd4bf1a;

  /* Stati semantici */
  --ok: #34d399;
  --ok-muted: #34d399bf;
  --ok-subtle: #34d39914;
  --destructive: #f87171;
  --destructive-foreground: #0a0b0f;
  --warn: #fbbf24;
  --warn-muted: #fbbf24bf;
  --warn-subtle: #fbbf2414;
  --danger: #f87171;
  --danger-muted: #f87171bf;
  --danger-subtle: #f8717114;
  --info: #60a5fa;

  --focus: #f5a62340;
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 3px color-mix(in srgb, var(--ring) 80%, transparent);
  --focus-glow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ring), 0 0 16px var(--accent-glow);

  --grid-line: #ffffff08;

  --shadow-sm: 0 1px 2px #00000050;
  --shadow-md: 0 4px 16px #00000060;
  --shadow-lg: 0 12px 32px #00000075;
  --shadow-xl: 0 24px 48px #00000090;
  --shadow-glow: 0 0 24px var(--accent-glow);
}

/* Fix leggibilita' bolle messaggio utente con "sender-tint" attivo: la
   regola base calcola lo sfondo con hsl(hue 65% 94%) fisso, ignorando le
   nostre variabili custom. Risultato: testo chiaro (--text) su sfondo quasi
   bianco, quasi illeggibile, sia in data-theme-mode=light che dark. Forziamo
   lo sfondo allo stesso --accent-subtle scuro gia' usato senza sender-tint. */
:root[data-theme-mode=light] .chat-group.user.chat-group--sender-tint .chat-bubble,
:root[data-theme-mode=dark] .chat-group.user.chat-group--sender-tint .chat-bubble,
.chat-group.user.chat-group--sender-tint .chat-bubble {
  --chat-bubble-background: var(--accent-subtle) !important;
  color: var(--text) !important;
}
