/* ==========================================================================
   SLN Digital — Election Results (self-contained; no dependency on theme CSS)
   News-style result design (Aaj Tak / NDTV inspired). Light + dark.
   ========================================================================== */
.elx {
  --red: #e01e1e;
  --red-dark: #b3060b;
  --ink: #14181f;
  --muted: #667085;
  --line: #e7eaf0;
  --bg: #f3f5f9;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px rgba(16,24,40,.06);
  color: var(--ink);
  background: var(--bg);
  font-family: "Poppins", "Noto Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.dark .elx, [data-bs-theme="dark"] .elx {
  --ink: #e7eaf2; --muted: #98a2b3; --line: #232a36; --bg: #0b0e14; --card: #141a24;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.4);
}
.elx * { box-sizing: border-box; }
.elx a { text-decoration: none; color: inherit; }

.elx-wrap { max-width: 1160px; margin-inline: auto; padding: 20px 16px 56px; }
.elx-crumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.elx-crumb a:hover { color: var(--red); }
.elx-crumb span.sep { margin: 0 6px; opacity: .5; }

/* ---- Hero ---- */
.elx-hero {
  border-radius: 18px; padding: 26px 28px; color: #fff; margin-bottom: 20px;
  background: linear-gradient(120deg, var(--red-dark), var(--red));
  box-shadow: 0 10px 30px rgba(224,30,30,.25);
}
.elx-hero .eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .85; font-weight: 600; }
.elx-hero h1 { margin: 6px 0 0; font-size: clamp(1.5rem, 3.4vw, 2.3rem); font-weight: 800; line-height: 1.12; }
.elx-hero .sub { opacity: .9; margin-top: 6px; font-size: 14px; }
.elx-live { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.18); padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-top: 12px; }
.elx-live i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: elxpulse 1.4s infinite; }
@keyframes elxpulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ---- Section ---- */
.elx-section { margin-top: 26px; }
.elx-h2 { font-size: 18px; font-weight: 800; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.elx-h2::before { content: ""; width: 5px; height: 20px; border-radius: 3px; background: var(--red); }
.elx-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }

/* ---- Stat row ---- */
.elx-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.elx-stat { background: rgba(255,255,255,.14); border-radius: 12px; padding: 14px 16px; }
.elx-stat b { display: block; font-size: 26px; font-weight: 800; line-height: 1; }
.elx-stat span { font-size: 12px; opacity: .9; }
@media (max-width: 640px){ .elx-stats { grid-template-columns: repeat(2,1fr); } }

/* ---- Overview: gauge + leader ---- */
.elx-overview { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: stretch; }
@media (max-width: 820px){ .elx-overview { grid-template-columns: 1fr; } }
.elx-gauge-card, .elx-leader-card { padding: 22px; }
.elx-gauge { width: 100%; max-width: 420px; margin: 0 auto; display: block; }
.elx-gauge-center { text-align: center; margin-top: -46px; }
.elx-gauge-center b { display: block; font-size: 30px; font-weight: 800; }
.elx-gauge-center span { font-size: 12px; color: var(--muted); }

/* ---- Party cards ---- */
.elx-party-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.elx-party { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.elx-party .top { height: 6px; }
.elx-party .body { padding: 14px; }
.elx-party .pname { font-weight: 700; font-size: 14px; }
.elx-party .seats { font-size: 34px; font-weight: 800; line-height: 1; margin: 6px 0 2px; }
.elx-party .meta { font-size: 12px; color: var(--muted); }

/* ---- Horizontal bar chart ---- */
.elx-bars { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; }
.elx-bar-row { display: grid; grid-template-columns: 64px 1fr 46px; align-items: center; gap: 12px; }
.elx-bar-label { font-weight: 700; font-size: 13px; text-align: right; }
.elx-bar-track { background: rgba(120,130,150,.14); border-radius: 999px; height: 20px; overflow: hidden; }
.elx-bar-fill { height: 100%; border-radius: 999px; min-width: 3px; transition: width .6s ease; }
.elx-bar-val { font-weight: 800; font-size: 14px; }

/* ---- District / body cards ---- */
.elx-grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 720px){ .elx-grid2 { grid-template-columns: 1fr; } }
.elx-dcard { padding: 18px; transition: transform .2s ease, box-shadow .2s ease; }
.elx-dcard:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(16,24,40,.12); }
.elx-dcard .dhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.elx-dcard .dname { font-size: 17px; font-weight: 800; }
.elx-dcard .dcount { font-size: 12px; color: var(--muted); white-space: nowrap; }
.elx-cta { color: var(--red); font-weight: 700; font-size: 14px; margin-top: 12px; display: inline-block; }
.elx-mini { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: rgba(120,130,150,.14); margin-bottom: 10px; }
.elx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.elx-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink); }
.elx-chip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---- Winner card ---- */
.elx-winner { border-radius: 18px; padding: 22px; color: #fff; box-shadow: var(--shadow); }
.elx-winner .wtag { font-size: 13px; opacity: .9; }
.elx-winner .wrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 4px; }
.elx-winner .wname { font-size: 24px; font-weight: 800; }
.elx-winner .wparty { opacity: .92; }
.elx-winner .wvotes { font-size: 26px; font-weight: 800; text-align: right; }
.elx-winner .wmargin { display: inline-block; margin-top: 12px; background: rgba(255,255,255,.2); padding: 4px 14px; border-radius: 999px; font-size: 13px; }

/* ---- Candidate table ---- */
.elx-table { width: 100%; border-collapse: collapse; overflow: hidden; }
.elx-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 12px 14px; background: rgba(120,130,150,.06); }
.elx-table td { padding: 13px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.elx-table td.r, .elx-table th.r { text-align: right; }
.elx-table tr.win td { background: rgba(34,170,80,.08); }
.elx-cand { font-weight: 700; }
.elx-pdot { display: inline-flex; align-items: center; gap: 7px; }
.elx-pdot i { width: 10px; height: 14px; border-radius: 3px; }
.elx-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.elx-badge.won { background: rgba(34,170,80,.15); color: #1a8f43; }
.elx-badge.lead { background: rgba(240,160,20,.16); color: #b47800; }
.elx-badge.lost { background: rgba(120,130,150,.14); color: var(--muted); }

/* ---- Share ---- */
.elx-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 26px; }
.elx-share .lbl { font-size: 13px; color: var(--muted); }
.elx-share a, .elx-share button { border: 0; cursor: pointer; font: inherit; color: #fff; font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 999px; }
.elx-share .wa { background: #25D366; } .elx-share .fb { background: #1877F2; } .elx-share .tw { background: #111; }
.elx-share .cp { background: transparent; color: var(--ink); border: 1px solid var(--line); }

.elx-empty { color: var(--muted); padding: 24px; text-align: center; }
.elx-cards-list { display: flex; flex-direction: column; gap: 14px; }

/* ---- Sibling switcher (prev/next + quick picker) ---- */
.elx-switch { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; margin: 0 0 20px; }
.elx-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.elx-switch-btn { display: inline-flex; align-items: center; gap: 4px; max-width: 44%; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(120deg, var(--red-dark), var(--red)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 12px rgba(224,30,30,.22); }
.elx-switch-btn.is-off { background: rgba(120,130,150,.16); color: var(--muted); box-shadow: none; cursor: default; }
.elx-switch-pos { font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.elx-switch-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 148px; overflow-y: auto; padding-top: 2px; }
.elx-switch-chip { min-width: 40px; text-align: center; padding: 7px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--ink); background: rgba(120,130,150,.10); border: 1px solid transparent; transition: all .12s; }
.elx-switch-chip:hover { border-color: var(--red); color: var(--red); }
.elx-switch-chip.active { background: linear-gradient(120deg, var(--red-dark), var(--red)); color: #fff; box-shadow: 0 4px 12px rgba(224,30,30,.22); }

/* ---- Sponsored ad banner ---- */
.elx-ad { display: block; margin: 0 0 20px; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.elx-ad img { width: 100%; height: auto; display: block; }
