/* ── Light mode theme — include after main CSS ─────────────────────── */
:root[data-theme="light"] {
    --bg: #e8e8ec;
    --bg-raised: #f2f2f5;
    --bg-card: #ffffff;
    --bg-input: #e0e0e4;
    --border: rgba(0,0,0,0.10);
    --border-light: rgba(0,0,0,0.14);
    --text: #111113;
    --text-dim: rgba(17,17,19,0.88);
    --text-muted: rgba(17,17,19,0.62);
}

html[data-theme="light"] body {
    background: #e8e8ec !important;
    color: #111113 !important;
}

html[data-theme="light"] .navbar {
    background: rgba(242,242,245,0.88) !important;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0,0,0,0.10);
}

html[data-theme="light"] .section,
html[data-theme="light"] .hero,
html[data-theme="light"] .cta-section,
html[data-theme="light"] .problem-section,
html[data-theme="light"] .trust-section,
html[data-theme="light"] .solution-section {
    background: #e8e8ec !important;
}

html[data-theme="light"] .stat-bar,
html[data-theme="light"] .site-footer {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.08);
}

html[data-theme="light"] .problem-card,
html[data-theme="light"] .pillar,
html[data-theme="light"] .trust-fact {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.08);
}

html[data-theme="light"] .modal-content,
html[data-theme="light"] .demo-modal-content {
    background: #ffffff;
    color: #1c1c1e;
    border-color: rgba(0,0,0,0.12);
}

html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] textarea,
html[data-theme="light"] select {
    background: #f0f0f2 !important;
    color: #1c1c1e !important;
    border-color: rgba(0,0,0,0.15) !important;
}

html[data-theme="light"] .btn-close {
    filter: invert(1);
}

html[data-theme="light"] .auth-card {
    background: #ffffff;
    border-color: rgba(0,0,0,0.08);
}

/* theme toggle button */
.nav-theme-toggle {
    background: none;
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 8px;
    color: var(--text-dim, #999);
    font-size: 0.95rem;
    padding: 0.4rem 0.55rem;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
}
.nav-theme-toggle:hover {
    color: var(--text, #fff);
    background: rgba(255,255,255,0.06);
}
html[data-theme="light"] .nav-theme-toggle:hover {
    background: rgba(0,0,0,0.04);
}

/* ── Light mode: chat input & bubbles ── */
html[data-theme="light"] .chat-input-inner,
html[data-theme="light"] .dash-chat-inner {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.15) !important;
}
html[data-theme="light"] .chat-input-inner:focus-within,
html[data-theme="light"] .dash-chat-inner:focus-within {
    border-color: rgba(0,0,0,0.28) !important;
}
html[data-theme="light"] .chat-textarea,
html[data-theme="light"] .dash-chat-textarea {
    color: #1c1c1e !important;
    background: transparent !important;
}
html[data-theme="light"] .chat-textarea::placeholder,
html[data-theme="light"] .dash-chat-textarea::placeholder {
    color: rgba(28,28,30,0.45) !important;
}
html[data-theme="light"] .message-row.assistant .message-bubble {
    color: #1c1c1e;
}
html[data-theme="light"] .message-row.user .message-bubble {
    background: #f0f0f2;
    border-color: rgba(0,0,0,0.12);
    color: #1c1c1e;
}
html[data-theme="light"] .message-row.assistant .message-avatar {
    background: #f0f0f2;
    border-color: rgba(0,0,0,0.12);
    color: #1c1c1e;
}
html[data-theme="light"] .message-row.user .message-avatar {
    background: rgba(0,0,0,0.08);
    color: #1c1c1e;
}
html[data-theme="light"] .send-btn:disabled {
    background: rgba(0,0,0,0.1);
    color: rgba(28,28,30,0.4);
}
html[data-theme="light"] .dash-send-btn:disabled {
    background: rgba(0,0,0,0.1);
    color: rgba(28,28,30,0.4);
}

/* ── Light mode: chat content contrast fixes ── */
html[data-theme="light"] .result-summary-banner {
    background: #f8f8fa !important;
    border-color: rgba(0,0,0,0.1) !important;
}
html[data-theme="light"] .result-summary-banner .result-summary-text {
    color: #1c1c1e !important;
}
html[data-theme="light"] .result-summary-banner.healthy .result-summary-text strong { color: #16a34a !important; }
html[data-theme="light"] .result-summary-banner.faulty .result-summary-text strong { color: #dc2626 !important; }
html[data-theme="light"] .result-summary-banner.healthy .result-summary-icon { color: #16a34a !important; }
html[data-theme="light"] .result-summary-banner.faulty .result-summary-icon { color: #dc2626 !important; }
html[data-theme="light"] .alert-success {
    background: rgba(34,197,94,0.08) !important;
    color: #166534 !important;
    border-color: rgba(34,197,94,0.2) !important;
}
html[data-theme="light"] .alert-danger {
    background: rgba(239,68,68,0.08) !important;
    color: #991b1b !important;
    border-color: rgba(239,68,68,0.2) !important;
}
html[data-theme="light"] pre,
html[data-theme="light"] code {
    background: #f0f0f2 !important;
    color: #1c1c1e !important;
}
html[data-theme="light"] .chat-welcome {
    color: #1c1c1e;
}
html[data-theme="light"] .action-pill-cta {
    background: rgba(37,99,235,0.1) !important;
    border-color: rgba(37,99,235,0.45) !important;
    color: #1e40af !important;
}
html[data-theme="light"] .action-pill-cta:hover {
    background: rgba(37,99,235,0.2) !important;
    border-color: rgba(37,99,235,0.65) !important;
    box-shadow: 0 0 22px rgba(37,99,235,0.18) !important;
}
/* Override hardcoded light-on-dark text colors in chat messages */
html[data-theme="light"] .message-row.assistant .message-bubble * {
    color: #1c1c1e !important;
}
html[data-theme="light"] .message-row.assistant .message-bubble a {
    color: #1e40af !important;
}
html[data-theme="light"] .message-row.assistant .message-bubble strong {
    color: #0d0d10 !important;
}
html[data-theme="light"] .message-row.assistant .message-bubble em {
    color: #1c1c1e !important;
}

/* ── Light mode: website section backgrounds ── */
html[data-theme="light"] .hero { background: #e0e0e6 !important; }
html[data-theme="light"] .problem-section { background: #e8e8ec !important; }
html[data-theme="light"] .solution-section { background: #e0e0e6 !important; }
html[data-theme="light"] .trust-section { background: #d8d8de !important; }
html[data-theme="light"] .cta-section { background: #e8e8ec !important; }
html[data-theme="light"] .site-footer { background: #d4d4da !important; }
html[data-theme="light"] .stat-bar { background: #ffffff !important; }
html[data-theme="light"] .problem-card,
html[data-theme="light"] .pillar,
html[data-theme="light"] .trust-fact { background: #ffffff !important; }

/* ── Light mode: chat explanation box (yellow) ── */
html[data-theme="light"] .explanation-box {
    background: #fefce8 !important;
    border-color: rgba(180,160,40,0.3) !important;
    color: #3d3808 !important;
}
html[data-theme="light"] .explanation-box i {
    color: #a08020 !important;
}
html[data-theme="light"] .explanation-box strong {
    color: #2d2800 !important;
}

/* ── Light mode: thinking/progress indicator ── */
html[data-theme="light"] .thinking-note {
    background: #f0f0f4 !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: #3c3c40 !important;
}
html[data-theme="light"] .thinking-note strong {
    color: #1c1c1e !important;
}
html[data-theme="light"] .thinking-live {
    color: #1c1c1e !important;
}
html[data-theme="light"] .thinking-stream {
    background: #f8f8fa !important;
    border-color: rgba(0,0,0,0.1) !important;
}
html[data-theme="light"] .thinking-stream-line {
    color: #3c3c40 !important;
}
html[data-theme="light"] .thinking-stream-label {
    color: rgba(28,28,30,0.55) !important;
}
html[data-theme="light"] .thinking-hint {
    color: rgba(28,28,30,0.5) !important;
}
html[data-theme="light"] .thinking-spinner {
    opacity: 0.6;
}
