/* map-widget.css — estilos para MapWidget (Leaflet + overlays).
   Espelha o padrão visual de Marcas (basemap select, color legend, coords display). */

.tpf-map {
  position: relative;
  width: 100%;
  height: 100%;
  background: #0b1626;
  font-family: var(--font-sans);
}

.tpf-map-canvas {
  position: absolute;
  inset: 0;
}

/* ── Controles flutuantes ─────────────────────────────────── */
.tpf-map-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 220px;
}

.tpf-map-control-group {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  box-shadow: var(--shadow);
  font-size: 12px;
  color: var(--text);
}

.tpf-map-control-group h4 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 6px;
}

/* ── Basemap select ───────────────────────────────────────── */
.tpf-basemap-select {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font: 600 12px var(--font-sans);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  outline: none;
}

.tpf-basemap-select:focus { border-color: var(--accent); }

/* ── Color legend ─────────────────────────────────────────── */
.tpf-color-legend {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
  font-size: 11px;
  color: var(--text);
  min-width: 180px;
  display: none;
}

.tpf-color-legend.show { display: block; }

.tpf-color-legend-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 6px;
}

.tpf-color-legend-bar {
  height: 10px;
  width: 100%;
  border-radius: 999px;
  margin-bottom: 4px;
}

.tpf-color-legend-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
}

.tpf-color-legend-unit {
  margin-top: 3px;
  text-align: center;
  color: var(--text-3);
  font-size: 10px;
}

/* ── Coords display ───────────────────────────────────────── */
.tpf-coords {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
  box-shadow: var(--shadow);
  pointer-events: none;
}

/* ── Custom point markers ─────────────────────────────────── */
.tpf-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.4), 0 1px 4px rgba(15, 23, 42, 0.25);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}

.tpf-marker:hover {
  transform: scale(1.35);
  box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(0, 103, 255, 0.35);
}

.tpf-marker.selected {
  width: 18px;
  height: 18px;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-2), 0 2px 8px rgba(0, 103, 255, 0.45);
}

.tpf-marker.multi-selected {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 2px #ff6b6b, 0 2px 8px rgba(255, 107, 107, 0.4);
}

/* ── Popup tweaks ─────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius);
  font-family: var(--font-sans);
}

.leaflet-popup-content {
  margin: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}

.leaflet-popup-content strong { color: var(--accent); }
.leaflet-popup-content small  { color: var(--text-3); font-family: var(--font-mono); font-size: 10px; }

/* ── Empty / error state ──────────────────────────────────── */
.tpf-map-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-2);
  font-size: 13px;
  z-index: 400;
  pointer-events: none;
  text-align: center;
  padding: 24px;
}

.tpf-map-empty.hidden { display: none; }
