/* Advanced Data Viz — shared CSS for all 10 chart blocks.
 *
 * The chart canvas itself is rendered by ECharts (loaded from the CDN by
 * lyra-bt-data-viz.js). This stylesheet handles the WordPress-side container,
 * headings, empty states, and the SSR pieces of KPI Tile and inline
 * Sparkline (which combine ECharts with surrounding HTML).
 */

.lyra-bt-dv {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #0f172a;
    box-sizing: border-box;
}
.lyra-bt-dv *, .lyra-bt-dv *::before, .lyra-bt-dv *::after { box-sizing: border-box; }

.lyra-bt-dv__heading {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
}
.lyra-bt-dv__subheading {
    margin: 0 0 16px;
    color: #64748b;
    font-size: 14px;
    text-align: center;
}
.lyra-bt-dv__empty {
    color: #64748b;
    font-style: italic;
    text-align: center;
    padding: 32px 0;
}
.lyra-bt-dv__chart {
    width: 100%;
    min-height: 80px;
    /* ECharts injects an absolutely-positioned canvas inside */
}

/* ─── Inline sparkline (in-prose) ──────────────────────────────────── */
.lyra-bt-dv-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    vertical-align: middle;
}
.lyra-bt-dv-inline__prefix,
.lyra-bt-dv-inline__suffix {
    font-size: inherit;
    color: inherit;
}
.lyra-bt-dv-inline__chart {
    display: inline-block;
    vertical-align: middle;
}

/* ─── KPI Tile (mostly SSR; sparkline inside) ──────────────────────── */
.lyra-bt-dv--kpi_tile {
    max-width: 360px;
}
.lyra-bt-dv__kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 22px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.lyra-bt-dv__kpi-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 4px;
}
.lyra-bt-dv__kpi-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.lyra-bt-dv__kpi-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    color: #0f172a;
}
.lyra-bt-dv__kpi-delta {
    font-size: 13px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.lyra-bt-dv__kpi-delta--up    { background: #dcfce7; color: #166534; }
.lyra-bt-dv__kpi-delta--down  { background: #fee2e2; color: #991b1b; }
.lyra-bt-dv__kpi-delta--flat  { background: #f1f5f9; color: #475569; }
.lyra-bt-dv__kpi-spark {
    height: 32px;
    margin-top: 8px;
}
.lyra-bt-dv__kpi-meta {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}

/* Status borders for KPI Tile when admin sets status colour. */
.lyra-bt-dv__kpi-card--positive { border-left: 4px solid #16a34a; }
.lyra-bt-dv__kpi-card--negative { border-left: 4px solid #dc2626; }
.lyra-bt-dv__kpi-card--neutral  { border-left: 4px solid #64748b; }

/* Compact KPI variation (smaller, no card border, sparkline below) */
.lyra-bt-dv--kpi_tile.lyra-bt-dv--variant-compact .lyra-bt-dv__kpi-card {
    padding: 12px 14px;
    border-radius: 8px;
}
.lyra-bt-dv--kpi_tile.lyra-bt-dv--variant-compact .lyra-bt-dv__kpi-value {
    font-size: 24px;
}

/* ─── Layout responsiveness ────────────────────────────────────────── */
@media (max-width: 640px) {
    .lyra-bt-dv__heading { font-size: 19px; }
    .lyra-bt-dv { padding: 18px 14px; }
    .lyra-bt-dv__kpi-value { font-size: 26px; }
}

/* ─── Comparison Matrix (SSR HTML table) ───────────────────────────── */
.lyra-bt-dv--comparison_matrix { --lyra-bt-dv-accent: #0f172a; }
.lyra-bt-dv__cmx-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.lyra-bt-dv__cmx {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}
.lyra-bt-dv__cmx th,
.lyra-bt-dv__cmx td {
    padding: 12px 14px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #e2e8f0;
}
.lyra-bt-dv__cmx-rowhead { width: 1%; }
.lyra-bt-dv__cmx-rowname {
    text-align: left;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
}
.lyra-bt-dv__cmx-colhead {
    background: #f8fafc;
    border-bottom: 2px solid #cbd5e1;
    padding-top: 16px;
    padding-bottom: 14px;
    position: relative;
}
.lyra-bt-dv__cmx-colhead--best {
    background: var(--lyra-bt-dv-accent);
    color: #fff;
}
.lyra-bt-dv__cmx-coltitle { font-size: 14px; font-weight: 700; }
.lyra-bt-dv__cmx-subtitle { font-size: 12px; color: #64748b; margin-top: 3px; }
.lyra-bt-dv__cmx-colhead--best .lyra-bt-dv__cmx-subtitle { color: rgba(255,255,255,0.85); }
.lyra-bt-dv__cmx-pricetag {
    font-size: 22px;
    font-weight: 800;
    margin-top: 6px;
    color: #0f172a;
}
.lyra-bt-dv__cmx-colhead--best .lyra-bt-dv__cmx-pricetag { color: #fff; }
.lyra-bt-dv__cmx-best-badge {
    display: inline-block;
    background: #fff;
    color: var(--lyra-bt-dv-accent);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.lyra-bt-dv__cmx-cell {
    position: relative;
    color: #334155;
}
.lyra-bt-dv__cmx-cell--winner {
    background: rgba(15, 23, 42, 0.06);
    background: color-mix(in srgb, var(--lyra-bt-dv-accent) 12%, transparent);
    font-weight: 700;
    color: #0f172a;
}
.lyra-bt-dv__cmx-cell--bestcol {
    background: rgba(15, 23, 42, 0.04);
    background: color-mix(in srgb, var(--lyra-bt-dv-accent) 6%, transparent);
}
.lyra-bt-dv__cmx-badge {
    display: inline-block;
    background: var(--lyra-bt-dv-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.lyra-bt-dv__cmx-ctacell { border-bottom: none; padding-top: 16px; }
.lyra-bt-dv__cmx-cta {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: background 0.15s, border-color 0.15s;
}
.lyra-bt-dv__cmx-cta:hover { background: #f1f5f9; border-color: #94a3b8; }
.lyra-bt-dv__cmx-cta--best {
    background: var(--lyra-bt-dv-accent);
    color: #fff;
    border-color: var(--lyra-bt-dv-accent);
}
.lyra-bt-dv__cmx-cta--best:hover {
    background: #0f172a;
    border-color: #0f172a;
}

/* compact_pricing variation: column headers more like pricing cards */
.lyra-bt-dv--comparison_matrix.lyra-bt-dv--variant-compact_pricing .lyra-bt-dv__cmx-colhead { padding-bottom: 18px; }
.lyra-bt-dv--comparison_matrix.lyra-bt-dv--variant-compact_pricing .lyra-bt-dv__cmx-pricetag { font-size: 28px; }
