/* ============================================================
   MARKETVISTA AI — PAGE THEME COMPLIANCE LAYER
   FILE: /assets/css/mv-page-theme-compliance.css
   VERSION: 1.0
   DATE: 2026-03-29
============================================================ */

html,
body {
    --mv-page-surface: #ffffff;
    --mv-page-surface-soft: #f7faff;
    --mv-page-surface-soft-2: #eef4fb;
    --mv-page-border: rgba(15, 23, 42, 0.10);
    --mv-page-border-strong: rgba(37, 99, 235, 0.18);
    --mv-page-text: #0f172a;
    --mv-page-text-soft: #334155;
    --mv-page-text-muted: #64748b;
    --mv-page-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    --mv-page-accent: #2563eb;
    --mv-page-accent-soft: rgba(37, 99, 235, 0.10);
    --mv-page-user-bubble: rgba(37, 99, 235, 0.10);
    --mv-page-user-border: rgba(37, 99, 235, 0.24);
    --mv-page-hero: linear-gradient(135deg, #0f1727 0%, #111a2e 48%, #16233d 100%);
    --mv-page-hero-text: #eef4ff;
    --mv-page-hero-muted: #b9c4d8;
    --mv-page-hero-soft: rgba(255,255,255,0.05);
}

html.mv-theme-dark,
body.mv-theme-dark,
html[data-mv-theme="dark"],
body[data-mv-theme="dark"],
html[data-bs-theme="dark"],
body[data-bs-theme="dark"],
html.theme-dark,
body.theme-dark,
html.dark-mode,
body.dark-mode,
html.dark,
body.dark,
html.layout-dark,
body.layout-dark {
    --mv-page-surface: linear-gradient(180deg, rgba(16, 24, 39, 0.98), rgba(13, 20, 34, 0.96));
    --mv-page-surface-soft: rgba(255, 255, 255, 0.04);
    --mv-page-surface-soft-2: rgba(255, 255, 255, 0.06);
    --mv-page-border: rgba(255, 255, 255, 0.08);
    --mv-page-border-strong: rgba(56, 189, 248, 0.22);
    --mv-page-text: #eef4ff;
    --mv-page-text-soft: #d7e2f1;
    --mv-page-text-muted: #9fb0ca;
    --mv-page-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
    --mv-page-accent: #38bdf8;
    --mv-page-accent-soft: rgba(56, 189, 248, 0.12);
    --mv-page-user-bubble: rgba(56, 189, 248, 0.12);
    --mv-page-user-border: rgba(56, 189, 248, 0.24);
    --mv-page-hero: linear-gradient(135deg, #081121 0%, #0b1730 48%, #0f2140 100%);
    --mv-page-hero-text: #eef4ff;
    --mv-page-hero-muted: #bdd0e7;
    --mv-page-hero-soft: rgba(255,255,255,0.05);
}

.mv-data-toolbar,
.mv-widget,
.card.mv-widget,
.card[data-widget],
.mv-ai-page-panel,
.mv-ai-widget-card,
.mv-ai-mini-card,
.mv-ai-summary-card,
.mv-ai-info-card,
.mv-ai-chip-card,
.mv-ai-empty-card,
.mv-analysis-hero,
.mv-analysis-panel,
.mv-analysis-doc,
.mv-analysis-mini-card,
.mv-analysis-history-item,
.mv-pm-page .card,
.mv-pm-stat-card,
.mv-pm-toolbar,
.mv-pm-empty,
.mv-pm-side-card,
.mv-pm-stat-card .card-body,
#mvAiWatchlistSignalsCard .card,
#mvAiAutoTraderCopilot .card,
#mvAiSignalsDesk .card,
#mvAiPageThread .mv-ai-mini-card {
    background: var(--mv-page-surface) !important;
    color: var(--mv-page-text) !important;
    border-color: var(--mv-page-border) !important;
    box-shadow: var(--mv-page-shadow) !important;
}

.mv-data-toolbar,
.mv-widget,
.card.mv-widget,
.card[data-widget],
.mv-ai-page-panel,
.mv-ai-widget-card,
.mv-pm-page .card,
.mv-pm-stat-card,
.mv-pm-toolbar,
#mvAiWatchlistSignalsCard .card,
#mvAiAutoTraderCopilot .card,
#mvAiSignalsDesk .card {
    border-radius: 18px !important;
}

.mv-pm-hero,
.mv-pm-hero-panel,
.mv-pm-top-card,
.mv-pm-card,
.mv-ai-panel__drawer {
    background: var(--mv-page-hero) !important;
    color: var(--mv-page-hero-text) !important;
    border-color: var(--mv-page-border) !important;
    box-shadow: var(--mv-page-shadow) !important;
}

.mv-pm-eyebrow,
.mv-ai-panel__eyebrow { color: #7dd3fc !important; }
.mv-pm-title,
.mv-ai-panel__title { color: var(--mv-page-hero-text) !important; }
.mv-pm-subtitle,
.mv-pm-hero-note,
.mv-ai-panel__subtitle,
.mv-pm-top-copy,
.mv-pm-copy,
.mv-pm-card-note,
.mv-ai-block p,
.mv-ai-field-note { color: var(--mv-page-hero-muted) !important; }

.mv-pm-stat-value,
.mv-pm-side-copy strong,
.mv-pm-coverage-row strong,
.mv-pm-page .mv-pm-widget-head-copy strong,
.mv-pm-page .mv-pm-widget-head-copy .small,
.mv-pm-page .mv-pm-stat-label,
.mv-pm-page .mv-pm-top-symbol,
.mv-pm-page .mv-pm-price,
.mv-pm-page .mv-pm-meta-grid strong,
.mv-pm-page .mv-pm-score-line strong,
.mv-ai-page-panel h1,
.mv-ai-page-panel h2,
.mv-ai-page-panel h3,
.mv-ai-page-panel h4,
.mv-ai-page-panel h5,
.mv-ai-page-panel h6,
.mv-widget h1,
.mv-widget h2,
.mv-widget h3,
.mv-widget h4,
.mv-widget h5,
.mv-widget h6,
.mv-ai-widget-card h1,
.mv-ai-widget-card h2,
.mv-ai-widget-card h3,
.mv-ai-widget-card h4,
.mv-ai-widget-card h5,
.mv-ai-widget-card h6,
.mv-data-toolbar h1,
.mv-data-toolbar h2,
.mv-data-toolbar h3,
.mv-data-toolbar h4,
.mv-data-toolbar h5,
.mv-data-toolbar h6,
.mv-ai-mini-card h6,
.mv-ai-chip-card strong,
.mv-ai-summary-title,
.mv-ai-info-title,
.mv-pm-method strong {
    color: var(--mv-page-text) !important;
}

.mv-page-subtitle,
.mv-data-toolbar .text-muted,
.mv-widget .text-muted,
.mv-ai-widget-card .text-muted,
.mv-ai-page-panel .text-muted,
.mv-ai-mini-card .text-muted,
.mv-ai-summary-note,
.mv-ai-info-eyebrow,
.mv-ai-meta,
.mv-ai-subtitle,
.mv-analysis-subtitle,
.mv-analysis-status,
.mv-pm-page .text-muted,
.mv-pm-stat-label,
.mv-pm-stat-note,
.mv-pm-side-copy,
.mv-pm-method,
.mv-pm-coverage-row,
.mv-pm-top-label,
.mv-pm-top-stats,
.mv-pm-score-line,
.mv-pm-score-line strong,
.mv-pm-meta-grid span,
.mv-ai-mini-card div,
.mv-ai-mini-card p,
.mv-ai-mini-card li,
.mv-ai-summary-copy,
.mv-ai-info-body,
.mv-ai-chip-card span,
.mv-ai-empty,
.mv-analysis-doc,
.mv-analysis-panel,
.mv-analysis-mini-card,
.mv-pm-empty {
    color: var(--mv-page-text-muted) !important;
}

.mv-ai-bubble,
.mv-ai-inline-chat .mv-ai-helper-copy,
.mv-ai-tools,
.mv-ai-pinned-chip,
.mv-ai-empty-card,
.mv-ai-summary-card,
.mv-ai-info-card,
.mv-ai-chip-card,
.mv-ai-mini-card,
.mv-ai-block,
.mv-ai-mini,
.mv-pm-meta-grid div,
.mv-pm-toolbar .form-select,
.mv-pm-toolbar .form-control,
.mv-pm-detail-btn,
.mv-analysis-form textarea,
.mv-analysis-form input,
.mv-ai-inline-chat textarea,
.mv-ai-page-panel textarea.form-control,
.mv-ai-page-panel input.form-control,
#mvAiPageInput {
    background: var(--mv-page-surface-soft) !important;
    color: var(--mv-page-text) !important;
    border-color: var(--mv-page-border) !important;
}

.mv-ai-bubble.is-user {
    background: var(--mv-page-user-bubble) !important;
    border-color: var(--mv-page-user-border) !important;
    color: var(--mv-page-text) !important;
}

.mv-ai-page-panel textarea.form-control::placeholder,
.mv-ai-page-panel input.form-control::placeholder,
.mv-ai-inline-chat textarea::placeholder,
.mv-analysis-form textarea::placeholder,
.mv-analysis-form input::placeholder,
.mv-pm-toolbar .form-control::placeholder {
    color: var(--mv-page-text-muted) !important;
}

.mv-ai-page-panel textarea.form-control:focus,
.mv-ai-page-panel input.form-control:focus,
.mv-ai-inline-chat textarea:focus,
.mv-analysis-form textarea:focus,
.mv-analysis-form input:focus,
.mv-pm-toolbar .form-select:focus,
.mv-pm-toolbar .form-control:focus {
    border-color: var(--mv-page-border-strong) !important;
    box-shadow: 0 0 0 0.18rem var(--mv-page-accent-soft) !important;
}


.mv-pm-toolbar .form-select {
    color-scheme: light dark;
}

.mv-pm-toolbar .form-select option,
.mv-pm-toolbar .form-select optgroup {
    background: var(--mv-page-surface) !important;
    color: var(--mv-page-text) !important;
}

.mv-widget .btn-outline-light,
.mv-ai-widget-card .btn-outline-light,
.mv-ai-page-panel .btn-outline-light,
.mv-pm-page .btn-outline-light,
.mv-analysis-panel .btn-outline-light,
.mv-analysis-hero .btn-outline-light,
.mv-ai-panel__drawer .btn-outline-light {
    color: var(--mv-page-text) !important;
    border-color: var(--mv-page-border-strong) !important;
    background: transparent !important;
}

.mv-widget .btn-outline-light:hover,
.mv-ai-widget-card .btn-outline-light:hover,
.mv-ai-page-panel .btn-outline-light:hover,
.mv-pm-page .btn-outline-light:hover,
.mv-analysis-panel .btn-outline-light:hover,
.mv-analysis-hero .btn-outline-light:hover,
.mv-ai-panel__drawer .btn-outline-light:hover {
    background: var(--mv-page-accent-soft) !important;
    color: var(--mv-page-text) !important;
}

.mv-widget .table,
.mv-ai-widget-card .table,
.mv-pm-page .table {
    --bs-table-color: var(--mv-page-text);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--mv-page-border);
    --bs-table-striped-bg: transparent;
    --bs-table-hover-bg: var(--mv-page-surface-soft);
    color: var(--mv-page-text) !important;
    background: transparent !important;
}

.mv-widget thead,
.mv-widget thead th,
.mv-ai-widget-card thead,
.mv-ai-widget-card thead th,
.mv-pm-page thead,
.mv-pm-page thead th,
.mv-widget .table-light,
.mv-ai-widget-card .table-light,
.mv-pm-page .table-light {
    background: var(--mv-page-surface-soft-2) !important;
    color: var(--mv-page-text) !important;
    border-color: var(--mv-page-border) !important;
}

.mv-widget .table > :not(caption) > * > *,
.mv-ai-widget-card .table > :not(caption) > * > *,
.mv-pm-page .table > :not(caption) > * > * {
    background: transparent !important;
    color: inherit !important;
    border-bottom-color: var(--mv-page-border) !important;
}

.mv-widget .list-group-item,
.mv-ai-widget-card .list-group-item,
.mv-pm-page .list-group-item {
    background: transparent !important;
    color: var(--mv-page-text) !important;
    border-color: var(--mv-page-border) !important;
}

.mv-pm-tip-btn {
    background: var(--mv-page-surface-soft) !important;
    color: var(--mv-page-text-muted) !important;
    border-color: var(--mv-page-border) !important;
}

.mv-pm-tip-btn:hover,
.mv-pm-tip-btn:focus-visible {
    background: var(--mv-page-accent-soft) !important;
    color: var(--mv-page-accent) !important;
    border-color: var(--mv-page-border-strong) !important;
}

.mv-pm-score-bar,
.mv-pm-source-pill,
.mv-pm-asset-pill,
.mv-pm-pill,
.mv-ai-pill,
.mv-ai-chip,
.mv-ai-context-chip {
    border-color: var(--mv-page-border) !important;
}

.mv-pm-empty,
.alert#mvPmStatus {
    background: var(--mv-page-surface-soft) !important;
    color: var(--mv-page-text) !important;
    border-color: var(--mv-page-border) !important;
}

.mv-pm-coverage-row {
    border-bottom-color: var(--mv-page-border) !important;
}

.mv-data-toolbar,
.mv-page-subtitle,
.mv-page-actions {
    color: var(--mv-page-text) !important;
}

/* keep transitions smooth when the theme flips live */
.mv-data-toolbar,
.mv-widget,
.card.mv-widget,
.card[data-widget],
.mv-ai-page-panel,
.mv-ai-widget-card,
.mv-ai-mini-card,
.mv-ai-summary-card,
.mv-ai-info-card,
.mv-ai-chip-card,
.mv-ai-empty-card,
.mv-analysis-hero,
.mv-analysis-panel,
.mv-analysis-doc,
.mv-analysis-mini-card,
.mv-pm-page .card,
.mv-pm-hero,
.mv-pm-hero-panel,
.mv-pm-top-card,
.mv-pm-card,
.mv-ai-panel__drawer,
.mv-pm-toolbar .form-select,
.mv-pm-toolbar .form-control,
.mv-ai-page-panel textarea.form-control,
.mv-ai-page-panel input.form-control,
#mvAiPageInput {
    transition: background-color .18s ease, background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
