/* ── BUIENRADAR MONITOR — dark theme, knuvers-stijl ───────────────────────── */

:root {
  --bg:        #0f1117;
  --surface:   #1a1d2e;
  --surface2:  #232740;
  --surface3:  #2c3054;
  --border:    #2d3148;
  --primary:   #4f6ef7;
  --primary-h: #6481ff;
  --success:   #20c997;
  --danger:    #f03e3e;
  --warning:   #f59f00;
  --info:      #4dadf7;
  --text:      #e4e6f0;
  --muted:     #7b7f9e;
  --dim:       #4a4e6e;
  --radius:    12px;
  --radius-sm: 8px;
  --trans:     .18s ease;
  --shadow:    0 4px 16px rgba(0,0,0,.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.45;
}

a { color: var(--primary-h); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── HEADER ───────────────────────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 2px 8px rgba(79,110,247,.35);
}
.logo h1 { font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
.logo-sub { color: var(--muted); font-size: 13px; font-weight: 400; margin-left: 4px; }

.header-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.header-loc { font-weight: 500; color: var(--text); }
.header-sep { opacity: .5; }
.header-ts  { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; }

.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 0 currentColor;
  transition: background var(--trans);
}
.status-dot.ok    { background: var(--success); box-shadow: 0 0 8px rgba(32,201,151,.5); }
.status-dot.warn  { background: var(--warning); box-shadow: 0 0 8px rgba(245,159,0,.5); }
.status-dot.err   { background: var(--danger); box-shadow: 0 0 8px rgba(240,62,62,.5); }

/* ── MAIN ─────────────────────────────────────────────────────────────────── */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── BANNER ───────────────────────────────────────────────────────────────── */
.banner {
  background: linear-gradient(135deg, var(--surface), var(--surface2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow);
  transition: all var(--trans);
}
.banner.rain    { background: linear-gradient(135deg, #1a2540, #2c4a7a); border-color: #3a6cb0; }
.banner.warning { background: linear-gradient(135deg, #2a2010, #4a3a0a); border-color: #8a6a10; }
.banner.calm    { background: linear-gradient(135deg, var(--surface), var(--surface2)); }
.banner-icon   { font-size: 64px; line-height: 1; }
.banner-text   { flex: 1; }
.banner-title  { font-size: 22px; font-weight: 600; letter-spacing: -.3px; }
.banner-sub    { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ── CARD ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.card-head h2 {
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
}
.card-sub { color: var(--muted); font-size: 13px; }
.card-sub.source-badge {
  background: linear-gradient(135deg, var(--success), #14b88a);
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  box-shadow: 0 2px 6px rgba(32,201,151,.35);
}
.btn-refresh {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  transition: all var(--trans);
}
.btn-refresh:hover { background: var(--surface3); color: var(--text); transform: rotate(45deg); }

/* ── RADAR (Leaflet) ──────────────────────────────────────────────────────── */
.card-radar { padding: 18px; }
.radar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.radar-ts { font-family: 'SF Mono', monospace; font-size: 11px; color: var(--muted); }

/* Zoom-presets + pin */
.zoom-presets {
  display: flex;
  gap: 2px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.zoom-presets button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: var(--text);
  transition: all var(--trans);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.zoom-presets button:hover { background: var(--surface3); }
.zoom-presets button.active,
.zoom-presets button#radarPin.pinned {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(79,110,247,.4);
}
.radar-map {
  height: 460px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #1a1d2e;
  border: 1px solid var(--border);
}

/* Leaflet dark theme overrides */
.leaflet-container { background: #1a1d2e !important; font-family: inherit; outline: none; }

/* Basemap (CartoDB dark_all) is van zichzelf bijna zwart. Met filter wordt
   het landschap zichtbaarder zonder de radar-overlay aan te tasten — die
   zit in een andere tile-layer zonder deze className. */
.basemap-layer { filter: brightness(1.55) contrast(0.95) saturate(1.15); }
.leaflet-control-zoom a,
.leaflet-bar a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover { background: var(--surface2) !important; }
.leaflet-bar { box-shadow: 0 2px 8px rgba(0,0,0,.4) !important; border: none !important; }
.leaflet-control-attribution {
  background: rgba(26,29,46,.7) !important;
  color: var(--muted) !important;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px 0 0 0;
}
.leaflet-control-attribution a { color: var(--primary-h) !important; }
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.5) !important;
}
.leaflet-popup-tip { background: var(--surface) !important; }
.leaflet-popup-content { margin: 10px 14px; font-size: 13px; }

/* Custom pulsing marker (DivIcon) */
.my-marker { background: transparent !important; border: none !important; }
.my-marker-inner {
  width: 16px; height: 16px;
  background: var(--primary);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(79,110,247,.3), 0 0 14px rgba(79,110,247,.8);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(79,110,247,.3), 0 0 14px rgba(79,110,247,.8); }
  50%      { box-shadow: 0 0 0 10px rgba(79,110,247,.05), 0 0 22px rgba(79,110,247,1); }
}

.radar-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  align-items: center;
}
.leg-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* ── GRID ─────────────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr 1fr; }

/* ── NU ──────────────────────────────────────────────────────────────────── */
.now-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
}
.now-temp-val { font-size: 56px; font-weight: 300; letter-spacing: -2px; line-height: 1; }
.now-temp-unit { font-size: 28px; color: var(--muted); margin-left: 4px; }
.now-temp-feel { font-size: 13px; color: var(--muted); margin-top: 6px; }
.now-icon { font-size: 64px; line-height: 1; }

.now-stats, .nowcast-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}
.stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.stat:last-child { border-bottom: 0; }
.stat-lbl { color: var(--muted); font-size: 13px; }
.stat-val { color: var(--text); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── NOWCAST BAR (24 sloten = 2u) ─────────────────────────────────────────── */
.severity-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.severity-badge.none     { background: rgba(123,127,158,.2); color: var(--muted); }
.severity-badge.drizzle  { background: rgba(77,173,247,.18); color: var(--info); }
.severity-badge.light    { background: rgba(77,173,247,.25); color: var(--info); }
.severity-badge.moderate { background: rgba(245,159,0,.2);   color: var(--warning); }
.severity-badge.heavy    { background: rgba(240,62,62,.22);  color: var(--danger); }
.severity-badge.violent  { background: rgba(186,85,255,.25); color: #ba55ff; }

.nowcast-bar {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  height: 60px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 6px;
  align-items: end;
}
.nowcast-slot {
  background: var(--surface3);
  border-radius: 2px;
  min-height: 4px;
  transition: all var(--trans);
  position: relative;
}
.nowcast-slot:hover { transform: scaleY(1.05); }
.nowcast-slot[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%; left: 50%;
  transform: translateX(-50%);
  background: var(--surface3);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  margin-bottom: 4px;
}
.nowcast-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 16px;
  padding: 0 4px;
}

/* ── ADVIES ──────────────────────────────────────────────────────────────── */
.advice {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  transition: all var(--trans);
}
.advice.safe   { background: rgba(32,201,151,.12); border-color: rgba(32,201,151,.4); }
.advice.warn   { background: rgba(245,159,0,.12);  border-color: rgba(245,159,0,.4); }
.advice.danger { background: rgba(240,62,62,.12);  border-color: rgba(240,62,62,.4); }
.advice-icon  { font-size: 40px; line-height: 1; }
.advice-title { font-size: 17px; font-weight: 600; }
.advice-sub   { font-size: 13px; color: var(--muted); margin-top: 3px; }

.flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.flag {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface2);
  color: var(--dim);
  border: 1px solid var(--border);
  transition: all var(--trans);
}
.flag.on { background: var(--surface3); color: var(--text); border-color: var(--primary); }
.flag.warn.on { background: rgba(245,159,0,.18); color: var(--warning); border-color: rgba(245,159,0,.4); }
.flag.danger.on { background: rgba(240,62,62,.18); color: var(--danger); border-color: rgba(240,62,62,.4); }
.flag.info.on { background: rgba(77,173,247,.18); color: var(--info); border-color: rgba(77,173,247,.4); }

/* ── 5-DAGEN FORECAST ────────────────────────────────────────────────────── */
.forecast {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.day-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  transition: all var(--trans);
}
.day-card:hover { background: var(--surface3); border-color: var(--primary); transform: translateY(-2px); }
.day-name  { font-size: 13px; font-weight: 600; color: var(--text); }
.day-date  { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.day-icon  { font-size: 36px; margin: 6px 0; line-height: 1; }
.day-temp  { font-size: 14px; font-weight: 500; }
.day-temp-min { color: var(--info); }
.day-temp-max { color: var(--warning); margin-left: 4px; }
.day-rain  {
  font-size: 12px; color: var(--muted); margin-top: 6px;
  display: flex; justify-content: center; align-items: center; gap: 4px;
}
.day-rain.has { color: var(--info); font-weight: 500; }
.day-wind  { font-size: 11px; color: var(--dim); margin-top: 4px; }

/* ── STATUS BAR ──────────────────────────────────────────────────────────── */
.status-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 12px;
  color: var(--muted);
  align-items: center;
}
.status-item { display: flex; gap: 6px; align-items: center; }
.status-lbl  { color: var(--dim); text-transform: uppercase; letter-spacing: .5px; }
.status-val  { color: var(--text); font-family: 'SF Mono', monospace; font-size: 11px; }
.status-val.ok    { color: var(--success); }
.status-val.err   { color: var(--danger); }
.status-val.warn  { color: var(--warning); }
.status-item.links { margin-left: auto; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  header { padding: 0 18px; height: auto; min-height: 64px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 8px; }
  main   { padding: 18px; gap: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .banner-icon { font-size: 48px; }
  .banner-title { font-size: 18px; }
  .now-temp-val { font-size: 48px; }
  .now-icon { font-size: 52px; }
  .forecast { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .day-card  { padding: 12px 6px; }
}

@media (max-width: 640px) {
  header { padding: 10px 14px; }
  .logo h1 { font-size: 16px; }
  .logo-sub { display: none; }
  .header-meta { font-size: 12px; gap: 6px; flex-wrap: wrap; }
  main   { padding: 14px; gap: 14px; }
  .banner { padding: 18px; gap: 16px; }
  .banner-icon { font-size: 42px; }
  .banner-title { font-size: 17px; }
  .banner-sub   { font-size: 13px; }
  .card { padding: 16px 14px; }
  .now-stats, .nowcast-stats { grid-template-columns: 1fr; gap: 0; }
  .nowcast-bar { height: 44px; }
  .radar-map { height: 360px; }
  .forecast { grid-template-columns: repeat(3, 1fr); }
  .day-card:nth-child(n+4) { display: none; }
  .status-bar { gap: 10px; padding: 10px 12px; }
  .status-item.links { margin-left: 0; width: 100%; }
}

@media (max-width: 420px) {
  header { padding: 8px 12px; }
  .logo-icon { width: 32px; height: 32px; font-size: 18px; }
  .logo h1 { font-size: 15px; }
  .header-loc { font-size: 11px; }
  .header-ts { font-size: 10px; }
  main   { padding: 10px; gap: 10px; }
  .banner { padding: 14px; flex-direction: column; text-align: center; gap: 8px; }
  .banner-icon { font-size: 38px; }
  .banner-title { font-size: 16px; }
  .now-grid { flex-direction: column; align-items: flex-start; gap: 10px; }
  .now-temp-val { font-size: 42px; }
  .now-icon { font-size: 44px; align-self: flex-end; }
  .card { padding: 14px 12px; border-radius: 10px; }
  .nowcast-bar { gap: 1px; padding: 3px; height: 38px; }
  .nowcast-axis { font-size: 10px; }
  .radar-map { height: 280px; }
  .forecast { grid-template-columns: repeat(2, 1fr); }
  .day-card:nth-child(n+3) { display: none; }
  .advice { padding: 12px; gap: 12px; }
  .advice-icon { font-size: 32px; }
  .advice-title { font-size: 15px; }
  .flag { padding: 4px 10px; font-size: 11px; }
}
