/* =============================================================
   GEOCOD Radar — CSS (tema escuro)
   ============================================================= */

:root {
  --bg: #050816;
  --bg-surface: #0b1220;
  --bg-card: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.08);
  --accent: #5aa3ff;
  --accent-glow: rgba(90,163,255,0.25);
  --text: #e6eefc;
  --text-muted: #8b9dc3;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ─── Header ──────────────────────────────────────────────── */
.radar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  height: 48px;
}

.radar-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.radar-header h1 span {
  font-weight: 400;
  opacity: 0.8;
  margin-left: 6px;
}

.radar-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Layout ──────────────────────────────────────────────── */
.radar-layout {
  display: flex;
  height: calc(100vh - 48px);
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.radar-sidebar {
  width: 320px;
  min-width: 280px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: margin-left 0.3s ease;
}

.radar-sidebar.collapsed {
  margin-left: -320px;
}

.sidebar-toggle {
  position: absolute;
  top: 8px;
  right: -28px;
  width: 28px;
  height: 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.radar-sidebar.collapsed .sidebar-toggle {
  right: -28px;
}

.sidebar-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.sidebar-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── Category chips ──────────────────────────────────────── */
.category-chips-wrapper {
  position: relative;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 80px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.category-chips.expanded {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 4px;
}

.category-chips::-webkit-scrollbar {
  width: 3px;
}

.category-chips::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.category-chip:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.category-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.category-chip .chip-emoji {
  font-size: 0.8rem;
}

/* Botão "Ver mais/menos" */
.category-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 4px 0;
  margin-top: 6px;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.category-toggle:hover {
  opacity: 1;
}

.category-toggle-icon {
  margin-left: 4px;
  transition: transform 0.2s;
}

.category-chips.expanded + .category-toggle .category-toggle-icon {
  transform: rotate(180deg);
}

/* ─── Type chips ──────────────────────────────────────────── */
.type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 4px;
}

.type-chips::-webkit-scrollbar {
  width: 3px;
}

.type-chips::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.type-chip {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.type-chip:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.type-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* ─── Inputs ──────────────────────────────────────────────── */
.radar-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s;
}

.radar-input:focus {
  border-color: var(--accent);
}

.radar-input option {
  background: var(--bg-surface);
  color: var(--text);
}

textarea.radar-input {
  resize: vertical;
}

/* ─── Search wrapper (autocomplete + clear) ──────────────── */
.search-wrapper {
  position: relative;
  width: 100%;
}

.search-wrapper .radar-input {
  padding-right: 32px;
}

.search-clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.search-clear-btn:hover {
  background: var(--danger);
  color: #fff;
}

/* Autocomplete dropdown */
.search-autocomplete {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 30;
}

.search-autocomplete::-webkit-scrollbar {
  width: 3px;
}

.search-autocomplete::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: var(--accent-glow);
}

.autocomplete-emoji {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.autocomplete-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.autocomplete-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-cat {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.autocomplete-empty, .autocomplete-more {
  padding: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

/* Fix datetime-local inputs no tema escuro */
input[type="datetime-local"].radar-input {
  color-scheme: dark;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 8px 10px;
}

input[type="datetime-local"].radar-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.8;
}

input[type="file"] {
  font-size: 0.78rem;
  color: var(--text-muted);
}

input[type="file"]::file-selector-button {
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 0.75rem;
  cursor: pointer;
  margin-right: 8px;
}

input[type="file"]::file-selector-button:hover {
  background: var(--accent-glow);
}

/* ─── Nearby ──────────────────────────────────────────────── */
.nearby-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}

.nearby-list, .feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

/* ─── Cards estilo anúncio (Nearby + Feed) ────────────────── */
.nearby-card, .feed-card {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 70px;
  animation: card-slide-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.nearby-card:nth-child(1) { animation-delay: 0s; }
.nearby-card:nth-child(2) { animation-delay: 0.05s; }
.nearby-card:nth-child(3) { animation-delay: 0.1s; }
.nearby-card:nth-child(4) { animation-delay: 0.15s; }
.nearby-card:nth-child(5) { animation-delay: 0.2s; }
.nearby-card:nth-child(6) { animation-delay: 0.25s; }

.feed-card:nth-child(1) { animation-delay: 0s; }
.feed-card:nth-child(2) { animation-delay: 0.04s; }
.feed-card:nth-child(3) { animation-delay: 0.08s; }
.feed-card:nth-child(4) { animation-delay: 0.12s; }
.feed-card:nth-child(5) { animation-delay: 0.16s; }

/* Paginação nearby sidebar */
.nearby-page-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 8px;
  margin-bottom: 4px;
}

.nearby-page-count {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nearby-page-dots {
  display: flex;
  gap: 5px;
}

.nearby-page-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nearby-page-dot:hover {
  background: var(--accent);
  transform: scale(1.3);
}

.nearby-page-dot.active {
  background: var(--success);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
  transform: scale(1.2);
}

@keyframes card-slide-in {
  0% {
    opacity: 0;
    transform: translateX(-12px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.nearby-card:hover, .feed-card:hover {
  background: linear-gradient(145deg, rgba(90,163,255,0.12) 0%, rgba(139,92,246,0.08) 100%);
  border-color: var(--accent);
  transform: translateX(4px) scale(1.01);
  box-shadow: -3px 0 0 var(--accent), 0 4px 16px rgba(90,163,255,0.2);
}

.nearby-card:active, .feed-card:active {
  transform: translateX(2px) scale(0.98);
  transition-duration: 0.08s;
}

/* Thumbnail (foto ou emoji fallback) */
.nearby-card-thumb, .feed-card-thumb {
  width: 56px;
  min-width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.nearby-card-thumb-emoji, .feed-card-thumb-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: linear-gradient(135deg, rgba(90,163,255,0.15) 0%, rgba(139,92,246,0.15) 100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nearby-card:hover .nearby-card-thumb-emoji,
.feed-card:hover .feed-card-thumb-emoji {
  transform: scale(1.15) rotate(8deg);
  background: linear-gradient(135deg, rgba(90,163,255,0.25) 0%, rgba(139,92,246,0.25) 100%);
}

/* Conteúdo do card */
.nearby-card-content, .feed-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.nearby-card-title, .feed-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nearby-card-meta, .feed-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
}

.nearby-card-category, .feed-card-category {
  color: var(--text-muted);
}

.nearby-card-distance, .feed-card-distance {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-size: 0.65rem;
  font-weight: 600;
}

/* Legacy support (fallback se ainda houver itens antigos) */
.nearby-item, .feed-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.nearby-item:hover, .feed-item:hover {
  background: var(--accent-glow);
}

.nearby-item-emoji, .feed-item-emoji {
  font-size: 1.2rem;
}

.nearby-item-info, .feed-item-info {
  flex: 1;
  min-width: 0;
}

.nearby-item-title, .feed-item-title {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nearby-item-meta, .feed-item-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ─── Main / Map ──────────────────────────────────────────── */
.radar-main {
  flex: 1;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

/* ─── Map buttons ─────────────────────────────────────────── */
.map-btn {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.map-btn:hover {
  background: var(--accent-glow);
}

/* Tooltip flutuante nos botoes do mapa */
.map-btn[data-tooltip] {
  position: absolute;
}

.map-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.85);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

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

.map-btn-fullscreen {
  top: 12px;
  right: 12px;
  font-size: 1.2rem;
}

.map-btn-location {
  top: 56px;
  right: 12px;
}

.map-btn-recenter {
  top: 100px;
  right: 12px;
}

/* Ajustar controles Mapbox (zoom +/-) para não conflitar com botões custom e sidebar */
.mapboxgl-ctrl-top-left {
  top: 12px !important;
  left: 12px;
}

/* Mover controles para bottom-left para não cobrir a sidebar */
.mapboxgl-ctrl-bottom-left {
  bottom: 100px !important;
  left: 12px;
}

/* ─── Fullscreen mode ─────────────────────────────────────── */
body.map-fullscreen .radar-header,
body.map-fullscreen .radar-sidebar {
  display: none !important;
}

body.map-fullscreen .radar-layout {
  height: 100vh;
}

body.map-fullscreen .radar-main {
  width: 100vw;
  height: 100vh;
}

/* ─── Category Fullscreen mode (ao clicar em categoria) ───── */
body.category-fullscreen .radar-header,
body.category-fullscreen .radar-sidebar {
  display: none !important;
}

body.category-fullscreen .radar-layout {
  height: 100vh;
}

body.category-fullscreen .radar-main {
  width: 100vw;
  height: 100vh;
}

/* Header flutuante da categoria em fullscreen */
.category-fullscreen-header {
  --cat-color: #5aa3ff;
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 2px solid var(--cat-color);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 20px rgba(90,163,255,0.15);
  z-index: 100;
  animation: cfh-appear 0.3s ease-out forwards;
}

body.category-fullscreen .category-fullscreen-header {
  display: flex;
}

@keyframes cfh-appear {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.cfh-emoji {
  font-size: 1.5rem;
}

.cfh-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cfh-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  margin-left: 4px;
}

.cfh-close:hover {
  background: var(--danger);
  color: #fff;
}

/* ─── FAB create (+) ──────────────────────────────────────── */
.fab-create {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  font-size: 2rem;
  font-weight: 300;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 6px 20px rgba(34,197,94,0.45), 0 0 0 0 rgba(34,197,94,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: fab-pulse 2s ease-in-out infinite;
}

.fab-create:hover {
  transform: scale(1.12) rotate(90deg);
  box-shadow: 0 8px 28px rgba(34,197,94,0.6), 0 0 0 8px rgba(34,197,94,0.15);
  animation: none;
}

.fab-create:active {
  transform: scale(1.05) rotate(90deg);
}

@keyframes fab-pulse {
  0%, 100% {
    box-shadow: 0 6px 20px rgba(34,197,94,0.45), 0 0 0 0 rgba(34,197,94,0.7);
  }
  50% {
    box-shadow: 0 6px 20px rgba(34,197,94,0.45), 0 0 0 12px rgba(34,197,94,0);
  }
}

/* ─── Create hint (mobile compact mode) ──────────────────── */
.create-hint-mobile {
  padding: 12px 16px;
  background: rgba(34, 197, 94, 0.12);
  color: #a5f3fc;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid var(--border);
  animation: hint-blink 1.5s ease-in-out infinite;
}
@keyframes hint-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ─── Create panel ────────────────────────────────────────── */
.create-panel {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 360px;
  max-width: 100%;
  max-height: 85vh;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 20;
  overflow-y: auto;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}

.create-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.create-panel-body {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.coords-display {
  font-size: 0.75rem;
  color: var(--accent);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(90,163,255,0.08);
  border: 1px solid rgba(90,163,255,0.15);
}

.create-actions {
  display: flex;
  gap: 8px;
}

.btn-primary {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.9; }

.btn-ghost {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-ghost:hover { background: rgba(255,255,255,0.04); }

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 4px;
}

.status-msg {
  font-size: 0.78rem;
  padding: 6px 0;
}

.status-msg.ok { color: var(--success); }
.status-msg.err { color: var(--danger); }

/* ─── Nav panel ───────────────────────────────────────────── */
.nav-panel {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  z-index: 15;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  min-width: 240px;
}

.nav-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.nav-panel-body {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-small-danger {
  padding: 4px 10px;
  border-radius: 999px;
  border: none;
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

/* ─── Map loading ─────────────────────────────────────────── */
.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg);
  z-index: 50;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: opacity 0.4s;
}

.map-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ─── Popup (Mapbox) ──────────────────────────────────────── */
.mapboxgl-popup-content {
  animation: popup-appear 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popup-appear {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(-16px);
  }
  60% {
    transform: scale(1.03) translateY(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.radar-popup {
  max-width: 300px;
  max-height: 55vh;
  overflow-y: auto;
  font-family: system-ui, -apple-system, sans-serif;
}

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

.radar-popup-emoji {
  font-size: 1.4rem;
}

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

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

.radar-popup-chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 500;
}

.radar-popup-owner {
  font-size: 0.74rem;
  color: rgba(139, 92, 246, 0.85);
  margin-bottom: 5px;
  font-style: italic;
}

.radar-popup-owner-name {
  font-weight: 700;
  color: rgba(167, 139, 250, 1);
  font-size: 0.82rem;
  font-style: normal;
  letter-spacing: 0.01em;
}

.radar-popup-geocodid {
  font-size: 0.72rem;
  color: #34d399;
  font-weight: 600;
  font-style: normal;
}

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

.radar-popup-img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 6px;
}

.radar-popup-date {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-bottom: 6px;
}

.radar-popup-warning {
  font-size: 0.75rem;
  color: #f59e0b;
  background: rgba(251, 191, 36, 0.1);
  padding: 6px 8px;
  border-radius: 4px;
  border-left: 3px solid #f59e0b;
  margin: 8px 0;
  font-weight: 500;
}

.radar-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.radar-popup-action-link,
.radar-popup-btn {
  color: #1f2937 !important;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.16s ease-out;
  -webkit-user-select: none;
  user-select: none;
}

button.radar-popup-btn {
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}

.radar-popup-action-link:hover,
.radar-popup-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

.radar-popup-action-link:active,
.radar-popup-btn:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.06s;
}

/* Destaques por destino */
.radar-popup-action-link[href*="google.com/maps"] {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1e40af !important;
}
.radar-popup-action-link[href*="waze.com"] {
  background: #dbeafe;
  border-color: #38bdf8;
  color: #0c4a6e !important;
}
.radar-popup-action-link[href*="uber.com"] {
  background: #1f2937;
  border-color: #374151;
  color: #f9fafb !important;
}

.radar-popup-btn.route {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46 !important;
}
.radar-popup-btn.nav {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1e40af !important;
}
.radar-popup-btn.clear-route {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e !important;
}
.radar-popup-btn.edit {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e !important;
}
.radar-popup-btn.delete {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b !important;
}
.radar-popup-credits-msg {
  font-size: 0.75rem;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 6px;
  text-align: center;
}

/* ─── Emoji marker (drop-pin moderno) ────────────────────── */
.radar-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 46px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2.5px solid #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  animation: marker-drop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.radar-marker .marker-emoji {
  transform: rotate(45deg);
  font-size: 1.15rem;
  line-height: 1;
  animation: emoji-idle 3s ease-in-out infinite;
}

@keyframes emoji-idle {
  0%, 100% { transform: rotate(45deg) scale(1); }
  50% { transform: rotate(45deg) scale(1.12); }
}

.radar-marker:hover {
  transform: rotate(-45deg) scale(1.18);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 3px rgba(255,255,255,0.15);
  z-index: 80 !important;
}

.radar-marker:hover .marker-emoji {
  animation: emoji-hover-wiggle 0.5s ease-in-out;
}

@keyframes emoji-hover-wiggle {
  0% { transform: rotate(45deg) scale(1); }
  25% { transform: rotate(55deg) scale(1.2); }
  50% { transform: rotate(35deg) scale(1.25); }
  75% { transform: rotate(50deg) scale(1.15); }
  100% { transform: rotate(45deg) scale(1.12); }
}

/* Marker próximo do usuário (dentro do raio) - destaque pulsante */
.radar-marker.nearby-highlight {
  animation: marker-drop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             nearby-pulse 2s ease-in-out infinite 0.5s;
  border-color: #22c55e;
  box-shadow: 0 3px 10px rgba(34, 197, 94, 0.5);
}

.radar-marker.nearby-highlight::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50% 50% 50% 0;
  border: 2px solid rgba(34, 197, 94, 0.6);
  animation: nearby-ring 2s ease-out infinite;
}

@keyframes nearby-pulse {
  0%, 100% {
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.5);
  }
  50% {
    box-shadow: 0 3px 20px rgba(34, 197, 94, 0.8), 0 0 0 4px rgba(34, 197, 94, 0.2);
  }
}

@keyframes nearby-ring {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

@keyframes marker-drop {
  0% {
    opacity: 0;
    transform: rotate(-45deg) translateY(-30px) scale(0.5);
  }
  60% {
    transform: rotate(-45deg) translateY(5px) scale(1.1);
  }
  100% {
    opacity: 1;
    transform: rotate(-45deg) translateY(0) scale(1);
  }
}

/* Badge de contagem de pins próximos (posição fixa no mapa, canto superior direito) */
.nearby-alert-badge {
  position: fixed;
  top: 56px;
  right: 60px;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.95) 0%, rgba(22, 163, 74, 0.95) 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.5);
  animation: badge-appear 0.3s ease-out forwards;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
}

.nearby-alert-badge .badge-pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: inherit;
  animation: badge-pulse-ring 2s ease-out infinite;
  z-index: -1;
}

.nearby-alert-badge.visible {
  display: flex;
}

.nearby-alert-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(34, 197, 94, 0.7);
  filter: brightness(1.1);
}

.nearby-alert-badge:active {
  transform: scale(0.95);
  transition-duration: 0.08s;
}

@keyframes badge-appear {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes badge-pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Ajustar posição do badge em diferentes modos */
body.map-fullscreen .nearby-alert-badge,
body.category-fullscreen .nearby-alert-badge {
  top: 12px;
  right: 60px;
}

/* ─── Mini-radar visual na sidebar ───────────────────────────── */
.mini-radar-container {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mini-radar-empty {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 16px;
  text-align: center;
}

.mini-radar {
  position: relative;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(34, 197, 94, 0.08) 0%, rgba(34, 197, 94, 0.02) 100%);
  border: 1px solid rgba(34, 197, 94, 0.3);
  overflow: hidden;
}

/* Círculos concêntricos do radar */
.radar-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(34, 197, 94, 0.3);
  pointer-events: none;
}

.radar-ring-1 {
  width: 20%;
  height: 20%;
  top: 40%;
  left: 40%;
}

.radar-ring-2 {
  width: 40%;
  height: 40%;
  top: 30%;
  left: 30%;
}

.radar-ring-3 {
  width: 70%;
  height: 70%;
  top: 15%;
  left: 15%;
}

.radar-ring-4 {
  width: 95%;
  height: 95%;
  top: 2.5%;
  left: 2.5%;
  border-style: solid;
  border-color: rgba(34, 197, 94, 0.4);
}

/* Linha de varredura animada */
.radar-sweep {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.8) 0%, transparent 100%);
  transform-origin: left center;
  animation: radar-sweep 4s linear infinite;
}

@keyframes radar-sweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Centro do radar (você) */
.radar-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  box-shadow: 0 0 12px rgba(90, 163, 255, 0.6);
  z-index: 5;
  animation: radar-center-pulse 2s ease-in-out infinite;
}

@keyframes radar-center-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(90, 163, 255, 0.6); }
  50% { box-shadow: 0 0 20px rgba(90, 163, 255, 0.9), 0 0 0 6px rgba(90, 163, 255, 0.2); }
}

/* Labels de distância no radar */
.radar-label {
  position: absolute;
  font-size: 0.55rem;
  color: rgba(34, 197, 94, 0.7);
  font-weight: 500;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Pontos dos eventos no radar */
.radar-point {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: radar-point-appear 0.5s ease-out forwards, radar-point-blink 2s ease-in-out infinite 0.5s;
}

.radar-point:hover {
  transform: translate(-50%, -50%) scale(1.6);
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  filter: brightness(1.4) saturate(1.3);
}

.radar-point::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0;
  transition: opacity 0.2s, transform 0.3s;
  transform: scale(0.8);
}

.radar-point:hover::after {
  opacity: 0.6;
  transform: scale(1.6);
}

.radar-point-emoji {
  font-size: 0.6rem;
  line-height: 1;
}

@keyframes radar-point-appear {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes radar-point-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Legenda do mini-radar */
.mini-radar-legend {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ─── Animação de entrada (2 min de destaque) ────────────────── */
body.radar-entry-animation .radar-marker.nearby-highlight {
  animation: marker-drop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             entry-nearby-pulse 1.5s ease-in-out infinite 0.5s;
}

body.radar-entry-animation .radar-marker.nearby-highlight::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(34, 197, 94, 0.5);
  animation: entry-radar-wave 2s ease-out infinite;
  pointer-events: none;
}

@keyframes entry-nearby-pulse {
  0%, 100% {
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.5), 0 0 0 0 rgba(34, 197, 94, 0.4);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 3px 25px rgba(34, 197, 94, 0.9), 0 0 0 8px rgba(34, 197, 94, 0.3);
    filter: brightness(1.2);
  }
}

@keyframes entry-radar-wave {
  0% {
    transform: translate(-50%, -50%) rotate(45deg) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) rotate(45deg) scale(2);
    opacity: 0;
  }
}

/* ─── Destaque ao clicar em card/radar ───────────────────────── */
.radar-marker.marker-highlight-click {
  animation: marker-highlight-click 0.5s ease-out forwards,
             marker-highlight-pulse 1s ease-in-out infinite 0.5s !important;
  z-index: 100 !important;
}

.radar-marker.marker-highlight-click::before {
  content: '👆';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  font-size: 1.2rem;
  animation: pointer-bounce 0.8s ease-in-out infinite;
}

@keyframes marker-highlight-click {
  0% {
    transform: rotate(-45deg) scale(1);
  }
  30% {
    transform: rotate(-45deg) scale(1.4);
  }
  100% {
    transform: rotate(-45deg) scale(1.2);
  }
}

@keyframes marker-highlight-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(90, 163, 255, 0.7), 0 4px 15px rgba(90, 163, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(90, 163, 255, 0), 0 4px 20px rgba(90, 163, 255, 0.8);
  }
}

@keyframes pointer-bounce {
  0%, 100% { transform: translateX(-50%) rotate(45deg) translateY(0); }
  50% { transform: translateX(-50%) rotate(45deg) translateY(-8px); }
}

/* ─── Animação quando mapa move e mostra novos pontos próximos ── */
.radar-marker.newly-visible {
  animation: marker-slide-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes marker-slide-in {
  0% {
    opacity: 0;
    transform: rotate(-45deg) translateY(-50px) scale(0.3);
  }
  60% {
    transform: rotate(-45deg) translateY(10px) scale(1.1);
  }
  100% {
    opacity: 1;
    transform: rotate(-45deg) translateY(0) scale(1);
  }
}

/* Pin de criacao (verde, preciso) */
.radar-create-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 42px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--success);
  border: 2.5px solid #fff;
  box-shadow: 0 3px 12px rgba(34,197,94,0.5);
  cursor: grab;
}

.radar-create-pin .pin-icon {
  transform: rotate(45deg);
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
  line-height: 1;
}

/* ─── User location pin (ponto azul pulsante fixo) ───────── */
.user-location-pin {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(90,163,255,0.6);
  z-index: 5;
}

.user-location-pin .pin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: user-dot-pulse 1.5s ease-in-out infinite;
}

.user-location-pin .pin-pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(90,163,255,0.6);
  animation: user-pulse-ring 2s ease-out infinite;
}

@keyframes user-dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

@keyframes user-pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* Animação de pulse constante no pin de localização */
.user-location-pin::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  animation: user-location-glow 2s ease-in-out infinite;
  z-index: -1;
}

@keyframes user-location-glow {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.4); opacity: 0.1; }
}

/* ─── Nav user marker (durante navegacao - pulsante) ─────── */
.nav-user-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 40px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  border: 3px solid #fff;
  box-shadow: 0 4px 16px rgba(90,163,255,0.6);
  animation: nav-pulse-strong 1.2s ease-in-out infinite;
  position: relative;
}

.nav-user-marker::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50% 50% 50% 0;
  background: inherit;
  animation: nav-ripple 1.5s ease-out infinite;
  opacity: 0;
}

.nav-user-marker .nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(255,255,255,0.8);
  animation: nav-dot-pulse 1s ease-in-out infinite;
}

@keyframes nav-pulse-strong {
  0%, 100% {
    transform: rotate(-45deg) scale(1);
    box-shadow: 0 4px 16px rgba(90,163,255,0.6);
  }
  50% {
    transform: rotate(-45deg) scale(1.08);
    box-shadow: 0 4px 24px rgba(90,163,255,0.9), 0 0 0 8px rgba(90,163,255,0.3);
  }
}

@keyframes nav-ripple {
  0% {
    transform: rotate(45deg) scale(1);
    opacity: 0.6;
  }
  100% {
    transform: rotate(45deg) scale(2);
    opacity: 0;
  }
}

@keyframes nav-dot-pulse {
  0%, 100% { transform: rotate(45deg) scale(1); }
  50% { transform: rotate(45deg) scale(1.3); }
}

/* ─── Tooltip flutuante nos markers do mapa ──────────────── */
.marker-tooltip {
  display: none;
  position: fixed;
  z-index: 200;
  transform: translateX(-50%) translateY(-100%);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.72rem;
  color: var(--text);
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  pointer-events: none;
  max-width: 260px;
  min-width: 160px;
  animation: marker-tooltip-in 0.15s ease-out forwards;
}

.marker-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

@keyframes marker-tooltip-in {
  0% { opacity: 0; transform: translateX(-50%) translateY(-100%) scale(0.9); }
  100% { opacity: 1; transform: translateX(-50%) translateY(-100%) scale(1); }
}

.marker-tooltip-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.marker-tooltip-emoji {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.marker-tooltip-header strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.marker-tooltip-row {
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 1px 0;
}

.marker-tooltip-status {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: auto;
  flex-shrink: 0;
}

.marker-tooltip-status.active {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.marker-tooltip-status.ended {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* ─── Tooltip do mini-radar ───────────────────────────────── */
.radar-tooltip {
  display: none;
  position: absolute;
  z-index: 30;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.7rem;
  color: var(--text);
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  pointer-events: none;
  max-width: 180px;
  white-space: nowrap;
}

.radar-tooltip strong {
  display: block;
  font-size: 0.75rem;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* ─── Pin de destino (durante rota/navegação) ────────────── */
.destination-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  pointer-events: none;
}

.destination-pin-head {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.45), 0 4px 16px rgba(0,0,0,0.5);
  animation: dest-pulse 1.8s ease-in-out infinite;
}

.destination-pin-emoji {
  font-size: 1rem;
  line-height: 1;
}

.destination-pin-stem {
  width: 3px;
  height: 18px;
  background: #fff;
  border-radius: 0 0 2px 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Label "Destino": position absolute para NÃO afetar offsetHeight do marker.
   Mapbox usa offsetHeight para calcular anchor: "bottom". */
.destination-pin-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 2px;
  background: rgba(239, 68, 68, 0.92);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  letter-spacing: 0.03em;
}

@keyframes dest-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.45), 0 4px 16px rgba(0,0,0,0.5); }
  50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.15), 0 4px 20px rgba(0,0,0,0.6); }
}

/* ─── Botão flutuante "Limpar rota" ──────────────────────── */
.clear-route-float {
  position: fixed;
  bottom: 90px;
  right: 16px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(185, 28, 28, 0.95) 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.5), 0 0 0 2px rgba(255,255,255,0.15);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: clear-route-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: system-ui, -apple-system, sans-serif;
}

.clear-route-float:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.7), 0 0 0 3px rgba(255,255,255,0.2);
}

.clear-route-float:active {
  transform: scale(0.95);
  transition-duration: 0.08s;
}

@keyframes clear-route-appear {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ─── Responsivo mobile ───────────────────────────────────── */
@media (max-width: 768px) {
  .radar-layout {
    flex-direction: column;
  }

  .radar-sidebar {
    width: 100%;
    min-width: unset;
    max-height: 35vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .radar-sidebar.collapsed {
    margin-left: 0;
    max-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .sidebar-toggle {
    position: fixed;
    top: 52px;
    left: 4px;
    right: unset;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: none;
    z-index: 20;
  }

  .radar-main {
    height: 65vh;
  }

  .create-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: var(--radius) var(--radius) 0 0;
    z-index: 100;
  }

  /* Mobile: painel começa compacto (só header) até selecionar ponto */
  .create-panel.compact .create-panel-body {
    display: none;
  }
  .create-panel.compact {
    max-height: unset;
  }
}

/* ─── Scrollbar ───────────────────────────────────────────── */
.radar-sidebar::-webkit-scrollbar,
.nearby-list::-webkit-scrollbar,
.feed-list::-webkit-scrollbar {
  width: 4px;
}

.radar-sidebar::-webkit-scrollbar-thumb,
.nearby-list::-webkit-scrollbar-thumb,
.feed-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ─── Mapbox popup override (dark) ────────────────────────── */
.mapboxgl-popup-content {
  border-radius: var(--radius) !important;
  padding: 12px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25) !important;
}

.mapboxgl-popup-close-button {
  font-size: 1.1rem;
  color: #6b7280;
  padding: 2px 6px;
}

/* ─── Nearby pins fixos no mapa (toggle) ─────────────────── */
.radar-marker.nearby-fixed {
  z-index: 50 !important;
  border-color: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.3), 0 4px 16px rgba(34, 197, 94, 0.6);
  animation: marker-drop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             nearby-fixed-pulse 1.8s ease-in-out infinite 0.5s !important;
}

@keyframes nearby-fixed-pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.3), 0 4px 16px rgba(34, 197, 94, 0.6);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.15), 0 4px 24px rgba(34, 197, 94, 0.9);
    filter: brightness(1.15);
  }
}

/* Popup/label fixo de nearby — card interativo */
.nearby-fixed-popup .mapboxgl-popup-content {
  background: rgba(5, 8, 22, 0.94) !important;
  border: 1px solid rgba(34, 197, 94, 0.35) !important;
  padding: 0 !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 0 1px rgba(34, 197, 94, 0.1) !important;
  animation: nf-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.nearby-fixed-popup .mapboxgl-popup-content:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 28px rgba(34, 197, 94, 0.35), 0 0 0 2px rgba(34, 197, 94, 0.25) !important;
  border-color: rgba(34, 197, 94, 0.6) !important;
}

.nearby-fixed-popup .mapboxgl-popup-tip {
  border-top-color: rgba(5, 8, 22, 0.94) !important;
}

.nearby-fixed-popup .mapboxgl-popup-close-button {
  display: none;
}

/* Card nearby rico */
.nf-card {
  padding: 8px 12px;
}

.nf-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nf-card-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.nf-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.nf-emoji-bounce {
  font-size: 1.2rem;
  flex-shrink: 0;
  animation: nf-emoji-bounce 2s ease-in-out infinite;
}

@keyframes nf-emoji-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-3px) scale(1.1); }
  50% { transform: translateY(0) scale(1); }
  75% { transform: translateY(-1px) scale(1.05); }
}

.nf-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #e6eefc;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.nf-meta {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nf-cat {
  font-size: 0.6rem;
  color: #8b9dc3;
  font-weight: 500;
}

.nf-type {
  font-size: 0.7rem;
}

.nf-dist {
  font-size: 0.62rem;
  font-weight: 700;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
  padding: 2px 7px;
  border-radius: 999px;
}

.nf-time {
  font-size: 0.58rem;
  font-weight: 600;
  color: #fbbf24;
}

.nf-card-action {
  text-align: center;
  padding: 3px 0 1px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 5px;
}

.nf-tap-hint {
  font-size: 0.55rem;
  color: rgba(34, 197, 94, 0.6);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  animation: nf-hint-pulse 2.5s ease-in-out infinite;
}

@keyframes nf-hint-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes nf-appear {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Badge flutuante ativo (toggle ON) */
.nearby-alert-badge.nearby-fixed-active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 1) 0%, rgba(22, 163, 74, 1) 100%) !important;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.7), 0 0 0 3px rgba(34, 197, 94, 0.3);
}

.nearby-alert-badge.nearby-fixed-active .badge-icon::after {
  content: " ON";
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Badge da sidebar ativo */
.nearby-badge.nearby-badge-active {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
  animation: badge-sidebar-pulse 1.5s ease-in-out infinite;
}

@keyframes badge-sidebar-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
  50% { box-shadow: 0 0 16px rgba(34, 197, 94, 0.8); }
}

/* Tooltip abaixo do marker (quando não cabe acima) */
.marker-tooltip.tooltip-below {
  transform: translateX(-50%) translateY(0) !important;
}

.marker-tooltip.tooltip-below::after {
  top: -6px;
  bottom: auto;
  transform: translateX(-50%) rotate(225deg);
}

/* ─── Mobile performance: reduzir animações ─────────────── */
.radar-mobile .marker-emoji,
.radar-mobile .nf-emoji-bounce,
.radar-mobile .nf-tap-hint,
.radar-mobile .radar-marker.nearby-fixed {
  animation: none !important;
}

.radar-mobile .nearby-fixed-popup .mapboxgl-popup-content {
  animation: none !important;
  transition: none !important;
}

.radar-mobile .nearby-fixed-popup .mapboxgl-popup-content:hover {
  transform: none;
}

.radar-mobile .destination-pin {
  animation: none !important;
  opacity: 1;
}

.radar-mobile .nearby-card,
.radar-mobile .feed-card {
  animation: none !important;
}

.radar-mobile .clear-route-float {
  animation: none !important;
  opacity: 1;
}

.radar-mobile .radar-marker:hover .marker-emoji {
  animation: none !important;
}

.radar-mobile .nearby-alert-badge.nearby-fixed-active,
.radar-mobile .nearby-badge.nearby-badge-active {
  animation: none !important;
}
