/* Huisstijl van duocast.nl: donkerblauw (#00083b), lichtblauw (#00519c), cyaan (#32d2e5), Ubuntu. */
@font-face { font-family: "Ubuntu"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/ubuntu-400.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/ubuntu-500.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/ubuntu-700.woff2") format("woff2"); }

:root {
  --bg: #00083b;
  --bg-deep: #000626;
  --blue: #00519c;
  --accent: #32d2e5;
  --ink: #f5f6fa;
  --ink-2: #c8d0d9;
  --ink-3: #98a1b8;
  --card: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.11);
  --grid: rgba(255, 255, 255, 0.08);
  --dl: #17a2bb;   /* download  (gevalideerd op #00083b) */
  --ul: #d95926;   /* upload    (gevalideerd op #00083b) */
  --good: #0ca30c;
  --crit: #d03b3b;
  --warn: #fab219;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Ubuntu", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 85% -8%, rgba(0, 81, 156, 0.55), transparent 62%),
    radial-gradient(900px 500px at -10% 105%, rgba(50, 210, 229, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  padding-bottom: 96px;
}

.top, main { max-width: 1180px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.top { display: flex; align-items: center; justify-content: space-between; padding-top: 26px; padding-bottom: 6px; }
.logo { height: 28px; width: auto; filter: brightness(0) invert(1); }

.live { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.6); animation: pulse 2s infinite; }
.live.err .dot { background: var(--crit); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(12, 163, 12, 0); } 100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0); } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

.title { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin: 34px 0 22px; }
h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.01em; }
.sub { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }

.range { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.range button {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--ink-2);
  background: transparent; border: 0; border-radius: 8px; padding: 7px 13px; cursor: pointer;
}
.range button:hover { color: var(--ink); }
.range button[aria-pressed="true"] { color: var(--bg); background: var(--accent); }
.range button:focus-visible, summary:focus-visible { outline: 2px dotted var(--accent); outline-offset: 3px; }

.card-gap { margin-top: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.tile, .card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.tile { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-height: 96px; }
.tile-label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.tile-value { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.tile-value.ok { color: #3ecf3e; }
.tile-value.bad { color: #ff6b6b; }
.tile-note { font-size: 12px; color: var(--ink-3); }
.chip { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.chip.dl { background: var(--dl); }
.chip.ul { background: var(--ul); }

.card { padding: 18px 20px 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
h2 { margin: 0; font-size: 16px; font-weight: 500; }
.legend { display: flex; gap: 16px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 7px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }

.chart { position: relative; width: 100%; height: 300px; }
.grid2 .chart { height: 220px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; touch-action: pan-y; }
.axis text { fill: var(--ink-3); font-size: 11px; }
.gridline { stroke: var(--grid); stroke-width: 1; }
.baseline { stroke: rgba(255, 255, 255, 0.22); stroke-width: 1; }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cursor { stroke: rgba(255, 255, 255, 0.45); stroke-width: 1; }
.pt { stroke: var(--bg); stroke-width: 2; }
.empty { fill: var(--ink-3); font-size: 14px; }

.tooltip {
  position: absolute; z-index: 2; pointer-events: none; min-width: 150px;
  background: rgba(0, 8, 59, 0.96); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; font-size: 12.5px; color: var(--ink); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.tooltip[hidden] { display: none; }
.tooltip .tt-time { color: var(--ink-2); margin-bottom: 5px; font-size: 12px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 7px; justify-content: space-between; }
.tooltip .tt-row span:first-child { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.tooltip .tt-row b { font-weight: 700; font-variant-numeric: tabular-nums; }

.gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gauge { margin: 0; text-align: center; }
.gauge svg { width: 100%; max-width: 230px; height: auto; }
.g-track { fill: none; stroke: rgba(255, 255, 255, 0.11); stroke-width: 14; stroke-linecap: round; }
.g-val { fill: none; stroke-width: 14; stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.g-pct { fill: var(--ink); font-size: 34px; font-weight: 700; text-anchor: middle; font-variant-numeric: tabular-nums; }
.g-cap { fill: var(--ink-2); font-size: 12px; text-anchor: middle; }
.gauge figcaption { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.gauge figcaption b { color: var(--ink); font-weight: 500; }
.gauge .state { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.table-view { margin-top: 16px; color: var(--ink-2); font-size: 13px; }
.table-view summary { cursor: pointer; padding: 6px 0; }
.table-view table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.table-view th { color: var(--ink); font-weight: 500; }

.powered {
  position: fixed; right: 18px; bottom: 16px; z-index: 3;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(0, 8, 59, 0.82); border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  font-size: 12px; color: var(--ink-2);
}
.powered img { height: 30px; width: auto; display: block; }

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  h1 { font-size: 28px; }
  .chart { height: 240px; }
  .tile-value { font-size: 24px; }
  .gauges { grid-template-columns: 1fr; }
  .powered { position: static; margin: 28px 24px 0; justify-content: center; }
  body { padding-bottom: 24px; }
}

/* Verkeer per land */
.dest-card { margin-top: 14px; }
.dest { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; align-items: start; }
.map { position: relative; width: 100%; }
.map svg { width: 100%; height: auto; display: block; }
.land { fill: rgba(255, 255, 255, 0.07); stroke: var(--bg); stroke-width: 0.5; }
.land.q1 { fill: #0f4a5c; }
.land.q2 { fill: #12687e; }
.land.q3 { fill: #15869f; }
.land.q4 { fill: #1fa9c4; }
.land.q5 { fill: #5ed3e6; }
.land.hot { stroke: var(--ink); stroke-width: 1; }
.chip.q1 { background: #0f4a5c; }
.chip.q2 { background: #12687e; }
.chip.q3 { background: #15869f; }
.chip.q4 { background: #1fa9c4; }
.chip.q5 { background: #5ed3e6; }
.scale { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-2); }
.scale span:first-child { margin-right: 4px; }
.scale span:last-child { margin-left: 4px; }
.dest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.dest-list li { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 13px; }
.dest-list .name { color: var(--ink); }
.dest-list .val { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dest-list .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.dest-list .fill { display: block; height: 100%; border-radius: 3px; background: var(--dl); }
.dest-list .fill.other { background: var(--ink-3); }
.foot { margin: 14px 0 2px; font-size: 12px; color: var(--ink-3); }
.foot a { color: var(--ink-2); }
.table-view caption { text-align: left; color: var(--ink); font-weight: 500; padding: 14px 10px 4px; }
@media (max-width: 900px) { .dest { grid-template-columns: 1fr; } }

.mark { stroke: var(--ink); stroke-width: 1.2; fill-opacity: 0.95; }
.mark.q1 { fill: #0f4a5c; }
.mark.q2 { fill: #12687e; }
.mark.q3 { fill: #15869f; }
.mark.q4 { fill: #1fa9c4; }
.mark.q5 { fill: #5ed3e6; }
