:root {
    --bg: #0b0e14;
    --bg-panel: #12161f;
    --bg-elevated: #171c27;
    --border: #232a38;
    --text: #e6e9ef;
    --text-dim: #8b93a5;
    --accent: #3b82f6;

    --c-brandweer: #ef4444;
    --c-ambulance: #eab308;
    --c-politie: #3b82f6;
    --c-traumaheli: #f97316;
    --c-knrm: #06b6d4;
    --c-overig: #6b7280;
}

* { 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);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.topbar__brand { display: flex; align-items: center; gap: 10px; }

.topbar__brand h1 {
    font-size: 1.15rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.topbar__brand h1 span { color: var(--accent); font-weight: 400; }

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulse 2s infinite;
}
.live-dot.offline { background: #ef4444; animation: none; box-shadow: none; }

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.topbar__meta { color: var(--text-dim); font-size: 0.85rem; }
.topbar__meta #melding-count { color: var(--text); font-weight: 700; }

.layout {
    flex: 1;
    display: grid;
    grid-template-columns: 260px minmax(320px, 1fr) minmax(320px, 1fr);
    min-height: 0;
}

.sidebar {
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    padding: 18px;
    overflow-y: auto;
}

.sidebar__section { margin-bottom: 26px; }
.sidebar__section h2 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin: 0 0 10px;
}

#filter-search {
    width: 100%;
    padding: 9px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
}
#filter-search:focus { outline: none; border-color: var(--accent); }

.dienst-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.88rem;
    cursor: pointer;
    user-select: none;
}
.dienst-toggle input { accent-color: var(--accent); }

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot--brandweer  { background: var(--c-brandweer); }
.dot--ambulance  { background: var(--c-ambulance); }
.dot--politie    { background: var(--c-politie); }
.dot--traumaheli { background: var(--c-traumaheli); }
.dot--knrm       { background: var(--c-knrm); }
.dot--overig     { background: var(--c-overig); }

.status-text { font-size: 0.82rem; color: var(--text-dim); margin: 0; }

.feed {
    overflow-y: auto;
    border-right: 1px solid var(--border);
    padding: 12px;
}

.melding-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.melding-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-left: 4px solid var(--c-overig);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    animation: fade-in 0.35s ease;
}
.melding-card:hover { background: #1c2230; }
.melding-card--brandweer  { border-left-color: var(--c-brandweer); }
.melding-card--ambulance  { border-left-color: var(--c-ambulance); }
.melding-card--politie    { border-left-color: var(--c-politie); }
.melding-card--traumaheli { border-left-color: var(--c-traumaheli); }
.melding-card--knrm       { border-left-color: var(--c-knrm); }
.melding-card--overig     { border-left-color: var(--c-overig); }

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.melding-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge {
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.68rem;
    color: #0b0e14;
}
.badge--brandweer  { background: var(--c-brandweer); }
.badge--ambulance  { background: var(--c-ambulance); }
.badge--politie    { background: var(--c-politie); color: #fff; }
.badge--traumaheli { background: var(--c-traumaheli); }
.badge--knrm       { background: var(--c-knrm); }
.badge--overig     { background: var(--c-overig); color: #fff; }

.badge--prio { background: transparent; border: 1px solid var(--text-dim); color: var(--text-dim); }

.melding-card__tekst {
    font-size: 0.88rem;
    line-height: 1.4;
    word-break: break-word;
}

.feed-empty { color: var(--text-dim); text-align: center; margin-top: 40px; }

.map-panel { position: relative; }
#map { position: absolute; inset: 0; }

.leaflet-popup-content { font-size: 0.85rem; }

.melding-marker { background: transparent; border: none; }

.map-pin {
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-pin__icon {
    transform: rotate(45deg);
    font-size: 15px;
    line-height: 1;
}

.leaflet-control-zoom a {
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}
.leaflet-control-attribution {
    background: rgba(18, 22, 31, 0.8) !important;
    color: var(--text-dim) !important;
}
.leaflet-control-attribution a { color: var(--text-dim) !important; }

.footer {
    flex-shrink: 0;
    padding: 6px 20px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.75rem;
    text-align: center;
}
.footer a { color: var(--text-dim); }

.melding-card__bron {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
}
.melding-card__bron a { color: var(--text-dim); }
.melding-card__bron a:hover { color: var(--accent); }

@media (max-width: 1000px) {
    .layout { grid-template-columns: 1fr; grid-auto-rows: min-content; overflow-y: auto; }
    .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
    .feed { border-right: none; max-height: 60vh; }
    .map-panel { height: 320px; }
}
