/* 
   NEW THEME SYSTEM - CENTRALIZED & TOKEN BASED 
   Replaces old inline theme logic.
*/

:root,
[data-theme="dark-modern"] {
    /* DARK MODERN (DEFAULT) */
    --bg-primary: #050505;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);

    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;
    --text-muted: #555555;

    --accent-primary: #00ff88;
    --accent-primary-hover: #00cc6a;
    --accent-secondary: #00ddee;
    --accent-glow: rgba(0, 255, 136, 0.15);
    --accent-glow-strong: rgba(0, 255, 136, 0.4);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(5, 5, 5, 0.8);

    --success: #00ff88;
    --danger: #ff4444;
    --warning: #ffc107;
    --info: #00ddee;
}

[data-theme="dark-ocean"] {
    --bg-primary: #020610;
    --bg-secondary: #08101f;
    --bg-tertiary: #0f1a30;
    --bg-card: rgba(100, 149, 237, 0.05);
    --bg-card-hover: rgba(100, 149, 237, 0.1);

    --text-primary: #e0f2ff;
    --text-secondary: #90aabf;
    --text-tertiary: #5e7080;
    --text-muted: #405060;

    --accent-primary: #00b4d8;
    --accent-primary-hover: #0096c7;
    --accent-secondary: #48cae4;
    --accent-glow: rgba(0, 180, 216, 0.15);
    --accent-glow-strong: rgba(0, 180, 216, 0.4);

    --border-color: rgba(100, 149, 237, 0.1);
    --border-color-hover: rgba(100, 149, 237, 0.2);
    --glass-border: rgba(100, 149, 237, 0.05);
    --glass-bg: rgba(2, 6, 16, 0.85);

    --success: #00b4d8;
    /* Themed success? Keeping semantic colors usually better but adapting to theme mood */
}

[data-theme="dark-royal"] {
    --bg-primary: #120215;
    --bg-secondary: #1e0525;
    --bg-tertiary: #2d0a35;
    --bg-card: rgba(200, 100, 255, 0.04);
    --bg-card-hover: rgba(200, 100, 255, 0.08);

    --text-primary: #f8eaff;
    --text-secondary: #c0a0d0;
    --text-tertiary: #806090;
    --text-muted: #604070;

    --accent-primary: #9d4edd;
    --accent-primary-hover: #7b2cbf;
    --accent-secondary: #c77dff;
    --accent-glow: rgba(157, 78, 221, 0.2);
    --accent-glow-strong: rgba(157, 78, 221, 0.5);

    --border-color: rgba(200, 100, 255, 0.1);
    --border-color-hover: rgba(200, 100, 255, 0.2);
    --glass-border: rgba(200, 100, 255, 0.05);
    --glass-bg: rgba(18, 2, 21, 0.85);
}

[data-theme="dark-forest"] {
    --bg-primary: #020f05;
    --bg-secondary: #081a0e;
    --bg-tertiary: #0f2b18;
    --bg-card: rgba(80, 200, 120, 0.04);
    --bg-card-hover: rgba(80, 200, 120, 0.08);

    --text-primary: #e6ffe6;
    --text-secondary: #90bfa0;
    --text-tertiary: #608068;
    --text-muted: #405545;

    --accent-primary: #43aa8b;
    --accent-primary-hover: #2d7a60;
    --accent-secondary: #90be6d;
    --accent-glow: rgba(67, 170, 139, 0.2);
    --accent-glow-strong: rgba(67, 170, 139, 0.5);

    --border-color: rgba(80, 200, 120, 0.1);
    --border-color-hover: rgba(80, 200, 120, 0.2);
    --glass-border: rgba(80, 200, 120, 0.05);
    --glass-bg: rgba(2, 15, 5, 0.85);
}

[data-theme="dark-crimson"] {
    --bg-primary: #120202;
    --bg-secondary: #1e0505;
    --bg-tertiary: #2f0a0a;
    --bg-card: rgba(255, 50, 50, 0.04);
    --bg-card-hover: rgba(255, 50, 50, 0.08);

    --text-primary: #ffe6e6;
    --text-secondary: #d09090;
    --text-tertiary: #906060;
    --text-muted: #604040;

    --accent-primary: #e63946;
    --accent-primary-hover: #b81d2a;
    --accent-secondary: #ff6b6b;
    --accent-glow: rgba(230, 57, 70, 0.25);
    --accent-glow-strong: rgba(230, 57, 70, 0.5);

    --border-color: rgba(255, 50, 50, 0.12);
    --border-color-hover: rgba(255, 50, 50, 0.25);
    --glass-border: rgba(255, 50, 50, 0.06);
    --glass-bg: rgba(18, 2, 2, 0.85);
}

/* --- LIGHT THEMES --- */

[data-theme="light-clean"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f3f5;

    --text-primary: #212529;
    --text-secondary: #495057;
    --text-tertiary: #868e96;
    --text-muted: #6c757d;

    --accent-primary: #228be6;
    /* Blue 6 */
    --accent-primary-hover: #1c7ed6;
    --accent-secondary: #4dabf7;
    --accent-glow: rgba(34, 139, 230, 0.2);
    --accent-glow-strong: rgba(34, 139, 230, 0.4);

    --border-color: #dee2e6;
    --border-color-hover: #ced4da;
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.85);

    /* Light Theme Specific Overrides if needed for components that expect dark bg */
}

[data-theme="light-sky"] {
    --bg-primary: #f0f9ff;
    --bg-secondary: #e0f2fe;
    --bg-tertiary: #bae6fd;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f9ff;

    --text-primary: #0c4a6e;
    --text-secondary: #0369a1;
    --text-tertiary: #38bdf8;
    --text-muted: #0284c7;

    --accent-primary: #0284c7;
    --accent-primary-hover: #0369a1;
    --accent-secondary: #38bdf8;
    --accent-glow: rgba(2, 132, 199, 0.2);
    --accent-glow-strong: rgba(2, 132, 199, 0.4);

    --border-color: #bae6fd;
    --border-color-hover: #7dd3fc;
    --glass-border: rgba(56, 189, 248, 0.2);
    --glass-bg: rgba(240, 249, 255, 0.9);
}

[data-theme="light-soft"] {
    --bg-primary: #fff5f5;
    --bg-secondary: #ffe3e3;
    --bg-tertiary: #ffc9c9;
    --bg-card: #ffffff;
    --bg-card-hover: #fff0f0;

    --text-primary: #c92a2a;
    --text-secondary: #e03131;
    --text-tertiary: #ff6b6b;
    --text-muted: #e03131;

    --accent-primary: #fa5252;
    --accent-primary-hover: #e03131;
    --accent-secondary: #ff8787;
    --accent-glow: rgba(250, 82, 82, 0.2);
    --accent-glow-strong: rgba(250, 82, 82, 0.4);

    --border-color: #ffc9c9;
    --border-color-hover: #ffa8a8;
    --glass-border: rgba(255, 135, 135, 0.2);
    --glass-bg: rgba(255, 245, 245, 0.9);
}

[data-theme="light-nature"] {
    --bg-primary: #f0fff4;
    --bg-secondary: #dcfce7;
    --bg-tertiary: #bbf7d0;
    --bg-card: #ffffff;
    --bg-card-hover: #f0fff4;

    --text-primary: #14532d;
    --text-secondary: #166534;
    --text-tertiary: #22c55e;
    --text-muted: #15803d;

    --accent-primary: #16a34a;
    --accent-primary-hover: #15803d;
    --accent-secondary: #4ade80;
    --accent-glow: rgba(22, 163, 74, 0.2);
    --accent-glow-strong: rgba(22, 163, 74, 0.4);

    --border-color: #bbf7d0;
    --border-color-hover: #86efac;
    --glass-border: rgba(134, 239, 172, 0.2);
    --glass-bg: rgba(240, 255, 244, 0.9);
}

[data-theme="light-sunset"] {
    --bg-primary: #fff7ed;
    --bg-secondary: #ffedd5;
    --bg-tertiary: #fed7aa;
    --bg-card: #ffffff;
    --bg-card-hover: #fff7ed;

    --text-primary: #7c2d12;
    --text-secondary: #9a3412;
    --text-tertiary: #ea580c;
    --text-muted: #c2410c;

    --accent-primary: #ea580c;
    --accent-primary-hover: #c2410c;
    --accent-secondary: #fb923c;
    --accent-glow: rgba(234, 88, 12, 0.2);
    --accent-glow-strong: rgba(234, 88, 12, 0.4);

    --border-color: #fed7aa;
    --border-color-hover: #fdba74;
    --glass-border: rgba(253, 186, 116, 0.2);
    --glass-bg: rgba(255, 247, 237, 0.9);
}