/* ---- live-quakes ---- */
:root {
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --card: #ffffff;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.10);
  --accent: #1f6f9c;
}

html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #f8fafc;
}

/* ---- top bar ---- */
.site-header {
  position: fixed;
  top: 12px;
  left: 60px;
  z-index: 1000;
  max-width: calc(100% - 240px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  pointer-events: auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
  animation: pulse 1.6s ease-in-out infinite;
}
.brand strong { font-size: 15px; letter-spacing: 0.2px; }
.brand .subtitle { color: var(--muted); font-size: 12.5px; }
.src {
  font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 500;
}
.src:hover { text-decoration: underline; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.06); }
}

/* ---- map fills the viewport ---- */
#map-id {
  position: absolute;
  inset: 0;
}

/* ---- Leaflet popup, restyled Google-Maps-ish ---- */
.leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0;
}
.leaflet-popup-content {
  margin: 0;
  min-width: 220px;
  font-size: 13.5px;
  line-height: 1.45;
}
.leaflet-popup-tip { box-shadow: var(--shadow); }

.quake-popup { padding: 14px 16px; }
.quake-popup .mag {
  display: inline-block;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 6px;
}
.quake-popup h3 {
  margin: 4px 0 2px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.quake-popup .meta { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.quake-popup a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}
.quake-popup a:hover { text-decoration: underline; }

/* tooltip on hover */
.leaflet-tooltip.quake-tip {
  background: #111827;
  color: #f9fafb;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.leaflet-tooltip.quake-tip::before { display: none; }

/* ---- legend ---- */
.info.legend {
  padding: 10px 12px;
  background: var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  color: var(--ink);
  line-height: 18px;
}
.info.legend h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.info.legend .row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; min-height: 14px; }
.info.legend .swatch {
  flex: 0 0 auto;
  display: inline-block;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}

/* ---- layer control ---- */
.leaflet-control-layers {
  border-radius: 10px !important;
  box-shadow: var(--shadow) !important;
  border: none !important;
  font-size: 13px;
}

/* ---- earthquake-view radio control ---- */
.eq-view-control {
  background: var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow);
  border: none;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink);
  min-width: 180px;
}
.eq-view-control h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.eq-view-control label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  cursor: pointer;
}
.eq-view-control input[type="radio"] { margin: 0; cursor: pointer; }

/* ---- timeline mode picker (injected into slider control) ---- */
.eq-timeline-mode {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink);
}
.eq-timeline-mode-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.eq-timeline-mode label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  cursor: pointer;
}
.eq-timeline-mode input[type="radio"] { margin: 0; cursor: pointer; }
.eq-timeline-mode .hint { color: var(--muted); font-size: 12px; }

/* ---- attribution ---- */
.leaflet-control-attribution {
  background: rgba(255,255,255,0.85) !important;
  font-size: 11px !important;
  padding: 2px 6px !important;
  border-radius: 6px 0 0 0 !important;
}
