/* ==========================================================
   GEOCOD — CSS compartilhado entre todos os mapas Trial
   Importar em cada mapa trial para manter visual padronizado.
   ========================================================== */

/* ── Variáveis de tema dark ─────────────────────────────── */
:root {
  --trial-bg: #050816;
  --trial-header-bg: #0b1120;
  --trial-sidebar-bg: #0f172a;
  --trial-border: rgba(148, 163, 233, 0.12);
  --trial-text: #e2e8f0;
  --trial-text-muted: #8b9dc3;
  --trial-accent: #5aa3ff;
  --trial-accent-dim: rgba(90, 163, 255, 0.12);
  --trial-glass-bg: rgba(15, 23, 42, 0.88);
  --trial-glass-border: rgba(148, 163, 233, 0.25);
  --trial-glass-hover-border: rgba(129, 140, 248, 0.9);
  --trial-geocodid-color: #818cf8;
  --trial-premium-lock: #f59e0b;
  --trial-cta-bg: rgba(90, 163, 255, 0.08);
  --trial-cta-border: rgba(90, 163, 255, 0.18);
}

/* ── Botões de controle do mapa (fullscreen, location, recenter) ─── */
.map-ctrl-btn {
  position: absolute;
  z-index: 1000;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--trial-glass-border);
  background: var(--trial-glass-bg);
  color: #ffffff;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: background 0.18s, transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.map-ctrl-btn:hover {
  transform: translateY(-1px);
  background: rgba(15, 23, 42, 0.98);
  border-color: var(--trial-glass-hover-border);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}

.map-ctrl-btn:active {
  transform: translateY(0);
}

.map-ctrl-btn svg {
  width: 18px;
  height: 18px;
}

/* Posicionamento padrão */
.map-ctrl-btn--fullscreen { top: 12px; right: 12px; }
.map-ctrl-btn--location   { top: 54px; right: 12px; }
.map-ctrl-btn--recenter   { top: 96px; right: 12px; }

/* Estado ativo (localização obtida) */
.map-ctrl-btn--location.active {
  background: rgba(37, 99, 235, 0.88);
  border-color: rgba(59, 130, 246, 0.9);
}

/* Tooltip via ::after */
.map-ctrl-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.map-ctrl-btn[data-tooltip]:hover::after {
  opacity: 1;
}

/* ── Popup Trial ────────────────────────────────────────── */
.trial-popup {
  max-width: 280px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.trial-popup-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.trial-popup-emoji {
  font-size: 1.3rem;
  line-height: 1;
}

.trial-popup-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #111827;
}

.trial-popup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.trial-popup-chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.7rem;
  font-weight: 500;
}

.trial-popup-geocodid {
  display: block;
  font-size: 0.75rem;
  color: var(--trial-geocodid-color, #818cf8);
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.trial-popup-desc {
  font-size: 0.78rem;
  color: #4b5563;
  margin-bottom: 4px;
  line-height: 1.3;
}

.trial-popup-date {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-bottom: 4px;
}

.trial-popup-location {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 6px;
}

/* Badge premium lock (rota bloqueada) */
.trial-popup-locked {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--trial-premium-lock, #f59e0b);
  font-size: 0.72rem;
  font-weight: 500;
  margin-bottom: 6px;
}

/* CTA upsell */
.trial-popup-cta {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--trial-cta-bg);
  border: 1px solid var(--trial-cta-border);
  font-size: 0.72rem;
  color: var(--trial-accent, #5aa3ff);
  line-height: 1.35;
  text-align: center;
}

.trial-popup-cta strong {
  font-weight: 700;
}

/* ── Badge trial no header ──────────────────────────────── */
.trial-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #64748b;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Painel busca GeocodID (trial) ──────────────────────── */
.geocod-search-panel {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--trial-glass-border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 0;
}

.geocod-search-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--trial-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.geocod-search-row {
  display: flex;
  gap: 6px;
}

.geocod-search-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--trial-glass-border);
  border-radius: 8px;
  color: var(--trial-text);
  font-size: 0.82rem;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.18s;
  min-width: 0;
}

.geocod-search-input:focus {
  border-color: var(--trial-accent);
}

.geocod-search-input::placeholder {
  color: var(--trial-text-muted);
  opacity: 0.7;
}

.geocod-search-btn {
  background: var(--trial-accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s, transform 0.15s;
}

.geocod-search-btn:hover {
  background: #3b82f6;
  transform: translateY(-1px);
}

.geocod-search-btn:active {
  transform: translateY(0);
}

.geocod-search-result {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--trial-glass-border);
  background: rgba(90, 163, 255, 0.06);
  display: none;
}

.geocod-search-result.visible { display: block; }

.geocod-search-result-id {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--trial-geocodid-color);
  margin-bottom: 3px;
}

.geocod-search-result-info {
  font-size: 0.75rem;
  color: var(--trial-text-muted);
  line-height: 1.4;
}

.geocod-search-result-coords {
  font-size: 0.7rem;
  color: var(--trial-text-muted);
  opacity: 0.7;
  margin-top: 3px;
}

.geocod-search-error {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-size: 0.75rem;
  display: none;
}

.geocod-search-error.visible { display: block; }

/* marcador geocoid no mapa (círculo indigo) */
.geocod-point-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #818cf8;
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.35), 0 2px 6px rgba(0,0,0,0.4);
}

/* ── Ajustar controles Leaflet ──────────────────────────── */
.leaflet-top.leaflet-right {
  top: 140px !important;
}

/* ── Spinner de carregamento ────────────────────────────── */
.map-loading {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--trial-bg, #050816);
  color: var(--trial-text-muted, #8b9dc3);
  font-size: 0.85rem;
}

.map-loading.hidden { display: none; }

.map-loading .spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(90, 163, 255, 0.2);
  border-top-color: var(--trial-accent, #5aa3ff);
  border-radius: 50%;
  animation: trial-spin 0.8s linear infinite;
}

@keyframes trial-spin {
  to { transform: rotate(360deg); }
}
