/* ══════════════════════════════════════════════════════════
   Eleições 2026 — CSS
   Stack: CSS custom properties, flexbox, grid.
   Zero dependências externas. Responsivo mobile-first.
   ══════════════════════════════════════════════════════════ */

:root {
    --el26-bg:          #0f172a;
    --el26-bg2:         #1e293b;
    --el26-bg3:         #334155;
    --el26-border:      #334155;
    --el26-text:        #f1f5f9;
    --el26-text-muted:  #94a3b8;
    --el26-accent:      #3b82f6;
    --el26-accent2:     #1d4ed8;
    --el26-green:       #22c55e;
    --el26-gold:        #f59e0b;
    --el26-radius:      12px;
    --el26-radius-sm:   6px;
    --el26-shadow:      0 4px 24px rgba(0,0,0,.4);
    --el26-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Reset cirúrgico — só box-sizing e fonte ─────────────── */
.el26-wrap, .el26-wrap * { box-sizing: border-box; }
/* Cor de texto explícita apenas onde é necessário (evita herdar dark do tema WP) */
.el26-wrap { color: var(--el26-text); }

/* ── Wrap ────────────────────────────────────────────────── */
.el26-wrap {
    font-family: var(--el26-font);
    background: var(--el26-bg);
    color: var(--el26-text);
    border-radius: var(--el26-radius);
    overflow: visible;          /* não clipar nada */
    box-shadow: var(--el26-shadow);
    width: 100%;                /* herda largura do Elementor */
    max-width: 100%;
    margin: 0 0 32px 0;
    position: relative;
    z-index: 1;
    clear: both;
}

/* ── Tema Light ──────────────────────────────────────────── */
.el26-tema-light,
.el26-tema-clean {
    --el26-bg:         #ffffff;
    --el26-bg2:        #f8fafc;
    --el26-bg3:        #e2e8f0;
    --el26-border:     #cbd5e1;
    --el26-text:       #0f172a;
    --el26-text-muted: #64748b;
    --el26-shadow:     0 4px 24px rgba(0,0,0,.08);
}

.el26-tema-light .el26-banner,
.el26-tema-clean .el26-banner {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 60%, #15803d 100%);
}

.el26-tema-light .el26-cargo-tabs,
.el26-tema-clean .el26-cargo-tabs {
    background: #f1f5f9;
    border-bottom-color: var(--el26-border);
}

.el26-tema-light .el26-tab,
.el26-tema-clean .el26-tab {
    color: #475569;
    border-color: var(--el26-border);
}

.el26-tema-light .el26-tab:hover,
.el26-tema-clean .el26-tab:hover {
    border-color: var(--el26-accent);
    color: var(--el26-accent);
    background: rgba(59,130,246,.06);
}

.el26-tema-light .el26-results-panel,
.el26-tema-clean .el26-results-panel {
    background: #ffffff;
}

.el26-tema-light .el26-panel-header,
.el26-tema-clean .el26-panel-header {
    background: #f8fafc;
}

.el26-tema-light .el26-turno-bar,
.el26-tema-clean .el26-turno-bar {
    background: #e2e8f0;
    color: #475569;
}

.el26-tema-light .el26-candidato:hover,
.el26-tema-clean .el26-candidato:hover {
    background: #f1f5f9;
}

.el26-tema-light .el26-candidato.liderando,
.el26-tema-clean .el26-candidato.liderando {
    background: rgba(59,130,246,.06);
}

.el26-tema-light .el26-candidato.eleito,
.el26-tema-clean .el26-candidato.eleito {
    background: rgba(34,197,94,.06);
}

.el26-tema-light .el26-map-wrap,
.el26-tema-clean .el26-map-wrap {
    background: #f8fafc;
}

.el26-tema-light .el26-brasil-svg [data-uf],
.el26-tema-clean .el26-brasil-svg [data-uf] {
    fill: #cbd5e1;
    stroke: #ffffff;
}

.el26-tema-light .el26-footer,
.el26-tema-clean .el26-footer {
    background: #f1f5f9;
    border-top-color: var(--el26-border);
}

.el26-tema-light .el26-skeleton,
.el26-tema-clean .el26-skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: el26-shimmer 1.4s infinite;
}

/* Clean: sem bordas arredondadas, mais minimalista */
.el26-tema-clean {
    --el26-radius:    0;
    --el26-radius-sm: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.el26-tema-clean .el26-tab        { border-radius: 4px; }
.el26-tema-clean .el26-candidato  { border-radius: 0; border-bottom: 1px solid var(--el26-border); }

/* ── Badge estado (presidente por estado) ────────────────── */
.el26-estado-badge {
    color: #60a5fa;
    font-weight: 700;
    font-size: 11px;
}

/* ── Nota de contexto no turno bar ──────────────────────────*/
.el26-state-note {
    font-size: 11px;
    font-weight: 400;
    color: var(--el26-text-muted);
    font-style: italic;
}

/* ── Banner topo ─────────────────────────────────────────── */
.el26-banner {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 60%, #14532d 100%);
    border-bottom: 1px solid var(--el26-border);
    padding: 16px 20px;
    position: relative;
    overflow: hidden;
}

.el26-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}

.el26-banner-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.el26-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.el26-flag { font-size: 32px; }

.el26-banner-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    text-transform: uppercase;
}

.el26-banner-sub {
    font-size: 12px;
    color: rgba(255,255,255,.85);   /* sempre branco — visível em dark e light */
    letter-spacing: 1px;
    text-transform: uppercase;
}

.el26-banner-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

/* Dot ao vivo */
.el26-live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.el26-live-dot.live {
    background: var(--el26-green);
    box-shadow: 0 0 0 0 rgba(34,197,94,.6);
    animation: el26-pulse 1.5s infinite;
}

.el26-live-dot.loading {
    background: var(--el26-gold);
    animation: el26-spin .8s linear infinite;
}

@keyframes el26-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.6); }
    70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

@keyframes el26-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.el26-update-time {
    color: var(--el26-text-muted);
    font-size: 11px;
    font-weight: 400;
}

/* ── Tabs de cargo ───────────────────────────────────────── */
.el26-cargo-tabs {
    display: flex;
    flex-wrap: wrap;         /* quebra linha no mobile */
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--el26-bg2);
    border-bottom: 1px solid var(--el26-border);
    position: relative;
    z-index: 10;             /* sempre acima do mapa SVG */
}

.el26-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--el26-border);
    background: transparent;
    color: var(--el26-text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
}

.el26-tab:hover {
    border-color: var(--el26-accent);
    color: var(--el26-text);
}

.el26-tab.active {
    background: var(--el26-accent);
    border-color: var(--el26-accent);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(59,130,246,.4);
}

.el26-tab-icon { font-size: 14px; }

.el26-upgrade-chip {
    margin-left: auto;
    font-size: 12px;
    color: var(--el26-gold);
    white-space: nowrap;
}

.el26-upgrade-chip a {
    color: inherit;
    text-decoration: underline;
}

/* ── Layout principal ────────────────────────────────────── */
.el26-main {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 0;
    min-height: 480px;
}

@media (max-width: 860px) {
    .el26-main { grid-template-columns: 1fr; }
}

/* ── Mapa ────────────────────────────────────────────────── */
.el26-map-wrap {
    background: var(--el26-bg2);
    border-right: 1px solid var(--el26-border);
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 12px;
}

.el26-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--el26-text-muted);
}

.el26-btn-reset {
    background: var(--el26-bg3);
    border: 1px solid var(--el26-border);
    color: var(--el26-text);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background .2s;
}

.el26-btn-reset:hover { background: var(--el26-bg); }

/* ── Container do mapa ───────────────────────────────────── */
.el26-map-svg-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 12px 8px;     /* respiro interno — mapa não cola nas bordas */
    min-height: 300px;
    position: relative;
    z-index: 0;
    overflow: visible;
}

.el26-map-loading, .el26-map-error {
    color: var(--el26-text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* SVG estático inline */
.el26-brasil-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Paths com data-uf (paths diretos, sem <g> wrapper) */
.el26-brasil-svg [data-uf] {
    fill: var(--el26-bg3);
    stroke: var(--el26-bg);
    stroke-width: 0.8;
    transition: fill .25s ease;
    cursor: pointer;
}

.el26-brasil-svg [data-uf].hovered {
    fill: var(--el26-accent) !important;
    stroke: rgba(255,255,255,.6);
    stroke-width: 1.5;
    filter: drop-shadow(0 2px 6px rgba(59,130,246,.5));
}

.el26-brasil-svg [data-uf].selected {
    stroke: #fff;
    stroke-width: 2;
    filter: drop-shadow(0 0 8px rgba(255,255,255,.3));
}

/* Labels dos estados */
.el26-estado-label {
    font-size: 7px;
    fill: #94a3b8;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    pointer-events: none;
    user-select: none;
}

/* Legenda */
.el26-legenda {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--el26-border);
}

.el26-legenda-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--el26-text-muted);
}

.el26-legenda-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.el26-legenda-pct {
    font-weight: 700;
    color: var(--el26-text);
}

/* ── Painel de resultados ────────────────────────────────── */
.el26-results-panel {
    background: var(--el26-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.el26-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--el26-border);
    background: var(--el26-bg2);
    gap: 12px;
}

.el26-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--el26-text);
}

.el26-panel-uf {
    font-size: 12px;
    color: var(--el26-text-muted);
    margin-top: 2px;
}

.el26-apuracao {
    text-align: right;
    min-width: 80px;
}

.el26-apuracao-pct {
    font-size: 20px;
    font-weight: 800;
    color: var(--el26-green);
    line-height: 1;
}

.el26-apuracao-label {
    font-size: 10px;
    color: var(--el26-text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
}

.el26-progress-outer {
    height: 4px;
    background: var(--el26-border);
    border-radius: 2px;
    overflow: hidden;
    width: 80px;
}

.el26-progress-inner {
    height: 100%;
    background: var(--el26-green);
    border-radius: 2px;
    transition: width .6s ease;
}

/* ── Candidatos ──────────────────────────────────────────── */
.el26-candidatos {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.el26-candidatos::-webkit-scrollbar { width: 4px; }
.el26-candidatos::-webkit-scrollbar-track { background: transparent; }
.el26-candidatos::-webkit-scrollbar-thumb { background: var(--el26-border); border-radius: 2px; }

.el26-candidato {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    border-radius: var(--el26-radius-sm);
    margin-bottom: 4px;
    transition: background .2s;
    border: 1px solid transparent;
}

.el26-candidato:hover {
    background: var(--el26-bg2);
}

.el26-candidato.liderando {
    background: rgba(59,130,246,.08);
    border-color: rgba(59,130,246,.2);
}

.el26-candidato.eleito {
    background: rgba(34,197,94,.08);
    border-color: rgba(34,197,94,.2);
}

.el26-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--el26-bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--el26-text-muted);
    flex-shrink: 0;
}

.el26-candidato.liderando .el26-rank {
    background: var(--el26-accent);
    color: #fff;
}

.el26-candidato.eleito .el26-rank {
    background: var(--el26-green);
    color: #fff;
}

.el26-candidato-nome {
    font-size: 14px;
    font-weight: 600;
    color: var(--el26-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.el26-candidato-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    font-size: 11px;
    color: var(--el26-text-muted);
}

.el26-partido {
    padding: 1px 6px;
    border-radius: 3px;
    color: #fff;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
}

.el26-eleito-badge {
    color: var(--el26-green);
    font-weight: 700;
    font-size: 11px;
}

.el26-candidato-votos {
    text-align: right;
    min-width: 80px;
}

.el26-votos-pct {
    font-size: 16px;
    font-weight: 800;
    color: var(--el26-text);
}

.el26-votos-num {
    font-size: 11px;
    color: var(--el26-text-muted);
    margin-bottom: 4px;
}

.el26-bar-outer {
    height: 4px;
    background: var(--el26-border);
    border-radius: 2px;
    overflow: hidden;
}

.el26-bar-inner {
    height: 100%;
    border-radius: 2px;
    transition: width .8s cubic-bezier(.4,0,.2,1);
    min-width: 2px;
}

/* ── Loading skeleton ────────────────────────────────────── */
.el26-loading { padding: 12px; }

.el26-skeleton {
    background: linear-gradient(90deg, var(--el26-bg2) 25%, var(--el26-bg3) 50%, var(--el26-bg2) 75%);
    background-size: 200% 100%;
    animation: el26-shimmer 1.4s infinite;
    border-radius: var(--el26-radius-sm);
}

@keyframes el26-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Error / Empty ───────────────────────────────────────── */
.el26-error, .el26-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--el26-text-muted);
    font-size: 13px;
}

.el26-error { color: #f87171; }

/* ── Urnas info ──────────────────────────────────────────── */
.el26-urnas-info {
    font-size: 10px;
    color: var(--el26-text-muted);
    margin-top: 3px;
    white-space: nowrap;
}

/* ── Turno bar ───────────────────────────────────────────── */
.el26-turno-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 14px;
    background: var(--el26-bg3);
    font-size: 11px;
    font-weight: 700;
    color: var(--el26-text-muted);
    letter-spacing: .5px;
    text-transform: uppercase;
}

.el26-demo-label {
    font-weight: 400;
    color: var(--el26-gold);
    font-size: 10px;
    text-transform: none;
    letter-spacing: 0;
}

/* ── Demo badge (tabs) ───────────────────────────────────── */
.el26-demo-badge {
    margin-left: auto;
    background: var(--el26-gold);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: .5px;
    white-space: nowrap;
}

/* ── Badges lider/eleito ─────────────────────────────────── */
.el26-lider-badge {
    color: var(--el26-accent);
    font-weight: 700;
    font-size: 11px;
}

.el26-num {
    color: var(--el26-text-muted);
}

/* ── Rodapé ──────────────────────────────────────────────── */
.el26-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--el26-bg2);
    border-top: 1px solid var(--el26-border);
    font-size: 11px;
    color: var(--el26-text-muted);
    flex-wrap: wrap;
    gap: 8px;
}

.el26-footer a {
    color: var(--el26-accent);
    text-decoration: none;
}

.el26-footer-badge a {
    color: var(--el26-gold);
}

/* ── Upgrade CTA ─────────────────────────────────────────── */
.el26-upgrade-cta {
    border-top: 1px solid var(--el26-border);
    background: linear-gradient(135deg, var(--el26-bg2), var(--el26-bg));
    padding: 20px;
}

.el26-upgrade-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(59,130,246,.06);
    border: 1px solid rgba(59,130,246,.2);
    border-radius: var(--el26-radius);
    padding: 16px 20px;
    flex-wrap: wrap;
}

.el26-upgrade-icon { font-size: 28px; }

.el26-upgrade-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--el26-text);
    margin-bottom: 8px;
}

.el26-upgrade-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 12px;
    color: var(--el26-text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.el26-upgrade-btn {
    margin-left: auto;
    background: var(--el26-accent);
    color: #fff !important;
    text-decoration: none !important;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    transition: background .2s, transform .1s;
    box-shadow: 0 4px 12px rgba(59,130,246,.4);
}

.el26-upgrade-btn:hover {
    background: var(--el26-accent2);
    transform: translateY(-1px);
}

/* ── Tooltip ─────────────────────────────────────────────── */
.el26-tooltip {
    position: absolute;
    z-index: 9999;
    background: var(--el26-bg2);
    color: var(--el26-text);
    border: 1px solid var(--el26-border);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
    display: none;
}

/* ── Responsivo ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .el26-main { grid-template-columns: 1fr; }
    .el26-map-wrap { border-right: none; border-bottom: 1px solid var(--el26-border); }
}

@media (max-width: 600px) {
    .el26-banner-title { font-size: 16px; }
    .el26-flag { font-size: 22px; }
    .el26-tab { padding: 6px 10px; font-size: 11px; }
    .el26-tab-icon { font-size: 12px; }
    .el26-candidato-nome { font-size: 13px; }
    .el26-votos-pct { font-size: 14px; }
    .el26-panel-header { flex-direction: column; gap: 8px; }
}
