/* Container principal isolado */
.mapa-visual {
  position: relative;
  width: 100%;
  /* Se tiver um topo fixo no site, pode usar ex: calc(100vh - 60px) */
  /* height: 100vh; */
  height: 50vh; 
  overflow: hidden;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at center, #3f3f3f 0%, #2d2d2d 100%);
  color: #000000;
  box-sizing: border-box;
}

/* Reset restrito apenas aos elementos internos da section */
.mapa-visual *,
.mapa-visual *::before,
.mapa-visual *::after {
  box-sizing: border-box;
}

.mapa-visual #map-pai,
.mapa-visual #map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Botões de alternância de MAP_TYPES */
.mapa-visual .atalho-map {
  position: absolute;
  /* bottom: 24px; */
  /* left: 60px; */
  z-index: 20;
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  padding: 6px;
  /* border-radius: 8px; */
  border: 1px solid rgba(0, 51, 102, 0.2);
  box-shadow: 0 4px 16px rgba(0, 51, 102, 0.1);
}

.mapa-visual .atalho-link-mapa {
  text-decoration: none;
  color: #003366;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s ease;
  margin: 0;
}

.mapa-visual .atalho-link-mapa:hover {
  background: rgba(0, 51, 102, 0.08);
}

.mapa-visual .atalho-link-mapa.active {
  background: #003366;
  color: #ffffff;
}

/* Card flutuante sutil no canto superior direito */
.mapa-visual .state-hud {
  position: absolute;
  /* top: 20px; */
  right: 0;
  /* width: 280px; */
  max-width: 300px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 51, 102, 0.15);
  border-top: 4px solid #003366;
  /* border-radius: 10px; */
  padding: 14px 16px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 51, 102, 0.12);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mapa-visual .state-hud.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mapa-visual .hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 51, 102, 0.1);
}

.mapa-visual .hud-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #003366;
}

.mapa-visual .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.mapa-visual .hud-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.mapa-visual .hud-close:hover {
  color: #003366;
}

.mapa-visual .hud-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
}

.mapa-visual .hud-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mapa-visual .hud-label {
  color: #555555;
}

.mapa-visual .hud-value {
  color: #000000;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  text-align: right;
}

/* Botão de ação no card */
.mapa-visual .hud-action-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px 12px;
  background: #003366;
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.mapa-visual .hud-action-btn:hover {
  background: #002244;
  color: #ffffff;
}

/* Tooltip rápido ao passar o mouse */
.mapa-visual .map-tooltip {
  position: fixed;
  pointer-events: none;
  background: rgba(0, 51, 102, 0.92);
  color: #ffffff;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  z-index: 30;
  display: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Eleitoral */
/* Garante que #map_elei ocupe toda a section igual ao #map */
.mapa-visual #map_elei {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Cabeçalho de Apuração Eleitoral no topo esquerdo */
.mapa-visual .eleicao-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(0, 51, 102, 0.2);
  border-left: 4px solid #003366;
  box-shadow: 0 4px 16px rgba(0, 51, 102, 0.1);
  font-size: 13px;
  font-weight: 700;
  color: #003366;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mapa-visual .eleicao-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

/* Destaque do Candidato Líder dentro do Card */
.mapa-visual .cand-destaque {
  background: #f8fafc;
  border: 1px solid rgba(0, 51, 102, 0.12);
  border-left: 4px solid #003366;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.mapa-visual .cand-destaque-titulo {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 4px;
}

.mapa-visual .cand-destaque-nome {
  font-size: 15px;
  font-weight: 700;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mapa-visual .partido-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #003366;
  color: #ffffff;
}

/* Placar / Legenda de Candidatos no canto inferior esquerdo */
.mapa-visual .eleicao-legenda {
  position: absolute;
  bottom: 24px;
  left: 60px;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(0, 51, 102, 0.2);
  box-shadow: 0 4px 16px rgba(0, 51, 102, 0.1);
  min-width: 210px;
  max-width: 280px;
}

.mapa-visual .legenda-titulo {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #003366;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(0, 51, 102, 0.1);
}

.mapa-visual .legenda-lista {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 130px;
  overflow-y: auto;
}

.mapa-visual .legenda-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  gap: 10px;
}

.mapa-visual .legenda-cand {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #000000;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mapa-visual .legenda-count {
  font-size: 11px;
  font-weight: 700;
  color: #003366;
  background: rgba(0, 51, 102, 0.08);
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}
@media (max-width: 860px) {
    .mapa-visual .map-tooltip{
        display: none !important;
    }
}
/* da divisão */
.operations-map.mapa-visual {
  position: relative;
  width: 100%;
  height: 100vh; 
}

.mapa-visual #military-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mapa-visual button.hud-action-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.mapa-visual button.hud-action-btn:disabled {
  background: #94a3b8;
  color: #f8fafc;
  cursor: not-allowed;
  opacity: 0.75;
}