/* Theme CSS variables – persisted via localStorage key glucogazeTheme */

:root {
    --accent-primary: #7ed06b;
    --accent-secondary: #4cd964;
    --accent-glow: rgba(126, 208, 107, 0.6);
    --accent-glow-shadow: rgba(126, 208, 107, 0.4);
    --header-gradient: linear-gradient(90deg, #1e3c72, #2a5298, #00b09b, #96c93d);
}

[data-theme="blue"] {
    --accent-primary: #007aff;
    --accent-secondary: #5ac8fa;
    --accent-glow: rgba(0, 122, 255, 0.6);
    --accent-glow-shadow: rgba(0, 122, 255, 0.4);
    --header-gradient: linear-gradient(90deg, #1e3c72, #2a5298, #007aff, #5ac8fa);
}

[data-theme="purple"] {
    --accent-primary: #af52de;
    --accent-secondary: #5856d6;
    --accent-glow: rgba(175, 82, 222, 0.6);
    --accent-glow-shadow: rgba(175, 82, 222, 0.4);
    --header-gradient: linear-gradient(90deg, #2d1b4e, #5856d6, #af52de, #da70d6);
}

[data-theme="orange"] {
    --accent-primary: #ff9500;
    --accent-secondary: #ff5e3a;
    --accent-glow: rgba(255, 149, 0, 0.6);
    --accent-glow-shadow: rgba(255, 149, 0, 0.4);
    --header-gradient: linear-gradient(90deg, #8b4513, #ff5e3a, #ff9500, #ffd700);
}

[data-theme="red"] {
    --accent-primary: #ff3b30;
    --accent-secondary: #c41e3a;
    --accent-glow: rgba(255, 59, 48, 0.6);
    --accent-glow-shadow: rgba(255, 59, 48, 0.4);
    --header-gradient: linear-gradient(90deg, #4a0000, #8b0000, #c41e3a, #ff3b30);
}

[data-theme="yellow"] {
    --accent-primary: #ffcc00;
    --accent-secondary: #f0a500;
    --accent-glow: rgba(255, 204, 0, 0.6);
    --accent-glow-shadow: rgba(255, 204, 0, 0.4);
    --header-gradient: linear-gradient(90deg, #8b6914, #c9a227, #f0a500, #ffcc00);
}

[data-theme="cyan"] {
    --accent-primary: #00d4aa;
    --accent-secondary: #00b4d8;
    --accent-glow: rgba(0, 212, 170, 0.6);
    --accent-glow-shadow: rgba(0, 212, 170, 0.4);
    --header-gradient: linear-gradient(90deg, #004d4d, #008b8b, #00b4d8, #00d4aa);
}

[data-theme="lime"] {
    --accent-primary: #b8e62e;
    --accent-secondary: #7ed957;
    --accent-glow: rgba(184, 230, 46, 0.6);
    --accent-glow-shadow: rgba(184, 230, 46, 0.4);
    --header-gradient: linear-gradient(90deg, #2d4a00, #5a8c00, #7ed957, #b8e62e);
}

[data-theme="pink"] {
    --accent-primary: #ff6b9d;
    --accent-secondary: #e91e8c;
    --accent-glow: rgba(255, 107, 157, 0.6);
    --accent-glow-shadow: rgba(255, 107, 157, 0.4);
    --header-gradient: linear-gradient(90deg, #4a0028, #8b0044, #e91e8c, #ff6b9d);
}

/* Night mode – dim grey palette, persisted as glucogazeNightMode */
[data-night-mode="true"] {
    --accent-primary: #888;
    --accent-secondary: #666;
    --accent-glow: rgba(136, 136, 136, 0.3);
    --accent-glow-shadow: rgba(136, 136, 136, 0.2);
    --header-gradient: linear-gradient(90deg, #2a2a2a, #3a3a3a, #4a4a4a, #5a5a5a);
}

[data-night-mode="true"] .header-bg {
    opacity: 0.25;
}

[data-night-mode="true"] .title,
[data-night-mode="true"] .value,
[data-night-mode="true"] .unit,
[data-night-mode="true"] .status-text,
[data-night-mode="true"] .time-ago,
[data-night-mode="true"] .clock-time,
[data-night-mode="true"] .clock-date,
[data-night-mode="true"] .stat-label,
[data-night-mode="true"] .stat-value-sm,
[data-night-mode="true"] .stat-unit,
[data-night-mode="true"] .time-stamp,
[data-night-mode="true"] .chart-y-label,
[data-night-mode="true"] .chart-scale,
[data-night-mode="true"] .chart-time-axis,
[data-night-mode="true"] .direction-arrow {
    color: #888;
}

[data-night-mode="true"] .direction-indicator {
    background: #555;
    box-shadow: 0 0 3px rgba(85, 85, 85, 0.3), 0 0 6px rgba(85, 85, 85, 0.15);
}

[data-night-mode="true"] .chart-area::before {
    background: rgba(102, 102, 102, 0.08);
}

[data-night-mode="true"] .chart-area .chart-point {
    background: #666 !important;
    box-shadow: 0 0 3px rgba(102, 102, 102, 0.3), 0 0 6px rgba(102, 102, 102, 0.15) !important;
}

[data-night-mode="true"] .iob-cob-rectangle {
    border-color: #555;
    box-shadow: 0 0 4px rgba(85, 85, 85, 0.2);
}

[data-night-mode="true"] .iob-cob-label,
[data-night-mode="true"] .iob-rectangle .iob-cob-label,
[data-night-mode="true"] .cob-rectangle .iob-cob-label {
    background-color: #444;
    color: #888;
}

[data-night-mode="true"] .iob-cob-value {
    color: #666;
}

/* Title input & keyboard – theme accent (Chromium) */
.title-input {
    color: var(--accent-primary) !important;
}

.title-input::placeholder {
    color: var(--accent-primary);
    opacity: 0.5;
}

.title-keyboard {
    border-color: var(--accent-primary) !important;
}

.title-keyboard .title-key {
    color: var(--accent-primary) !important;
}

.title-keyboard .title-key:hover,
.title-keyboard .title-key:active {
    background: var(--accent-primary) !important;
    color: #000 !important;
}
