/*
 * DashCaddy Theme Definitions
 * ============================
 *
 * To add a new theme:
 *   1. Add a :root.mytheme { ... } block below with all the color variables
 *   2. Add 'mytheme' to the THEMES array in js/theme.js
 *   3. (Optional) Add per-theme body background and button hover overrides
 *
 * Variables reference:
 *   --bg           Page background color
 *   --fg           Primary text color
 *   --muted        Secondary/dimmed text
 *   --fg-muted     Very secondary text (lighter than --muted)
 *   --card-base    Card background color
 *   --card-bg      Alias for card-base (used in inline styles)
 *   --border       Border color for cards, buttons, inputs
 *   --hover        Hover background for interactive elements
 *   --card-hover   Card hover background
 *   --base         Subdued background for tags/badges
 *   --ok-bg/fg     Success state background/text (e.g. "ON" badges)
 *   --bad-bg/fg    Error state background/text (e.g. "OFF" badges)
 *   --dot-ok/bad   Status dot colors (green/red indicators)
 *   --success      Green for success states (buttons, labels)
 *   --error        Red for error states
 *   --warning      Orange for warning states
 *   --accent       Brand accent (links, highlights, hover states)
 *   --accent-strong  Stronger accent variant (active states)
 */

/* ===== Dark (default) ===== */
:root {
  --accent: #8FD6FF;
  --accent-strong: #1F7BFF;

  --bg: #0b0f1a;
  --fg: #e8ecf5;
  --muted: #9aa6bf;
  --fg-muted: #6b7a94;
  --card-base: #121826;
  --card-bg: #121826;
  --border: #263552;
  --hover: #1a2235;
  --card-hover: #161e2e;
  --base: #151c2b;

  --ok-bg: #0c2430;
  --ok-fg: #7ef2ff;
  --bad-bg: #2a121a;
  --bad-fg: #ff9aa3;
  --dot-ok: #35d1ff;
  --dot-bad: #ff5f7a;
  --uptime: #35d1ff;

  --success: #4caf50;
  --error: #e74c3c;
  --warning: #f39c12;

  --brand-min: 100px;
  --brand-max: 320px;
  --brand-h: clamp(var(--brand-min), 22vw, var(--brand-max));
  --radius: 12px;
}

/* ===== Light ===== */
:root.light {
  --bg: #f6f7fb;
  --fg: #0f1115;
  --muted: #5f6b7a;
  --fg-muted: #8993a4;
  --card-base: #ffffff;
  --card-bg: #ffffff;
  --border: #e2e7ef;
  --hover: #eef1f6;
  --card-hover: #f5f6fa;
  --base: #ebeef3;

  --ok-bg: #eafff1;
  --ok-fg: #0a7c3a;
  --bad-bg: #ffefef;
  --bad-fg: #b00020;
  --dot-ok: #0fb15a;
  --dot-bad: #d93b3b;
  --uptime: #0fb15a;

  --success: #0a7c3a;
  --error: #b00020;
  --warning: #d68a00;

  --accent: #4a90d9;
  --accent-strong: #2563eb;
}

/* ===== Blue (deep royal) ===== */
:root.blue {
  --bg: #1908AC;
  --fg: #e8f1ff;
  --muted: #d6e2ff;
  --fg-muted: #9eafdb;
  --card-base: #0d1533;
  --card-bg: #0d1533;
  --border: #1c2d6a;
  --hover: #141f4a;
  --card-hover: #111a3e;
  --base: #0f1840;

  --ok-bg: rgba(255, 255, 255, .14);
  --ok-fg: #edffff;
  --bad-bg: rgba(0, 0, 0, .18);
  --bad-fg: #ffb3c0;
  --dot-ok: #c7e5ff;
  --dot-bad: #ffd6dc;
  --uptime: #7ec8ff;

  --success: #7ec8ff;
  --error: #ffb3c0;
  --warning: #ffd080;

  --accent: #9cd4ff;
  --accent-strong: #6fb2ff;
}

/* ===== Black (black / white / red accent) ===== */
:root.black {
  --bg: #0e0e0e;
  --fg: #f5f5f5;
  --muted: #999999;
  --fg-muted: #666666;
  --card-base: #1a1a1a;
  --card-bg: #1a1a1a;
  --border: #2e2e2e;
  --hover: #242424;
  --card-hover: #202020;
  --base: #161616;

  --ok-bg: #0f2a12;
  --ok-fg: #66ff7a;
  --bad-bg: #2a0f0f;
  --bad-fg: #ff6b6b;
  --dot-ok: #4caf50;
  --dot-bad: #ff4444;
  --uptime: #e0e0e0;

  --success: #4caf50;
  --error: #ff4444;
  --warning: #ff9800;

  --accent: #E63946;
  --accent-strong: #C62828;
}

/* ===== Nord ===== */
:root.nord {
  --bg: #2e3440;
  --fg: #eceff4;
  --muted: #81a1c1;
  --fg-muted: #6882a0;
  --card-base: #3b4252;
  --card-bg: #3b4252;
  --border: #4c566a;
  --hover: #434c5e;
  --card-hover: #3f4858;
  --base: #353c4a;

  --ok-bg: #2d4f3e;
  --ok-fg: #a3be8c;
  --bad-bg: #4a2c2a;
  --bad-fg: #bf616a;
  --dot-ok: #a3be8c;
  --dot-bad: #bf616a;
  --uptime: #a3be8c;

  --success: #a3be8c;
  --error: #bf616a;
  --warning: #ebcb8b;

  --accent: #88c0d0;
  --accent-strong: #5e81ac;
}

/* ===== Dracula ===== */
:root.dracula {
  --bg: #282a36;
  --fg: #f8f8f2;
  --muted: #6272a4;
  --fg-muted: #515d85;
  --card-base: #44475a;
  --card-bg: #44475a;
  --border: #6272a4;
  --hover: #4e5170;
  --card-hover: #494c63;
  --base: #363848;

  --ok-bg: #1e3a2e;
  --ok-fg: #50fa7b;
  --bad-bg: #3d1a1a;
  --bad-fg: #ff5555;
  --dot-ok: #50fa7b;
  --dot-bad: #ff5555;
  --uptime: #50fa7b;

  --success: #50fa7b;
  --error: #ff5555;
  --warning: #f1fa8c;

  --accent: #bd93f9;
  --accent-strong: #8be9fd;
}

/* ===== Solarized Dark ===== */
:root.solarized-dark {
  --bg: #002b36;
  --fg: #839496;
  --muted: #586e75;
  --fg-muted: #4a5f65;
  --card-base: #073642;
  --card-bg: #073642;
  --border: #586e75;
  --hover: #0d4050;
  --card-hover: #0a3a48;
  --base: #053340;

  --ok-bg: #0d3d2c;
  --ok-fg: #859900;
  --bad-bg: #3d1a1a;
  --bad-fg: #dc322f;
  --dot-ok: #859900;
  --dot-bad: #dc322f;
  --uptime: #b5bd68;

  --success: #859900;
  --error: #dc322f;
  --warning: #b58900;

  --accent: #268bd2;
  --accent-strong: #2aa198;
}

/* ===== Solarized Light ===== */
:root.solarized-light {
  --bg: #fdf6e3;
  --fg: #657b83;
  --muted: #93a1a1;
  --fg-muted: #adb8b8;
  --card-base: #eee8d5;
  --card-bg: #eee8d5;
  --border: #93a1a1;
  --hover: #e6dfcb;
  --card-hover: #eae3cf;
  --base: #e8e1cd;

  --ok-bg: #e8f5e8;
  --ok-fg: #859900;
  --bad-bg: #fdf2f2;
  --bad-fg: #dc322f;
  --dot-ok: #859900;
  --dot-bad: #dc322f;
  --uptime: #859900;

  --success: #859900;
  --error: #dc322f;
  --warning: #b58900;

  --accent: #268bd2;
  --accent-strong: #2aa198;
}

/* ===== Taxi (black & yellow) ===== */
:root.taxi {
  --bg: #f3d321;
  --fg: #0e0e00;
  --muted: #4a4a10;
  --fg-muted: #6b6b30;
  --card-base: #ffd700;
  --card-bg: #ffd700;
  --border: #b8a840;
  --hover: #ffe84d;
  --card-hover: #ffe033;
  --base: #f0d000;

  --ok-bg: #d4ffd9;
  --ok-fg: #0f2a0f;
  --bad-bg: #ffd4d4;
  --bad-fg: #2a0f0f;
  --dot-ok: #4caf50;
  --dot-bad: #ff4444;
  --uptime: #0e0e00;

  --success: #2e7d32;
  --error: #c62828;
  --warning: #e65100;

  --accent: #7a4a00;
  --accent-strong: #5c3800;
}

/* ===== Ocean ===== */
:root.ocean {
  --bg: #2060b0;
  --fg: #faf5eb;
  --muted: #dcd2c0;
  --fg-muted: #b0a890;
  --card-base: #7a94ed;
  --card-bg: #7a94ed;
  --border: #deb67a;
  --hover: #8aa0f0;
  --card-hover: #8298e8;
  --base: #6888e0;

  --ok-bg: #4f5bb0;
  --ok-fg: #c7d7eb;
  --bad-bg: #f41a3a;
  --bad-fg: #6a1818;
  --dot-ok: #30a050;
  --dot-bad: #d04040;
  --uptime: #2d32f2;

  --success: #30a050;
  --error: #d04040;
  --warning: #e6a030;

  --accent: #1860a0;
  --accent-strong: #104080;
}

/* ===== Theme transitions ===== */
:root {
  transition:
    --bg 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --fg 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --muted 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --fg-muted 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --card-base 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --border 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --hover 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --card-hover 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --base 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --ok-bg 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --ok-fg 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --bad-bg 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --bad-fg 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --dot-ok 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --dot-bad 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --uptime 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --success 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --error 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --warning 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --accent 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    --accent-strong 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body, .card, button, .badge, .logo-wrap, .weather-modal-content {
  transition:
    background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Per-theme body backgrounds ===== */
:root.light body {
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(90, 120, 255, .1), transparent 60%),
    radial-gradient(1000px 700px at 110% 10%, rgba(255, 120, 200, .08), transparent 55%),
    var(--bg);
}

:root.blue body {
  background:
    radial-gradient(1200px 820px at 8% -10%, rgba(255, 255, 255, 0.06), transparent 60%),
    radial-gradient(1000px 700px at 110% 0%, rgba(0, 0, 0, 0.12), transparent 55%),
    radial-gradient(900px 650px at 50% 120%, rgba(15, 0, 60, 0.12), transparent 60%),
    #1908AC;
}

:root.black body {
  background:
    radial-gradient(1200px 820px at 8% -10%, rgba(230, 57, 70, .06), transparent 60%),
    radial-gradient(1000px 700px at 110% 0%, rgba(198, 40, 40, .04), transparent 55%),
    radial-gradient(900px 650px at 50% 120%, rgba(230, 57, 70, .03), transparent 60%),
    #0e0e0e;
}

:root.nord body {
  background:
    radial-gradient(1200px 900px at 8% -12%, rgba(136, 192, 208, .12), transparent 60%),
    radial-gradient(1000px 700px at 110% -10%, rgba(94, 129, 172, .10), transparent 55%),
    var(--bg);
}

:root.dracula body {
  background:
    radial-gradient(1200px 900px at 8% -12%, rgba(189, 147, 249, .10), transparent 60%),
    radial-gradient(1000px 700px at 110% -10%, rgba(139, 233, 253, .08), transparent 55%),
    var(--bg);
}

:root.solarized-dark body {
  background:
    radial-gradient(1200px 900px at 8% -12%, rgba(38, 139, 210, .10), transparent 60%),
    radial-gradient(1000px 700px at 110% -10%, rgba(42, 161, 152, .08), transparent 55%),
    var(--bg);
}

:root.solarized-light body {
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(38, 139, 210, .08), transparent 60%),
    radial-gradient(1000px 700px at 110% 10%, rgba(42, 161, 152, .06), transparent 55%),
    var(--bg);
}

:root.taxi body {
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(14, 14, 0, .08), transparent 60%),
    radial-gradient(1000px 700px at 110% 10%, rgba(184, 168, 64, .12), transparent 55%),
    var(--bg);
}

:root.ocean body {
  background:
    radial-gradient(1200px 900px at 8% -12%, rgba(122, 148, 237, .18), transparent 60%),
    radial-gradient(1000px 700px at 110% -10%, rgba(222, 182, 122, .10), transparent 55%),
    radial-gradient(900px 650px at 50% 120%, rgba(16, 64, 128, .15), transparent 60%),
    var(--bg);
}

/* ===== Per-theme button hover overrides ===== */
:root.light button:hover {
  background: color-mix(in srgb, var(--accent-strong) 12%, white 88%);
  border-color: rgba(0, 0, 0, .15);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .08), inset 0 1px 0 rgba(255, 255, 255, .8);
}

:root.blue button:hover {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  border-color: rgba(255, 255, 255, .35);
  box-shadow: 0 0 6px rgba(255, 255, 255, .22), inset 0 1px 0 rgba(255, 255, 255, .18);
}

:root.black button:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

:root.nord button:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

:root.dracula button:hover {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

:root.solarized-dark button:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

:root.solarized-light button:hover {
  background: color-mix(in srgb, var(--accent-strong) 12%, white 88%);
  border-color: rgba(0, 0, 0, .12);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
}

:root.taxi button:hover {
  background: color-mix(in srgb, var(--accent-strong) 15%, var(--card-base) 85%);
  border-color: rgba(0, 0, 0, .2);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .1);
}

:root.ocean button:hover {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: color-mix(in srgb, var(--border) 60%, white 40%);
  box-shadow: 0 0 6px rgba(255, 255, 255, .12);
}

