/* ===========================
   SCHOOLZONES ALKMAAR
   main.css — modern, mobile-first
   =========================== */

/* --- New accident pulse animation --- */
.accident-new {
  animation: pulse-ring 1.5s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { stroke-opacity: 1; }
  50%  { stroke-opacity: 0.4; }
  100% { stroke-opacity: 1; }
}

/* Cluster containing new accidents */
.marker-cluster--new {
  box-shadow: 0 0 0 4px #00E5FF, 0 0 12px rgba(0, 229, 255, 0.6);
  animation: cluster-pulse 1.5s ease-out infinite;
}
.marker-cluster--new div {
  border: 2px solid #00E5FF;
}
@keyframes cluster-pulse {
  0%   { box-shadow: 0 0 0 4px #00E5FF, 0 0 12px rgba(0, 229, 255, 0.6); }
  50%  { box-shadow: 0 0 0 6px #00E5FF, 0 0 20px rgba(0, 229, 255, 0.4); }
  100% { box-shadow: 0 0 0 4px #00E5FF, 0 0 12px rgba(0, 229, 255, 0.6); }
}

/* --- Custom Properties --- */
:root {
  --clr-danger: #E53935;
  --clr-danger-dark: #B71C1C;
  --clr-danger-light: #FFEBEE;
  --clr-warning: #F57C00;
  --clr-warning-light: #FFF3E0;
  --clr-safe: #2E7D32;
  --clr-safe-light: #E8F5E9;
  --clr-bg: #F8F9FA;
  --clr-bg-dark: #0F172A;
  --clr-bg-dark-lighter: #1E293B;
  --clr-text: #1E293B;
  --clr-text-light: #64748B;
  --clr-text-muted: #94A3B8;
  --clr-white: #FFFFFF;
  --clr-border: #E2E8F0;
  --clr-accent: #EF4444;

  --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --max-width: 1200px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-stack);
  color: var(--clr-text);
  background: var(--clr-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Focus styles (keyboard a11y) --- */
:focus-visible {
  outline: 3px solid var(--clr-accent);
  outline-offset: 2px;
}

/* --- Skip to content (a11y) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--clr-accent);
  color: var(--clr-white);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  font-weight: 700;
  z-index: 9999;
  text-decoration: none;
}
.skip-link:focus {
  top: var(--space-md);
}

/* --- Typography --- */
h1, h2, h3 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--clr-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===========================
   HERO BANNER
   =========================== */
.hero {
  background: var(--clr-bg-dark);
  color: var(--clr-white);
  padding: var(--space-xl) var(--space-md);
  width: 100%;
}

.hero__container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.hero__left {
  flex-shrink: 0;
}

.hero__right {
  flex: 1;
  min-width: 280px;
}

.hero__counter-wrapper {
  text-align: center;
}

.hero__counter {
  display: block;
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 900;
  color: var(--clr-accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.hero__counter-label {
  display: block;
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--clr-text-muted);
  margin-top: var(--space-xs);
}

.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #CBD5E1;
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

.hero__lead {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  line-height: 1.5;
}

.hero__vision {
  text-align: center;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: #FBBF24;
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* ===========================
   SECTIONS
   =========================== */
.section {
  padding: var(--space-3xl) var(--space-md);
}

.section--alt {
  background: var(--clr-white);
}

.section__container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section__title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: var(--space-sm);
  text-align: center;
  color: var(--clr-text);
}

.section__intro {
  text-align: center;
  color: var(--clr-text-light);
  max-width: 700px;
  margin: 0 auto var(--space-xl);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* ===========================
   MAP
   =========================== */
.section--map {
  padding-bottom: var(--space-lg);
}

.map-container {
  width: 100%;
  height: 65vh;
  min-height: 400px;
  max-height: 750px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: #E2E8F0;
  box-shadow: var(--shadow-lg);
  max-width: var(--max-width);
  margin: 0 auto;
}

.map-container__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--clr-text-light);
  background: #E2E8F0;
  z-index: 500;
}

.map-container__loading--hidden {
  display: none;
}

/* Marker Cluster overrides */
.marker-cluster-small {
  background-color: rgba(239, 68, 68, 0.5);
}
.marker-cluster-small div {
  background-color: rgba(239, 68, 68, 0.85);
}
.marker-cluster-medium {
  background-color: rgba(220, 38, 38, 0.5);
}
.marker-cluster-medium div {
  background-color: rgba(220, 38, 38, 0.85);
}
.marker-cluster-large {
  background-color: rgba(185, 28, 28, 0.5);
}
.marker-cluster-large div {
  background-color: rgba(185, 28, 28, 0.85);
}
.marker-cluster div {
  width: 30px;
  height: 30px;
  margin-left: 3px;
  margin-top: 3px;
  text-align: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.marker-cluster span {
  line-height: 30px;
}

/* Map Legend */
.map-legend {
  max-width: var(--max-width);
  margin: var(--space-md) auto 0;
  padding: var(--space-md) var(--space-lg);
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
}

.map-legend__title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-muted);
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

.map-legend__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  font-size: 0.85rem;
  color: var(--clr-text-light);
}

.map-legend__list li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.map-legend__swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.map-legend__swatch--route-safe {
  background: #388E3C;
  border: 2px solid #2E7D32;
  border-radius: 3px;
}
.map-legend__swatch--route-warn {
  background: #F57C00;
  border: 2px solid #E65100;
  border-radius: 3px;
}
.map-legend__swatch--route-danger {
  background: #D32F2F;
  border: 2px solid #B71C1C;
  border-radius: 3px;
}
.map-legend__swatch--zone-safe {
  background: #4CAF50;
  border: 2px solid #388E3C;
  border-radius: 3px;
}

.map-legend__swatch--zone-warn {
  background: #FF9800;
  border: 2px solid #E65100;
  border-radius: 3px;
}

.map-legend__swatch--zone-danger {
  background: #D32F2F;
  border: 2px solid #B71C1C;
  border-radius: 3px;
}

.map-legend__swatch--materieel {
  background: #FFCDD2;
  border: 2px solid #E57373;
}

.map-legend__swatch--letsel {
  background: var(--clr-danger);
}

.map-legend__swatch--dodelijk {
  background: var(--clr-danger-dark);
  border: 2px solid #000;
}
.map-legend__swatch--new {
  background: var(--clr-danger);
  border: 3px solid #00E5FF;
  animation: pulse-ring 1.5s ease-out infinite;
}

/* ===========================
   RANKING TABLE
   =========================== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-md);
  background: var(--clr-white);
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.ranking-table th,
.ranking-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--clr-border);
}

.ranking-table th {
  background: var(--clr-bg-dark);
  color: var(--clr-white);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.ranking-table th:first-child {
  border-radius: var(--radius-lg) 0 0 0;
}

.ranking-table th:last-child {
  border-radius: 0 var(--radius-lg) 0 0;
}

.ranking-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.ranking-table tbody tr:hover {
  background: #F1F5F9;
}

.ranking-table tbody tr:last-child td {
  border-bottom: none;
}

.ranking-table__row--highlight {
  background: var(--clr-danger-light) !important;
}

.ranking-table__row--highlight:hover {
  background: #FFCDD2 !important;
}

.ranking-table .risk-high {
  color: var(--clr-danger);
  font-weight: 700;
}

.ranking-table .risk-medium {
  color: var(--clr-warning);
  font-weight: 600;
}

.ranking-table .speed-high {
  color: var(--clr-danger);
  font-weight: 700;
}

.ranking-table .painpoint {
  display: inline-block;
  background: #FFF3E0;
  color: #E65100;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin: 0.1rem 0.15rem;
  white-space: nowrap;
}

.ranking-table .speed-ok {
  color: var(--clr-safe);
  font-weight: 600;
}

/* ===========================
   ACTION SECTION
   =========================== */
.section--actie {
  background: var(--clr-bg-dark);
  color: var(--clr-white);
  text-align: center;
}

.section--actie .section__title {
  color: var(--clr-white);
}

.actie__text {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  color: #CBD5E1;
  line-height: 1.6;
}

.actie__share {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-stack);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn--whatsapp {
  background: #25D366;
  color: var(--clr-white);
}

.btn--whatsapp:hover {
  background: #1DA851;
  color: var(--clr-white);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn--copy {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--clr-white);
}

.btn--copy:hover {
  border-color: var(--clr-white);
  background: rgba(255, 255, 255, 0.1);
}

.btn--copy--success {
  border-color: #25D366;
  color: #25D366;
}

/* ===========================
   SOURCES
   =========================== */
.bronnen__content {
  max-width: 800px;
  margin: 0 auto;
}

.bronnen__content h3 {
  font-size: 1rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  color: var(--clr-text);
  font-weight: 600;
}

.bronnen__content ul {
  padding-left: var(--space-lg);
}

.bronnen__content li {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
  color: var(--clr-text-light);
}

.bronnen__content li strong {
  color: var(--clr-text);
}

.bronnen__content p {
  color: var(--clr-text-muted);
  font-style: italic;
  margin-top: var(--space-md);
  font-size: 0.9rem;
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  color: var(--clr-text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--clr-border);
}

/* ===========================
   RESPONSIVE
   =========================== */

/* Mobile: stack hero vertically */
@media (max-width: 599px) {
  .hero__container {
    flex-direction: column;
    text-align: center;
  }

  .hero__right {
    text-align: center;
  }
}

@media (min-width: 900px) {
  .map-container {
    height: 70vh;
  }

  .ranking-table {
    font-size: 1rem;
  }
}

@media (min-width: 1200px) {
  .section {
    padding: var(--space-3xl) var(--space-lg);
  }
}
