:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --text: #1f2933;
    --text-muted: #5c6b73;
    --border: #dde3e8;
    --brand: #1f5f8b;
    --brand-dark: #164a6c;

    --status-grijs: #c7cdd3;
    --status-geel: #f0b93d;
    --status-blauw: #2f7fb8;
    --status-groen: #3fa66b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

h1, h2, h3 { line-height: 1.2; margin-top: 0; }

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.site-header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.brand {
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--text);
}
.site-header nav a {
    margin-left: 1.25rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.site-header nav a:first-child { margin-left: 0; }
.site-header nav a:hover { color: var(--brand); }

.site-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.site-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 2rem 1.25rem;
}

.text-muted { color: var(--text-muted); }

.verhaal { margin-top: 1rem; }

.route-map {
    height: 320px;
    width: 100%;
    margin-top: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.route-stats { margin: 0.5rem 0 0; font-size: 0.88rem; }

/* Story (intro) */
.story {
    max-width: 42rem;
    margin: 0 auto 2rem;
    text-align: center;
}
.story p { margin: 0 0 0.9rem; line-height: 1.65; }
.story p:last-child { margin-bottom: 0; font-size: 0.9rem; }

/* Hero */
.hero {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
    height: min(60vh, 460px);
    min-height: 280px;
    background-size: cover;
    background-position: center 65%;
    display: flex;
    align-items: flex-end;
}
.hero-overlay {
    width: 100%;
    padding: 3rem 1.25rem 2.5rem;
    text-align: center;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(10, 20, 30, 0) 0%, rgba(10, 20, 30, 0.72) 85%);
}
.hero-overlay h1 {
    font-size: clamp(1.9rem, 4vw, 2.75rem);
    margin: 0 0 0.5rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.hero-overlay p {
    max-width: 40rem;
    margin: 0 auto;
    color: #eef2f5;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

/* Map */
.map-section {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-bottom: 2rem;
    padding: 3rem 1.25rem 2.5rem;
    text-align: center;
    background: radial-gradient(120% 100% at 50% 0%, #e7f0f7 0%, var(--bg) 65%);
}
.map-card {
    display: inline-block;
    background: var(--surface);
    border-radius: 24px;
    padding: 1.75rem 1.5rem 1.25rem;
    box-shadow: 0 18px 40px -20px rgba(31, 95, 139, 0.4), 0 2px 10px rgba(20, 30, 40, 0.05);
}
.map-wrapper { max-width: 420px; margin: 0 auto; isolation: isolate; }
.map-wrapper svg { width: 100%; height: auto; display: block; }

.map-art { opacity: 0.95; }

.province {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.2s ease, filter 0.2s ease;
    filter: drop-shadow(0 1px 2px rgba(20, 40, 60, 0.18));
    cursor: pointer;
}
.province:hover, .province:focus {
    transform: translateY(-4px) scale(1.015);
    filter: drop-shadow(0 10px 14px rgba(20, 40, 60, 0.4));
}

/* Vullaag: tint over de achtergrondillustratie. mix-blend-mode: multiply (niet color/saturation
   -- die niet-scheidbare blend-modes worden niet betrouwbaar ondersteund in SVG). */
.province .p-fill { fill: #aab2ba; mix-blend-mode: multiply; opacity: 0.62; }
.province.status-grijs .p-fill { fill: #aab2ba; opacity: 0.62; }
.province.status-geel .p-fill { fill: url(#grad-geel); opacity: 0.55; }
.province.status-blauw .p-fill { fill: url(#grad-blauw); opacity: 0.55; }
.province.status-groen .p-fill { fill: url(#grad-groen); opacity: 0.55; }

/* Randlaag: altijd een strakke witte lijn, geen blend-mode */
.province .p-border {
    fill: none;
    stroke: #ffffff;
    stroke-width: 1.6px;
    stroke-linejoin: round;
    stroke-linecap: round;
    pointer-events: none;
}
a:has(.province) { outline: none; }
a:focus-visible .province { filter: drop-shadow(0 0 0 2px var(--brand)); }

/* Stats / countdown */
.stats-card { text-align: center; }
.countdown { margin-bottom: 1.1rem; }
.countdown-days {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--brand);
    margin-right: 0.5rem;
    line-height: 1;
}
.countdown-label { color: var(--text-muted); }
.countdown-label strong { color: var(--text); }
.countdown-empty { color: var(--text-muted); }

.progress-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}
.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

.progress-bar {
    height: 10px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
    max-width: 380px;
    margin: 0 auto;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--status-groen));
    border-radius: 999px;
    transition: width 0.3s ease;
}

.legend {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin: 1.75rem 0 0;
    padding: 0;
}
.chip {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}
.chip-grijs { background: #e4e7ea; color: #4b555c; }
.chip-geel { background: #fbe4a8; color: #7a5400; }
.chip-blauw { background: #cfe3f2; color: #164a6c; }
.chip-groen { background: #c7ecd6; color: #1f6b41; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.login-card { max-width: 24rem; margin: 2rem auto; }

/* Analyse */
.refresh-line {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 1.5rem;
}
.knelpunt-list { list-style: none; padding: 0; margin: 0 0 2rem; }
.knelpunt-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 0 8px 8px 0;
    font-size: 0.92rem;
}
.knelpunt-hoog { border-left-color: #c0392b; }
.knelpunt-gemiddeld { border-left-color: #e7a721; }
.knelpunt-laag { border-left-color: var(--brand); }
.knelpunt-info { border-left-color: var(--text-muted); }

.voorstel-table td, .voorstel-table th { vertical-align: middle; }

/* Planbord */
.planbord-status {
    min-height: 1.2rem;
    margin: 0;
    font-size: 0.85rem;
}
.planbord-status-error { color: #a3231b; }

.planbord-maanden {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.maand-vak {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem;
    min-height: 110px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.maand-vak h3 { margin: 0 0 0.6rem; font-size: 0.95rem; }

.pool-vak {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 1rem;
    min-height: 90px;
    margin-bottom: 2rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.maand-vak.drag-over, .pool-vak.drag-over {
    border-color: var(--brand);
    border-style: solid;
    background: #eaf3fb;
}

.kaart-lijst {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 1.5rem;
}
.pool-vak .kaart-lijst {
    flex-direction: row;
    flex-wrap: wrap;
}
.pool-vak .kaart-lijst .marathon-kaart { width: 220px; }

.kaart-lijst:empty::after {
    content: 'Sleep hier een marathon naartoe';
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
}

.marathon-kaart {
    background: #ffffff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--status-grijs);
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
    cursor: grab;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.marathon-kaart:active { cursor: grabbing; }
.marathon-kaart strong { display: block; }
.marathon-kaart .kaart-meta { display: block; color: var(--text-muted); font-size: 0.78rem; margin-top: 0.15rem; }

.marathon-kaart.status-optie { border-left-color: var(--status-geel); }
.marathon-kaart.status-gekozen,
.marathon-kaart.status-ingeschreven { border-left-color: var(--status-blauw); }
.marathon-kaart.status-gelopen { border-left-color: var(--status-groen); }

.marathon-kaart.dragging { opacity: 0.4; }

/* Geplaatst, geen conflict, juiste (of neutrale) maand: goed gesleept */
.marathon-kaart.correct {
    background: #e9f7ef;
    border-color: #b9e4cb;
    border-left-color: #2f8c58;
}
.marathon-kaart.correct .kaart-meta { color: #21683f; }

/* Staat in een andere maand dan de eigen datum: waarschuwing, geen hard conflict */
.marathon-kaart.verkeerde-maand {
    background: #fdf6e3;
    border-color: #e0c46c;
    border-left-color: #e7a721;
}
.marathon-kaart.verkeerde-maand .kaart-meta { color: #7a5400; }

/* Conflict (maand- of provincieconflict) heeft voorrang op de gele waarschuwing hierboven */
.marathon-kaart.conflict {
    background: #fdecea;
    border-color: #e6a19b;
    border-left-color: #c0392b;
}
.marathon-kaart.conflict .kaart-meta { color: #a3231b; }

/* Status badge */
.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
}
.badge.status-grijs { background: var(--status-grijs); color: #33393e; }
.badge.status-geel { background: var(--status-geel); color: #4a3400; }
.badge.status-blauw { background: var(--status-blauw); }
.badge.status-groen { background: var(--status-groen); }

/* Forms */
form label {
    display: block;
    margin: 0.9rem 0 0.3rem;
    font-weight: 600;
    font-size: 0.9rem;
}
form input[type=text],
form input[type=password],
form input[type=date],
form input[type=number],
form input[type=url],
form select,
form textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
}
form textarea { min-height: 8rem; resize: vertical; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; margin-top: 1.25rem; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: transparent; border-color: var(--border); color: var(--text); }
.btn-danger { background: #c0392b; color: #fff; }
.btn-small { padding: 0.3rem 0.7rem; font-size: 0.85rem; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin: 0.75rem 0; font-size: 0.9rem; }
.alert-error { background: #fdecea; color: #a3231b; border: 1px solid #f5c2bd; }
.alert-info { background: #eaf3fb; color: #1f5f8b; border: 1px solid #bcdcf3; }
.alert-success { background: #e9f7ef; color: #21683f; border: 1px solid #b9e4cb; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
table th, table td {
    text-align: left;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}
table th { color: var(--text-muted); font-weight: 600; }

/* Dashboard grid */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
}
.dash-card h3 { margin-bottom: 0.4rem; font-size: 1rem; }
.dash-card p { margin: 0.2rem 0; font-size: 0.88rem; color: var(--text-muted); }
a.dash-card { display: block; text-decoration: none; color: inherit; }
a.dash-card:hover { border-color: var(--brand); }

/* Timeline (overzicht.php) */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
}
.timeline .maand { width: 6.5rem; flex-shrink: 0; color: var(--text-muted); font-size: 0.9rem; }
.timeline .details { flex-grow: 1; }
.timeline .details a { text-decoration: none; font-weight: 600; color: var(--text); }
.timeline .details a:hover { color: var(--brand); }
.timeline li.timeline-optie { border-bottom-style: dashed; opacity: 0.85; }
.timeline li.timeline-optie .details a { font-weight: 500; }

.optie-list { list-style: none; margin: 0.3rem 0 0; padding: 0; font-size: 0.88rem; }
.optie-list li { padding: 0.15rem 0; }

/* Instagram link */
.ig-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: #f0f0f5;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}
.ig-link:hover { background: #e4e4ee; color: var(--text); }

.candidates-table a { text-decoration: none; }

@media (max-width: 600px) {
    .site-header-inner { flex-direction: column; align-items: flex-start; }
    .site-header nav a { margin-left: 0; margin-right: 1rem; }
}
