:root {
  /* --- Core Colors (Default Dark Mode) --- */
  --color-bg: #212121; /* ChatGPT-like dark grey */
  --color-bg-alt: #171717; /* Sidebar / Inputs */

  --color-text: #ececec;
  --color-text-muted: #9ca3af;

  --color-border: #424242;

  --color-primary: #ffffff; /* Buttons/Accents */
  --color-primary-fg: #171717; /* Text on primary buttons */

  --color-accent: #60a5fa; /* Links/Highlights */
  --color-accent-rgb: 96, 165, 250;

  --color-msg-user: rgba(37, 99, 235, 0.25);
  --bg-code-block: #1e1e1e; /* VS Code Dark BG */
  --text-code-block: #d4d4d4;

  /* Syntax Highlighting (VS Code Dark+ Style) */
  --token-keyword: #569cd6; /* Blue */
  --token-function: #dcdcaa; /* Yellow */
  --token-string: #ce9178; /* Orange */
  --token-constant: #b5cea8; /* Light Green */
  --token-type: #4ec9b0; /* Teal */
  --token-tag: #569cd6; /* Blue */
  --token-comment: #6a9955; /* Green */
  --token-symbol: #d7ba7d;
  --token-builtin: #4ec9b0;
}

/* --- Light Mode Theme --- */
body.light {
  --color-bg: #ffffff;
  --color-bg-alt: #f9fafb;

  --color-text: #111827; /* Almost black */
  --color-text-muted: #6b7280;

  --color-border: #e5e7eb;

  --color-primary: #000000; /* Minimalist black primary */
  --color-primary-fg: #ffffff;

  --color-accent: #2563eb;
  --color-accent-rgb: 37, 99, 235;

  --color-msg-user: rgba(37, 99, 235, 0.15);
  --bg-code-block: #f6f8fa;
  --text-code-block: #24292e;

  /* Syntax Highlighting (GitHub Light Style) */
  --token-keyword: #d73a49; /* Red */
  --token-function: #6f42c1; /* Purple */
  --token-string: #032f62; /* Dark Blue */
  --token-constant: #005cc5; /* Blue */
  --token-type: #d73a49; /* Red */
  --token-tag: #22863a; /* Green */
  --token-comment: #6a737d; /* Grey */
  --token-symbol: #005cc5;
  --token-builtin: #6f42c1;
}

/* --- Tokyo Night --- */
body.theme-tokyo-night {
  --color-bg: #1a1b26;
  --color-bg-alt: #16161e;

  --color-text: #c0caf5;
  --color-text-muted: #565f89;
  --color-border: #414868;

  --color-primary: #7aa2f7; /* Tokyo Blue */
  --color-primary-fg: #15161e;

  --color-accent: #bb9af7; /* Tokyo Purple */
  --color-accent-rgb: 187, 154, 247;

  --color-msg-user: #7aa2f740;

  --bg-code-block: #1a1b26;
  --text-code-block: #a9b1d6;

  /* Syntax Highlighting (Official Palette) */
  --token-keyword: #bb9af7; /* Purple */
  --token-function: #7aa2f7; /* Blue */
  --token-string: #9ece6a; /* Green */
  --token-constant: #ff9e64; /* Orange */
  --token-type: #2ac3de; /* Cyan */
  --token-tag: #f7768e; /* Red */
  --token-comment: #565f89; /* Muted Blue */
  --token-symbol: #7dcfff;
  --token-builtin: #0db9d7;
}

/* --- Catppuccin Mocha (Darker) --- */
body.theme-catppuccin-mocha {
  --color-bg: #1e1e2e;
  --color-bg-alt: #181825;

  --color-text: #cdd6f4;
  --color-text-muted: #6c7086;
  --color-border: #313244;

  --color-primary: #cba6f7; /* Mauve */
  --color-primary-fg: #1e1e2e;

  --color-accent: #89b4fa; /* Blue */
  --color-accent-rgb: 137, 180, 250;

  --color-msg-user: #cba6f740;

  --bg-code-block: #1e1e2e;
  --text-code-block: #cdd6f4;

  /* Syntax Highlighting (Official Palette) */
  --token-keyword: #cba6f7; /* Mauve */
  --token-function: #89b4fa; /* Blue */
  --token-string: #a6e3a1; /* Green */
  --token-constant: #fab387; /* Peach */
  --token-type: #f9e2af; /* Yellow */
  --token-tag: #f38ba8; /* Red */
  --token-comment: #6c7086; /* Overlay0 */
  --token-symbol: #f5c2e7; /* Pink */
  --token-builtin: #89dceb; /* Sky */
}

/* --- Catppuccin Frappé (Softer) --- */
body.theme-catppuccin-frappe {
  --color-bg: #303446;
  --color-bg-alt: #292c3c;

  --color-text: #c6d0f5;
  --color-text-muted: #737994;
  --color-border: #414559;

  --color-primary: #ca9ee6; /* Lilac */
  --color-primary-fg: #303446;

  --color-accent: #8caaee; /* Blue */
  --color-accent-rgb: 140, 170, 238;

  --color-msg-user: #ca9ee640;

  --bg-code-block: #292c3c;
  --text-code-block: #c6d0f5;

  /* Syntax Highlighting */
  --token-keyword: #ca9ee6;
  --token-function: #8caaee;
  --token-string: #a6d189;
  --token-constant: #ef9f76;
  --token-type: #e5c890;
  --token-tag: #ea999c;
  --token-comment: #737994;
  --token-symbol: #f4b8e4;
  --token-builtin: #81c8be;
}

/* --- Nord (Arctic) --- */
body.theme-nord {
  --color-bg: #2e3440;
  --color-bg-alt: #242933;

  --color-text: #d8dee9;
  --color-text-muted: #6d7b96; /* Nord3/4 mix */
  --color-border: #4c566a;

  --color-primary: #88c0d0; /* Frost Blue */
  --color-primary-fg: #2e3440;

  --color-accent: #81a1c1;
  --color-accent-rgb: 129, 161, 193;

  --color-msg-user: #88c0d040;

  --bg-code-block: #2e3440;
  --text-code-block: #d8dee9;

  /* Syntax Highlighting */
  --token-keyword: #81a1c1; /* Frost Blue */
  --token-function: #88c0d0; /* Cyan */
  --token-string: #a3be8c; /* Green */
  --token-constant: #b48ead; /* Purple */
  --token-type: #8fbcbb; /* Teal */
  --token-tag: #81a1c1;
  --token-comment: #4c566a; /* Polar Night */
  --token-symbol: #ebcb8b; /* Yellow */
  --token-builtin: #88c0d0;
}

/* --- Monokai Pro --- */
body.theme-monokai {
  --color-bg: #2d2a2e;
  --color-bg-alt: #221f22;

  --color-text: #fcfcfa;
  --color-text-muted: #939293;
  --color-border: #5b595c;

  --color-primary: #ffd866; /* Yellow */
  --color-primary-fg: #2d2a2e;

  --color-accent: #ff6188; /* Red/Pink */
  --color-accent-rgb: 255, 97, 136;

  --color-msg-user: #ff618833;

  --bg-code-block: #221f22;
  --text-code-block: #fcfcfa;

  /* Syntax Highlighting */
  --token-keyword: #ff6188; /* Red/Pink */
  --token-function: #a9dc76; /* Green */
  --token-string: #ffd866; /* Yellow */
  --token-constant: #ab9df2; /* Purple */
  --token-type: #78dce8; /* Cyan */
  --token-tag: #ff6188;
  --token-comment: #727072;
  --token-symbol: #fc9867; /* Orange */
  --token-builtin: #a9dc76;
}

/* --- Everforest (Earthy/Terminal) --- */
body.theme-everforest {
  --color-bg: #2b3339; /* Dark Forest */
  --color-bg-alt: #323c41;

  --color-text: #d3c6aa;
  --color-text-muted: #9da9a0;
  --color-border: #4a555b;

  --color-primary: #a7c080; /* Soft Green */
  --color-primary-fg: #2b3339;

  --color-accent: #7fbbb3; /* Cyan/Blue */
  --color-accent-rgb: 127, 187, 179;

  --color-msg-user: #a7c08033;

  --bg-code-block: #2d353b;
  --text-code-block: #d3c6aa;

  /* Syntax Highlighting */
  --token-keyword: #e67e80; /* Red */
  --token-function: #a7c080; /* Green */
  --token-string: #a7c080; /* Green */
  --token-constant: #d699b6; /* Purple */
  --token-type: #dbbc7f; /* Yellow */
  --token-tag: #e67e80;
  --token-comment: #859289; /* Grey Green */
  --token-symbol: #7fbbb3; /* Cyan */
  --token-builtin: #83c092;
}

/* --- Gruvbox Dark --- */
body.theme-gruvbox-dark {
  --color-bg: #282828;
  --color-bg-alt: #3c3836;

  --color-text: #ebdbb2;
  --color-text-muted: #a89984;
  --color-border: #504945;

  --color-primary: #fabd2f; /* Yellow */
  --color-primary-fg: #282828;

  --color-accent: #fe8019; /* Orange */
  --color-accent-rgb: 254, 128, 25;

  --color-msg-user: #fabd2f33;

  --bg-code-block: #282828;
  --text-code-block: #ebdbb2;

  /* Syntax Highlighting */
  --token-keyword: #fb4934; /* Red */
  --token-function: #fabd2f; /* Yellow */
  --token-string: #b8bb26; /* Green */
  --token-constant: #d3869b; /* Purple */
  --token-type: #8ec07c; /* Aqua */
  --token-tag: #fb4934;
  --token-comment: #928374; /* Grey */
  --token-symbol: #fe8019; /* Orange */
  --token-builtin: #fabd2f;
}

/* --- Solarized Light --- */
body.theme-solarized-light {
  --color-bg: #fdf6e3; /* Base3 */
  --color-bg-alt: #eee8d5; /* Base2 */

  --color-text: #586e75; /* Base01 */
  --color-text-muted: #93a1a1; /* Base1 */
  --color-border: #eee8d5;

  --color-primary: #2aa198; /* Cyan */
  --color-primary-fg: #fdf6e3;

  --color-accent: #268bd2; /* Blue */
  --color-accent-rgb: 38, 139, 210;

  --color-msg-user: #2aa19826;

  --bg-code-block: #fdf6e3; /* Solarized Base3 */
  --text-code-block: #657b83;

  /* Syntax Highlighting */
  --token-keyword: #859900; /* Green */
  --token-function: #268bd2; /* Blue */
  --token-string: #2aa198; /* Cyan */
  --token-constant: #d33682; /* Magenta */
  --token-type: #b58900; /* Yellow */
  --token-tag: #268bd2;
  --token-comment: #93a1a1; /* Base1 */
  --token-symbol: #cb4b16; /* Orange */
  --token-builtin: #6c71c4; /* Violet */
}
