/*
 * Legacy renderer compatibility variables.
 *
 * These variables are intentionally kept as a migration bridge for legacy
 * renderer styles.
 *
 * Do not add new product code that depends on this file.
 * Prefer `@cherrystudio/ui/styles/theme.css` contract variables and Tailwind
 * semantic utilities instead.
 *
 * TODO(v2-ui): Delete entries from this file after the corresponding renderer
 * surfaces stop using the old variable names.
 */

:root {
  --color-text-1: var(--color-foreground);
  --color-text-2: var(--color-foreground-secondary);
  --color-text-3: var(--color-foreground-muted);
  --color-text: var(--color-text-1);
  --color-text-secondary: var(--color-text-2);
  --color-text-soft: var(--color-text-2);
  --color-text-light: var(--color-foreground);

  --color-background-soft: color-mix(in srgb, var(--color-background) 96%, var(--color-foreground) 4%);
  --color-background-mute: color-mix(in srgb, var(--color-background) 92%, var(--color-foreground) 8%);
  --color-background-opacity: color-mix(in srgb, var(--color-background) 88%, transparent);

  --color-border-soft: color-mix(in srgb, var(--color-border) 60%, transparent);
  --color-border-mute: color-mix(in srgb, var(--color-border) 30%, transparent);

  --color-error: var(--color-error-base);
  --color-link: #1677ff;
  --color-primary-bg: var(--color-primary-soft);
  --color-fill-secondary: var(--color-background-soft);
  --color-fill-2: var(--color-background-soft);
  --color-bg-base: var(--color-background);
  --color-bg-1: var(--color-background-soft);

  --color-code-background: #e3e3e3;
  --color-inline-code-background: rgba(0, 0, 0, 0.06);
  --color-inline-code-text: rgb(218, 97, 92);

  --color-hover: var(--color-background-mute);
  --color-active: var(--color-background-soft);
  --color-frame-border: #ddd;
  --color-group-background: var(--color-background-soft);

  --color-reference: #cfe1ff;
  --color-reference-text: #000000;
  --color-reference-background: #f1f7ff;

  --color-list-item: #fff;
  --color-list-item-hover: #fafafa;
  --color-highlight: initial;
  --color-background-highlight: rgba(255, 255, 0, 0.5);
  --color-background-highlight-accent: rgba(255, 150, 50, 0.5);

  --navbar-background-mac: rgba(255, 255, 255, 0.55);
  --navbar-background: rgb(244, 244, 244);
  --modal-background: var(--color-card);

  --chat-background: transparent;
  --chat-background-user: rgba(0, 0, 0, 0.045);
  --chat-background-assistant: transparent;
  --chat-text-user: var(--color-text);

  --list-item-border-radius: 10px;

  --color-gray-1: #8e8e93;
  --color-gray-2: #aeaeb2;
  --color-gray-3: #c7c7cc;
  --color-icon-white: var(--color-black);
  --color-primary-1: var(--color-brand-50);
  --color-primary-6: var(--color-primary);
  --color-status-success: var(--color-success);
  --color-status-error: var(--color-error);
  --color-status-warning: var(--color-warning);
}

.dark {
  --color-code-background: #323232;
  --color-inline-code-background: #323232;
  --color-inline-code-text: rgb(218, 97, 92);

  --color-hover: color-mix(in srgb, var(--color-background) 82%, var(--color-foreground) 18%);
  --color-active: color-mix(in srgb, var(--color-background) 74%, var(--color-foreground) 26%);
  --color-frame-border: #333;
  --color-reference: #404040;
  --color-reference-text: #ffffff;
  --color-reference-background: #0b0e12;
  --color-list-item: rgba(255, 255, 255, 0.1);
  --color-list-item-hover: rgba(255, 255, 255, 0.05);
  --color-highlight: rgba(0, 0, 0, 1);
  --color-background-highlight: rgba(255, 255, 0, 0.9);
  --color-background-highlight-accent: rgba(255, 150, 50, 0.9);
  --navbar-background-mac: rgba(20, 20, 20, 0.55);
  --navbar-background: #1f1f1f;
  --modal-background: #111111;
  --chat-background-user: rgba(255, 255, 255, 0.08);
  --chat-text-user: var(--color-black);
  --color-gray-1: #515c67;
  --color-gray-2: #414853;
  --color-gray-3: #32363f;
  --color-icon-white: var(--color-white);
  --color-link: #338cff;
}
