/* ── Leaflet Marker Selection Halo ── */
@keyframes marker-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
    box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.4);
  }

  70% {
    transform: scale(1.4);
    opacity: 0;
    box-shadow: 0 0 0 20px rgba(29, 185, 84, 0);
  }

  100% {
    transform: scale(1);
    opacity: 0;
    box-shadow: 0 0 0 0 rgba(29, 185, 84, 0);
  }
}

.selected-marker-halo {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-dim);
  border: 2px solid var(--brand);
  top: -4px;
  left: -4px;
  z-index: -1;
  animation: marker-pulse 2s infinite;
  pointer-events: none;
}

/* ── 18. Leaflet / Map ────────────────────────────────────── */
#map-container {
  width: 100%;
  height: 100%;
}

.leaflet-container {
  background: var(--bg-app) !important;
}

.leaflet-control-attribution {
  display: none !important;
}

.leaflet-control-zoom a {
  background: var(--bg-surface) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border-light) !important;
  box-shadow: var(--shadow-sm) !important;
  font-weight: 600 !important;
}

.leaflet-control-zoom a:hover {
  color: var(--brand) !important;
}

.emoji-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  transition: transform 0.2s var(--t-spring), box-shadow 0.2s ease;
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.emoji-marker:hover {
  transform: scale(1.18);
  box-shadow: var(--shadow-lg);
}

.emoji-marker.status-available {
  background: var(--brand-light);
  border-color: var(--brand);
}

.emoji-marker.status-on_rental {
  background: var(--indigo-light);
  border-color: var(--indigo);
}

.emoji-marker.status-restricted {
  background: var(--warning-light);
  border-color: var(--warning);
}

.emoji-marker.status-killed {
  background: var(--danger-light);
  border-color: var(--danger);
}

.emoji-marker.status-maintenance {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

/* Map controls */
.map-controls {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: all;
}

.map-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-full);
  padding: 8px 16px;
  box-shadow: var(--shadow-md);
  width: 270px;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.map-search:focus-within {
  border-color: var(--brand);
  box-shadow: var(--brand-glow), var(--shadow-md);
}

.map-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
}

.map-search input::placeholder {
  color: var(--text-tertiary);
}

.map-filter-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  border-radius: var(--r-md);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-fast);
  cursor: pointer;
}

.map-filter-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Filter Drawer */
.filter-drawer {
  position: absolute;
  left: -300px;
  top: 0;
  bottom: 0;
  width: 270px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  z-index: 999;
  transition: left var(--t-spring);
  padding: 76px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.filter-drawer.open {
  left: 0;
}

.filter-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: block;
  margin-bottom: 7px;
}

.filter-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.filter-chip {
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
}

.filter-chip.active {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand-dark);
  font-weight: 600;
}

.filter-chip:hover:not(.active) {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ── 19. Replay Controls ──────────────────────────────────── */
.replay-controls {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.replay-playback {
  display: flex;
  align-items: center;
  gap: 9px;
}

.replay-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--r-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--t-fast);
}

.replay-btn:hover,
.replay-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: var(--brand-glow);
}

.replay-scrub {
  flex: 1;
  accent-color: var(--brand);
  cursor: pointer;
}

.replay-timestamp {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--indigo);
  white-space: nowrap;
  min-width: 44px;
  text-align: center;
}

.replay-speed-btns {
  display: flex;
  gap: 4px;
}

.speed-btn {
  padding: 3px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}

.speed-btn.active {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.audit-icon {
  font-size: 16px;
  cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}
