:root {
  --primary: #ef4444;
  --primary-dark: #dc2626;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --success: #10b981;
  --bg-dark: #0a0e1a;
  --bg-card: #1a1f35;
  --bg-card-hover: #242942;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  position: relative;
}
/* Top Navigation Bar */
#top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.98) 0%, rgba(10, 14, 26, 0.92) 100%);
  backdrop-filter: blur(12px);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
h1 {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 0.875rem;
  transition: all 0.3s ease;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: pulse 2s infinite;
}
.status-active .status-dot {
  background: var(--success);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
/* Map Container */
#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
/* Control Panel */
.control-panel {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  max-width: 90vw;
}
.radius-control {
  display: flex;
  align-items: center;
  gap: 12px;
}
.radius-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.radius-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  font-weight: 700;
  color: var(--accent-light);
  font-size: 0.875rem;
  min-width: 70px;
  justify-content: center;
}
#radius-slider {
  width: 140px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
}
#radius-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5);
  transition: all 0.2s ease;
}
#radius-slider::-webkit-slider-thumb:hover {
  background: var(--accent-light);
  transform: scale(1.15);
}
#radius-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5);
}
.divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}
.control-btn {
  padding: 10px 20px;
  border-radius: 16px;
  border: none;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.follow-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.follow-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}
.follow-btn.active {
  background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}
.follow-btn.active:hover {
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}
/* Incident Board */
#incident-board {
  position: absolute;
  top: 88px;
  right: 20px;
  width: 380px;
  max-height: calc(100vh - 180px);
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  resize: none;
}
#incident-board:hover {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
}
.board-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}
.board-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
}
.board-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 700;
  min-width: 32px;
  text-align: center;
}
.drag-handle {
  font-size: 1.5rem;
  opacity: 0.6;
  cursor: move;
}
#incident-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
#incident-list::-webkit-scrollbar {
  width: 6px;
}
#incident-list::-webkit-scrollbar-track {
  background: transparent;
}
#incident-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}
/* Resize Handles */
.resize-handle {
  position: absolute;
  z-index: 10;
}
.resize-right {
  right: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
}
.resize-right:hover {
  background: rgba(59, 130, 246, 0.3);
}
.resize-left {
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
}
.resize-left:hover {
  background: rgba(59, 130, 246, 0.3);
}
.resize-bottom {
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  cursor: ns-resize;
}
.resize-bottom:hover {
  background: rgba(59, 130, 246, 0.3);
}
.resize-corner {
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
}
.resize-corner::after {
  content: '';
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(255, 255, 255, 0.3);
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}
.resize-corner:hover::after {
  border-color: rgba(59, 130, 246, 0.6);
}
.incident-item {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.incident-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.incident-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2);
}
.incident-item:hover::before {
  opacity: 1;
}
.incident-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.incident-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  line-height: 1.3;
}
.incident-badge {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.incident-location {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}
.incident-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.incident-distance {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--accent-light);
  font-size: 0.875rem;
}
.incident-age {
  color: var(--text-secondary);
  font-size: 0.75rem;
}
.no-incidents {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}
.no-incidents-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}
/* Map Markers */
.user-marker {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.6);
}
.incident-marker {
  width: 16px;
  height: 16px;
  background: var(--primary);
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(239, 68, 68, 0.6);
  transition: transform 0.2s ease;
}
.incident-marker:hover {
  transform: scale(1.2);
}
/* Popup Styles */
.mapboxgl-popup-content {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-radius: 16px !important;
  padding: 16px !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
  min-width: 240px;
}
.popup-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  font-size: 1rem;
}
.popup-address {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}
.waze-btn {
  display: block;
  text-align: center;
  padding: 10px;
  background: linear-gradient(135deg, #33CCFF 0%, #0099CC 100%);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(51, 204, 255, 0.3);
}
.waze-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(51, 204, 255, 0.4);
}
/* Mobile Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 1.1rem;
  }
  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  .status-badge {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  .control-panel {
    bottom: 16px;
    padding: 12px 16px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .radius-control {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
  #radius-slider {
    width: 100%;
    order: 3;
    margin-top: 8px;
  }
  .divider {
    display: none;
  }
  #incident-board {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    top: auto;
    bottom: 120px;
    width: calc(100% - 32px);
    max-width: 420px;
    max-height: 45vh;
  }
  .board-header {
    padding: 14px 16px;
  }
  .board-title {
    font-size: 1rem;
  }
  #incident-list {
    padding: 12px;
  }
  .incident-item {
    padding: 14px;
  }
  /* Hide resize handles on mobile */
  .resize-handle {
    display: none;
  }
}
@media (max-width: 480px) {
  #top-bar {
    padding: 12px 16px;
  }
  .control-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
  }
  .radius-label {
    font-size: 0.8rem;
  }
  .radius-value {
    font-size: 0.8rem;
    padding: 5px 10px;
  }
}

/* ──────────────────────────────
   RADIUS CIRCLE – FINAL & PERFECT
   Works with layer IDs: radius-fill & radius-outline
   ────────────────────────────── */
@keyframes radiusPulse {
  0%, 100% { opacity: 0.14; }
  50%      { opacity: 0.26; }
}

/* Pulsing semi-transparent blue fill */
#radius-fill {
  animation: radiusPulse 4s ease-in-out infinite;
}

/* Crisp glowing outline */
#radius-outline {
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.7));
}

/* Extra glow on hover/focus (optional but cool) */
#radius-outline:hover {
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.9));
}
