/* TEDD's AI — Light Theme
 * Overrides the dark :root variables (in style.css) when <html data-theme="light">.
 * Higher specificity (html[data-theme="light"]) so these win without !important.
 * Default (no attribute) stays the original Premium Dark Theme.
 */

html[data-theme="light"] {
    /* Backgrounds — soft lavender-white, not harsh pure white */
    --bg-primary: #f5f6fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eceef7;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.98);
    --bg-glass: rgba(255, 255, 255, 0.78);

    /* Accents — deepened for light bg so accent-colored TEXT stays readable
       (the dark-theme #6366f1/#a855f7 are too light as text on white). */
    --accent-primary: #4f46e5;
    --accent-secondary: #9333ea;
    --accent-cyan: #0e7490;
    --accent-glow: rgba(99, 102, 241, 0.28);

    /* Gradients: DEEP stops across the full width so white text stays readable
       even on wide buttons (a bright magenta end stop read as "washed"). All
       stops are dark indigo/violet/purple => white text ~6:1+ everywhere. */
    --accent-gradient: linear-gradient(135deg, #4338ca 0%, #5b21b6 50%, #6b21a8 100%);
    --accent-gradient-hover: linear-gradient(135deg, #3730a3 0%, #4c1d95 50%, #581c87 100%);

    /* Text — dark ink on light. Muted darkened to clear 4.5:1 on the light bg. */
    --text-primary: #161325;
    --text-secondary: #3f4a5c;
    --text-muted: #586679;

    /* Status colors keep their hue (slightly deepened for contrast on light) */
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;

    /* Borders — dark hairlines instead of white */
    --border-color: rgba(15, 23, 42, 0.10);
    --border-glow: rgba(99, 102, 241, 0.35);

    /* Shadows — a touch stronger so cards lift off the light bg */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.10);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 20px -6px rgba(15, 23, 42, 0.12), 0 6px 10px -6px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 22px rgba(99, 102, 241, 0.22);
}

/* Body mesh: lighten the radial glow so it reads on a light background */
html[data-theme="light"] body {
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.06), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.06), transparent 25%);
}

/* Scrollbar (if themed in style.css via these colors) */
html[data-theme="light"] ::-webkit-scrollbar-track { background: var(--bg-tertiary); }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.18); }

/* The theme toggle sits in the sidebar footer next to Logout */
.theme-toggle { width: 100%; cursor: pointer; }
.theme-toggle .theme-icon { font-size: 1rem; line-height: 1; }

/* ===========================================================================
   Component overrides — elements whose backgrounds are hardcoded dark in
   style.css (not variable-driven), so they don't adapt to the light theme.
   =========================================================================== */

/* Form controls — style.css sets `background: rgba(0,0,0,0.3)` => grey boxes on
   light. Make them clean white fields with dark text. Covers both the .form-*
   classes and raw text-like inputs (time pickers, selects, textareas). */
html[data-theme="light"] .form-input,
html[data-theme="light"] .form-select,
html[data-theme="light"] .form-textarea,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] input[type="url"],
html[data-theme="light"] input[type="tel"],
html[data-theme="light"] input[type="time"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] select,
html[data-theme="light"] textarea {
    /* !important so we beat both the .form-input class bg (rgba(0,0,0,0.3))
       AND inline `style="background:..."` on some textareas/inputs. */
    background: #ffffff !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    /* Native <select> / time / number widgets ignore author background unless
       their native appearance is turned off. */
    -webkit-appearance: none;
    appearance: none;
}
html[data-theme="light"] .form-input::placeholder,
html[data-theme="light"] .form-textarea::placeholder,
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
    color: var(--text-muted);
}

/* Secondary button — style.css gives it white text on a white-tint bg
   => invisible on light. Flip to a light surface with dark text. */
html[data-theme="light"] .btn-secondary {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}
html[data-theme="light"] .btn-secondary:hover {
    background: rgba(15, 23, 42, 0.10) !important;
    border-color: var(--border-color);
}

/* Ghost button hover — white tint is invisible on light; use a dark tint. */
html[data-theme="light"] .btn-ghost:hover {
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-primary);
}

/* Top marketing nav (landing/pricing) — dark glass => light glass. */
html[data-theme="light"] .nav {
    background: rgba(255, 255, 255, 0.80);
}

