/* ==========================================================================
   Mapa (Leaflet) — tema escuro, pins pulsantes e marcador do usuário
   ========================================================================== */
.leaflet-container { background: #140a24; font-family: var(--font); outline: 0; }
.leaflet-container a { color: var(--text-2); }
.leaflet-control-attribution {
  background: rgba(8, 7, 14, 0.55) !important;
  color: var(--text-3) !important;
  font-size: 9.5px !important;
  border-radius: 8px 0 0 8px;
  padding: 1px 6px !important;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.leaflet-control-attribution a { color: var(--text-2) !important; }
/* Isola as panes do Leaflet (z-index 200–700) para não passarem por cima da interface */
.explore__map, .loc__map, .pickmap { z-index: 0; isolation: isolate; }

/* Tiles do OpenStreetMap em modo noturno: inverte a luminância e devolve o matiz original */
.is-raster .leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) brightness(0.82) contrast(0.92) saturate(0.55); }
.is-raster::after { content: ''; position: absolute; inset: 0; z-index: 250; pointer-events: none; background: radial-gradient(120% 80% at 50% 40%, transparent 40%, rgba(11, 6, 24, 0.55) 100%), linear-gradient(180deg, rgba(123, 47, 247, 0.16), rgba(255, 62, 154, 0.12) 60%, rgba(255, 166, 77, 0.12)); mix-blend-mode: normal; }
.leaflet-fade-anim .leaflet-tile { transition: opacity 0.35s linear; }

.pin-host { background: none; border: 0; }

/* Pin de evento: anel da cor da lotação + pulsos cuja velocidade/tamanho seguem o movimento. */
.pin {
  --pc: var(--ok);
  position: relative; width: 52px; height: 52px;
  transition: transform 0.45s var(--spring);
  transform-origin: 50% 50%;
  cursor: pointer;
}
.pin.crowd--low { --pc: var(--ok); }
.pin.crowd--mid { --pc: var(--warn); }
.pin.crowd--high { --pc: var(--hot); }
.pin.crowd--max { --pc: var(--max); }

.pin__pulse {
  position: absolute; inset: 6px; border-radius: 50%;
  background: var(--pc); opacity: 0;
  will-change: transform, opacity;
}
.pin.is-live .pin__pulse { animation: pinPulse var(--pd, 2.2s) cubic-bezier(0.2, 0.6, 0.35, 1) infinite; }
.pin.is-live .pin__pulse + .pin__pulse { animation-delay: calc(var(--pd, 2.2s) / 2); }
@keyframes pinPulse {
  0% { transform: scale(0.75); opacity: 0.6; }
  100% { transform: scale(var(--ps, 2)); opacity: 0; }
}

.pin__core {
  position: absolute; inset: 7px; border-radius: 50%;
  background-color: #1a1626; background-size: cover; background-position: center;
  border: 3px solid var(--pc);
  box-shadow: 0 0 0 3px rgba(11, 6, 24, 0.85), 0 0 22px 2px var(--pc), 0 8px 18px rgba(0, 0, 0, 0.6);
  transition: border-color 0.6s, box-shadow 0.6s;
}
.pin.is-soon .pin__core { filter: saturate(0.75) brightness(0.9); box-shadow: 0 0 0 3px rgba(11, 6, 24, 0.85), 0 8px 18px rgba(0, 0, 0, 0.6); }

.pin__badge {
  position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 99px;
  background: var(--pc); color: #140a24;
  font-size: 10px; font-weight: 900; letter-spacing: 0.01em; white-space: nowrap;
  box-shadow: 0 0 0 2px rgba(11, 6, 24, 0.9);
  transition: background 0.6s;
}
.pin__badge .eq { width: 8px; height: 8px; color: #140a24; }
.pin__badge .eq b { box-shadow: none; }
.pin.is-soon .pin__badge { background: #fff; }

.pin__label {
  position: absolute; left: 50%; top: -34px;
  max-width: 180px; padding: 5px 10px; border-radius: 10px;
  background: rgba(12, 10, 20, 0.9); color: #fff;
  font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 1px solid var(--border-2);
  transform: translate(-50%, 6px) scale(0.9); opacity: 0;
  transition: opacity 0.25s, transform 0.35s var(--spring);
  pointer-events: none;
}

.pin.is-selected { transform: scale(1.3); z-index: 10; }
.pin.is-selected .pin__label { opacity: 1; transform: translate(-50%, 0) scale(0.77); }
.pin.is-selected .pin__core { border-width: 3.5px; }

/* Impulsionados: pin maior com halo neon */
.pin.is-boosted { transform: scale(1.16); }
.pin.is-boosted.is-selected { transform: scale(1.4); }
.pin.is-boosted::before {
  content: ''; position: absolute; inset: 1px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--lime), var(--cyan), var(--magenta), var(--lime));
  animation: spin 3s linear infinite;
  filter: blur(1px);
}
.pin.is-boosted .pin__core { inset: 5px; }

.pin--static { width: 44px; height: 44px; }
.pin--static .pin__core { inset: 4px; }

/* Você está aqui */
.me-host { background: none; border: 0; }
.me-dot { position: relative; width: 24px; height: 24px; }
.me-dot__core { position: absolute; inset: 4px; border-radius: 50%; background: #3b82f6; border: 3px solid #fff; box-shadow: 0 2px 10px rgba(59, 130, 246, 0.8); }
.me-dot__halo { position: absolute; inset: 0; border-radius: 50%; background: rgba(96, 165, 250, 0.5); animation: meHalo 2s ease-out infinite; }
@keyframes meHalo { from { transform: scale(0.8); opacity: 0.8; } to { transform: scale(3.2); opacity: 0; } }

/* Pin arrastável do editor */
.drop-pin { position: relative; width: 40px; height: 52px; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.55)); cursor: grab; }
.drop-pin::before { content: ''; position: absolute; left: 4px; top: 0; width: 32px; height: 32px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--grad); border: 3px solid #fff; }
.drop-pin span { position: absolute; left: 15px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.leaflet-dragging .drop-pin { cursor: grabbing; }

/* Mapa vetorial: brilho de pôr do sol nas bordas, sem cobrir os pins */
.leaflet-container:not(.is-raster)::after { content: ''; position: absolute; inset: 0; z-index: 250; pointer-events: none; background: radial-gradient(130% 85% at 50% 42%, transparent 52%, rgba(11, 6, 24, 0.5) 100%), linear-gradient(180deg, rgba(123, 47, 247, 0.08), transparent 40%, rgba(255, 92, 138, 0.07) 80%, rgba(255, 166, 77, 0.08)); }
.leaflet-gl-layer.maplibregl-map { z-index: 1; }
