/**
 * Election Odds — frontend module styles
 *
 * Theme: vibrant red/white/blue, party-coded.
 * Visual refresh (v1.10.0) — bold section headers, bigger odds boxes,
 * party-coded backgrounds throughout, photo-ready candidate cards.
 *
 * All modules namespaced with .eo- prefix to avoid theme conflicts.
 *
 * Design philosophy:
 *   - Red and blue carry meaning (party affiliation), not just decoration.
 *   - Section headers are bold colored bars, not styled text.
 *   - Percentages are the visual hero — biggest type on the page.
 *   - Bars and accent colors back up the numbers visually.
 *   - Spacing is generous to feel premium, not crammed.
 *   - Mobile: same vibrancy, condensed but never compromised.
 */

:root {
    /* Vibrant election palette - punchier than v1.9 */
    --eo-red:        #dc2626;
    --eo-red-dark:   #991b1b;
    --eo-red-light:  #fef2f2;

    --eo-blue:       #2563eb;
    --eo-blue-dark:  #1e40af;
    --eo-blue-light: #eff6ff;

    --eo-navy:       #0a1f44;
    --eo-gold:       #d97706;
    --eo-green:      #16a34a;
    --eo-gray:       #5b6b8a;
    --eo-gray-light: #94a3b8;

    --eo-bg:         #f8fafc;
    --eo-border:     #e2e8f0;
    --eo-card-bg:    #ffffff;

    --eo-shadow-sm:  0 1px 2px rgba(10,31,68,0.05);
    --eo-shadow-md:  0 2px 8px rgba(10,31,68,0.08);
    --eo-shadow-lg:  0 4px 16px rgba(10,31,68,0.10);

    --eo-header-grad-r: linear-gradient(135deg, var(--eo-red) 0%, var(--eo-red-dark) 100%);
    --eo-header-grad-d: linear-gradient(135deg, var(--eo-blue) 0%, var(--eo-blue-dark) 100%);
    --eo-header-grad-mixed: linear-gradient(135deg, var(--eo-red) 0%, var(--eo-blue) 100%);
}

/* ===== Shared ============================================================ */
.eo-error { background: var(--eo-red-light); border-left: 4px solid var(--eo-red); padding: 12px 16px; color: var(--eo-red-dark); font-size: 13px; border-radius: 4px; }
.eo-up { color: var(--eo-green) !important; font-weight: 600; }
.eo-down { color: var(--eo-red) !important; font-weight: 600; }
.eo-flat { color: var(--eo-gray-light) !important; font-size: 11px; }
.eo-party-d { color: var(--eo-blue); }
.eo-party-r { color: var(--eo-red); }
.eo-party-i { color: var(--eo-gray); }
.eo-party-tossup { color: var(--eo-gold); }

/* ===== Hero strip ======================================================== */
.eo-hero-strip { background: var(--eo-header-grad-r); color: #fff; padding: 26px 28px; border-radius: 12px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; box-shadow: var(--eo-shadow-lg); }
.eo-hero-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.eo-hero-eyebrow { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; opacity: 0.85; margin-bottom: 4px; font-weight: 600; }
.eo-hero-title { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -0.5px; }
.eo-hero-update { font-size: 11px; opacity: 0.85; font-weight: 500; }
.eo-live-dot { display: inline-block; width: 8px; height: 8px; background: #86efac; border-radius: 50%; margin-right: 5px; animation: eo-pulse 2s infinite; box-shadow: 0 0 8px rgba(134, 239, 172, 0.7); }
@keyframes eo-pulse { 0%,100%{opacity:1;} 50%{opacity:.4;} }
.eo-hero-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .eo-hero-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .eo-hero-tiles { grid-template-columns: 1fr; } }
.eo-hero-tile { background: #fff; color: var(--eo-navy); border-radius: 8px; padding: 14px 16px; box-shadow: var(--eo-shadow-sm); }
.eo-hero-tile-label { font-size: 10px; color: var(--eo-gray); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.eo-hero-tile-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.eo-hero-tile-name { font-size: 14px; font-weight: 600; }
.eo-hero-tile-pct { font-size: 28px; font-weight: 800; line-height: 1; }
.eo-hero-tile-bar { height: 5px; background: #eef1f7; border-radius: 3px; overflow: hidden; }
.eo-hero-tile-bar-fill { height: 100%; transition: width 0.5s ease; }
.eo-hero-tile-bar-fill.eo-party-d { background: var(--eo-blue); }
.eo-hero-tile-bar-fill.eo-party-r { background: var(--eo-red); }
.eo-hero-tile-bar-fill.eo-party-i { background: var(--eo-gray); }

/* ===== Balance of power ================================================== */
.eo-bop { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .eo-bop { grid-template-columns: 1fr; gap: 14px; } }
.eo-bop-card { background: #fff; border: 1px solid var(--eo-border); border-radius: 10px; padding: 0; overflow: hidden; box-shadow: var(--eo-shadow-md); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.eo-bop-card:hover { transform: translateY(-2px); box-shadow: var(--eo-shadow-lg); }
.eo-bop-label { background: var(--eo-header-grad-mixed); color: #fff; font-size: 13px; font-weight: 700; padding: 14px 18px; margin: 0; text-transform: uppercase; letter-spacing: 1.2px; }
.eo-bop-rows { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 14px; }
.eo-bop-row { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.eo-bop-row > span:first-child { font-weight: 600; color: var(--eo-navy); display: flex; align-items: center; gap: 6px; }
.eo-bop-row > span:first-child.eo-party-d { color: var(--eo-blue); }
.eo-bop-row > span:first-child.eo-party-r { color: var(--eo-red); }
.eo-bop-pct { font-weight: 800; font-size: 22px; color: var(--eo-navy); line-height: 1; }
.eo-bop-row > span:first-child.eo-party-d + .eo-bop-pct { color: var(--eo-blue); }
.eo-bop-row > span:first-child.eo-party-r + .eo-bop-pct { color: var(--eo-red); }
.eo-bop-bar { display: flex; height: 10px; margin: 4px 18px 14px; border-radius: 5px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(10,31,68,0.1); }
.eo-bop-bar-fill { height: 100%; }
.eo-bop-bar-fill.eo-party-d { background: var(--eo-blue); }
.eo-bop-bar-fill.eo-party-r { background: var(--eo-red); }
.eo-bop-bar-fill.eo-party-i { background: var(--eo-gray); }
.eo-bop-volume { font-size: 11px; color: var(--eo-gray); padding: 10px 18px; background: var(--eo-bg); border-top: 1px solid var(--eo-border); font-weight: 500; }

/* ===== Candidate box ===================================================== */
.eo-candidate-box { background: var(--eo-card-bg); border: 1px solid var(--eo-border); border-radius: 12px; overflow: hidden; box-shadow: var(--eo-shadow-md); max-width: 360px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.eo-candidate-box:hover { transform: translateY(-2px); box-shadow: var(--eo-shadow-lg); }
.eo-cb-header { padding: 16px 18px; color: #fff; display: flex; align-items: center; gap: 14px; }
.eo-candidate-box.eo-party-r .eo-cb-header { background: var(--eo-header-grad-r); }
.eo-candidate-box.eo-party-d .eo-cb-header { background: var(--eo-header-grad-d); }
.eo-candidate-box.eo-party-i .eo-cb-header { background: linear-gradient(135deg, var(--eo-navy) 0%, #1e293b 100%); }
.eo-cb-photo { width: 60px; height: 60px; border-radius: 50%; background: #fff; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px rgba(255,255,255,0.3); }
.eo-cb-photo img { width: 100%; height: 100%; object-fit: cover; }
.eo-cb-initials { font-weight: 700; color: var(--eo-navy); font-size: 20px; }
.eo-cb-name-block { flex: 1; min-width: 0; }
.eo-cb-name { font-size: 19px; font-weight: 700; line-height: 1.2; }
.eo-cb-meta { font-size: 11px; opacity: 0.9; margin-top: 3px; font-weight: 500; }
.eo-cb-headline { padding: 16px 18px; background: var(--eo-bg); border-bottom: 1px solid var(--eo-border); }
.eo-cb-headline-row { display: flex; justify-content: space-between; align-items: baseline; }
.eo-cb-headline-label { font-size: 11px; color: var(--eo-gray); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.eo-cb-headline-value { font-size: 36px; font-weight: 800; line-height: 1; color: var(--eo-navy); letter-spacing: -1px; }
.eo-candidate-box.eo-party-r .eo-cb-headline-value { color: var(--eo-red); }
.eo-candidate-box.eo-party-d .eo-cb-headline-value { color: var(--eo-blue); }
.eo-cb-change { background: #ecfdf5; color: var(--eo-green); padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.eo-cb-change.eo-down { background: var(--eo-red-light); color: var(--eo-red-dark); }
.eo-cb-change-period { opacity: 0.7; margin-left: 3px; font-weight: 500; }
.eo-cb-sparkline-wrap { margin-top: 12px; }
.eo-sparkline { width: 100%; height: 44px; color: var(--eo-navy); }
.eo-candidate-box.eo-party-r .eo-sparkline { color: var(--eo-red); }
.eo-candidate-box.eo-party-d .eo-sparkline { color: var(--eo-blue); }
.eo-cb-sparkline-label { font-size: 10px; color: var(--eo-gray); margin-top: 3px; }
.eo-cb-lines { padding: 6px 18px; }
.eo-cb-line { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--eo-border); }
.eo-cb-line:last-child { border-bottom: none; }
.eo-cb-line-label { font-size: 13px; color: #334155; font-weight: 500; }
.eo-cb-line-values { display: flex; align-items: center; gap: 10px; }
.eo-cb-line-prob { font-size: 15px; font-weight: 700; color: var(--eo-navy); }
.eo-candidate-box.eo-party-r .eo-cb-line-prob { color: var(--eo-red); }
.eo-candidate-box.eo-party-d .eo-cb-line-prob { color: var(--eo-blue); }
.eo-cb-line-change { font-size: 11px; min-width: 36px; text-align: right; font-weight: 600; }
.eo-cb-footer { padding: 12px 18px; background: var(--eo-bg); border-top: 1px solid var(--eo-border); font-size: 11px; color: var(--eo-gray); font-weight: 500; }

/* ===== Top candidates grid =============================================== */
.eo-top-candidates { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.eo-tc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; background: var(--eo-header-grad-r); color: #fff; padding: 14px 18px; border-radius: 8px; box-shadow: var(--eo-shadow-md); }
.eo-tc-title { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: 0.2px; }
.eo-tc-volume { font-size: 12px; color: rgba(255,255,255,0.85); font-weight: 500; }
.eo-tc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.eo-tc-card { background: #fff; border: 1px solid var(--eo-border); border-top: 4px solid var(--eo-gray); border-radius: 10px; padding: 16px 12px; text-align: center; position: relative; box-shadow: var(--eo-shadow-sm); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.eo-tc-card:hover { transform: translateY(-3px); box-shadow: var(--eo-shadow-lg); }
.eo-tc-card.eo-party-r { border-top-color: var(--eo-red); }
.eo-tc-card.eo-party-d { border-top-color: var(--eo-blue); }
.eo-tc-rank { position: absolute; top: 10px; left: 12px; font-size: 10px; color: var(--eo-gray-light); font-weight: 700; letter-spacing: 0.5px; }
.eo-tc-photo { width: 72px; height: 72px; border-radius: 50%; margin: 8px auto 10px; overflow: hidden; background: var(--eo-bg); display: flex; align-items: center; justify-content: center; border: 3px solid var(--eo-border); }
.eo-tc-card.eo-party-r .eo-tc-photo { border-color: var(--eo-red); }
.eo-tc-card.eo-party-d .eo-tc-photo { border-color: var(--eo-blue); }
.eo-tc-photo img { width: 100%; height: 100%; object-fit: cover; }
.eo-tc-initials { font-weight: 700; color: var(--eo-navy); font-size: 24px; }
.eo-tc-name { font-size: 14px; font-weight: 700; color: var(--eo-navy); margin-bottom: 8px; }
.eo-tc-prob { font-size: 28px; font-weight: 800; color: var(--eo-navy); line-height: 1; letter-spacing: -0.5px; }
.eo-tc-card.eo-party-r .eo-tc-prob { color: var(--eo-red); }
.eo-tc-card.eo-party-d .eo-tc-prob { color: var(--eo-blue); }
.eo-tc-change { font-size: 11px; margin-top: 6px; font-weight: 600; }

/* ===== Biggest movers ==================================================== */
.eo-movers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .eo-movers-grid { grid-template-columns: 1fr; } }
.eo-mover { background: #f8fafc; border-left: 5px solid var(--eo-gray); border-radius: 8px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--eo-shadow-sm); transition: transform 0.15s ease; }
.eo-mover:hover { transform: translateX(2px); }
.eo-mover-up { background: #ecfdf5; border-left-color: var(--eo-green); }
.eo-mover-down { background: var(--eo-red-light); border-left-color: var(--eo-red); }
.eo-mover-title { font-size: 14px; font-weight: 700; color: var(--eo-navy); }
.eo-mover-meta { font-size: 11px; color: var(--eo-gray); margin-top: 3px; font-weight: 500; }
.eo-mover-change { font-weight: 800; font-size: 18px; }
.eo-mover-up .eo-mover-change { color: var(--eo-green); }
.eo-mover-down .eo-mover-change { color: var(--eo-red); }

/* ===== Race list ========================================================= */
.eo-race-list { display: flex; flex-direction: column; gap: 8px; }
.eo-race-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: #fff; border: 1px solid var(--eo-border); border-left: 5px solid var(--eo-gray); border-radius: 8px; box-shadow: var(--eo-shadow-sm); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.eo-race-row:hover { transform: translateX(3px); box-shadow: var(--eo-shadow-md); }
.eo-race-row.eo-party-r { border-left-color: var(--eo-red); }
.eo-race-row.eo-party-d { border-left-color: var(--eo-blue); }
.eo-race-row.eo-party-tossup { border-left-color: var(--eo-gold); }
.eo-race-name { font-size: 15px; font-weight: 700; color: var(--eo-navy); line-height: 1.3; }
.eo-race-subtitle { font-size: 12px; color: var(--eo-gray); margin-top: 3px; font-weight: 500; }
.eo-race-leader { font-size: 18px; font-weight: 800; line-height: 1; }
.eo-race-row.eo-party-r .eo-race-leader { color: var(--eo-red); }
.eo-race-row.eo-party-d .eo-race-leader { color: var(--eo-blue); }

/* ===== Props list ======================================================== */
.eo-props { display: flex; flex-direction: column; gap: 8px; }
.eo-prop-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #fff; border: 1px solid var(--eo-border); border-radius: 8px; font-size: 14px; box-shadow: var(--eo-shadow-sm); transition: transform 0.15s ease; }
.eo-prop-row:hover { transform: translateX(2px); }
.eo-prop-question { color: var(--eo-navy); flex: 1; margin-right: 12px; font-weight: 500; }
.eo-prop-pct { font-weight: 800; font-size: 18px; color: var(--eo-navy); flex-shrink: 0; }
.eo-prop-likely { color: var(--eo-green); }
.eo-prop-unlikely { color: var(--eo-red); }

/* ===== Threshold markets (Trump tracker, etc.) =========================== */
.eo-threshold-markets { display: flex; flex-direction: column; gap: 22px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.eo-threshold-card { background: #fff; border: 1px solid var(--eo-border); border-radius: 10px; overflow: hidden; box-shadow: var(--eo-shadow-md); }
.eo-threshold-header { padding: 16px 20px; background: var(--eo-header-grad-r); color: #fff; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.eo-threshold-title { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: 0.2px; }
.eo-threshold-volume { font-size: 11px; color: rgba(255,255,255,0.85); font-weight: 500; }
.eo-threshold-rows { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.eo-threshold-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 14px; align-items: center; font-size: 14px; }
@media (max-width: 600px) { .eo-threshold-row { grid-template-columns: 1fr; gap: 4px; } }
.eo-threshold-label { color: var(--eo-navy); font-weight: 600; }
.eo-threshold-bar-wrap { background: #eef1f7; border-radius: 5px; height: 14px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(10,31,68,0.08); }
.eo-threshold-bar { height: 100%; transition: width 0.4s ease; }
.eo-threshold-bar--high { background: linear-gradient(90deg, var(--eo-red) 0%, var(--eo-red-dark) 100%); }
.eo-threshold-bar--mid  { background: linear-gradient(90deg, var(--eo-gold) 0%, #b45309 100%); }
.eo-threshold-bar--low  { background: linear-gradient(90deg, #94a3b8 0%, #64748b 100%); }
.eo-threshold-pct { font-weight: 800; color: var(--eo-navy); min-width: 52px; text-align: right; font-size: 16px; }

/* ===== Historical chart ================================================== */
.eo-chart-card {
    background: #fff;
    border: 1px solid var(--eo-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--eo-shadow-md);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 24px 0;
}
.eo-chart-header {
    padding: 14px 18px;
    background: var(--eo-header-grad-r);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.eo-chart-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.2px;
}
.eo-chart-range {
    font-size: 11px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.eo-chart-canvas-wrap {
    padding: 18px;
    position: relative;
    min-height: 280px;
}
.eo-chart-canvas-wrap canvas {
    width: 100% !important;
    height: 280px !important;
}
.eo-chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 240px;
    color: var(--eo-gray);
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
}
@media (max-width: 600px) {
    .eo-chart-canvas-wrap { padding: 12px; min-height: 240px; }
    .eo-chart-canvas-wrap canvas { height: 240px !important; }
}
