﻿/**
 * Diensten Styles - Busgangsters
 * Clean minimal design, light/dark mode, mobile-first
 */

/* ============================================
   CSS Variables
   ============================================ */

:root,
[data-theme="dark"] {
    --d-bg: #0f0f1a;
    --d-bg-card: #1a1f2e;
    --d-bg-input: #141824;
    --d-bg-header: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --d-bg-search: #1a1a2e;
    --d-bg-table-head: #111827;
    --d-text: #c9d1d9;
    --d-text-secondary: #8b949e;
    --d-text-muted: #545d68;
    --d-text-bright: #e6edf3;
    --d-text-heading: #f0f6fc;
    --d-border: rgba(255, 255, 255, 0.06);
    --d-border-input: #21262d;
    --d-accent: #3b82f6;
    --d-accent-text: #58a6ff;
    --d-hover: rgba(255, 255, 255, 0.04);
    --d-row-past-opacity: 0.4;
    --d-row-next-bg: rgba(34, 197, 94, 0.08);
    --d-row-next-border: #22c55e;
    --d-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    --d-bg: #f6f8fa;
    --d-bg-card: #ffffff;
    --d-bg-input: #f6f8fa;
    --d-bg-header: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --d-bg-search: #ffffff;
    --d-bg-table-head: #f6f8fa;
    --d-text: #1f2328;
    --d-text-secondary: #656d76;
    --d-text-muted: #8b949e;
    --d-text-bright: #1f2328;
    --d-text-heading: #ffffff;
    --d-border: rgba(0, 0, 0, 0.07);
    --d-border-input: #d0d7de;
    --d-accent: #2563eb;
    --d-accent-text: #2563eb;
    --d-hover: rgba(0, 0, 0, 0.03);
    --d-row-past-opacity: 0.35;
    --d-row-next-bg: rgba(34, 197, 94, 0.06);
    --d-row-next-border: #16a34a;
    --d-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Base
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--d-bg);
    color: var(--d-text);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--d-accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================
   Header
   ============================================ */

.header {
    background: var(--d-bg-header);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    max-width: 900px;
    margin: 0 auto;
}

.header-back {
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}
.header-back:hover { color: #fff; background: rgba(255,255,255,0.1); text-decoration: none; }

.header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    flex: 1;
}
.header-title svg { color: rgba(255,255,255,0.8); }

.header-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.theme-toggle-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}
.theme-toggle-btn:hover { background: rgba(255,255,255,0.2); }

/* ============================================
   Search
   ============================================ */

.search-section {
    background: var(--d-bg-search);
    padding: 16px;
    border-bottom: 1px solid var(--d-border);
}

.search-container { max-width: 900px; margin: 0 auto; }

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--d-text-muted);
    pointer-events: none;
}

#searchInput {
    width: 100%;
    padding: 12px 44px;
    background: var(--d-bg-input);
    border: 1px solid var(--d-border-input);
    border-radius: 10px;
    color: var(--d-text-bright);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}
#searchInput:focus { border-color: var(--d-accent); }
#searchInput::placeholder { color: var(--d-text-muted); }

.clear-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--d-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 50%;
}
.clear-btn:hover { background: var(--d-hover); color: var(--d-text); }

.search-filters { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

.filter-select {
    padding: 8px 12px;
    background: var(--d-bg-input);
    border: 1px solid var(--d-border-input);
    border-radius: 8px;
    color: var(--d-text);
    font-size: 0.875rem;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

/* ============================================
   Results
   ============================================ */

.results-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 16px;
}

.results-header {
    font-size: 0.85rem;
    color: var(--d-text-secondary);
    margin-bottom: 12px;
    padding: 0 4px;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-card {
    background: var(--d-bg-card);
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid var(--d-border);
    animation: fadeIn 0.15s ease-out;
}
.result-card:hover {
    background: var(--d-hover);
    border-color: var(--d-accent);
    transform: translateY(-1px);
}
.result-card:active { transform: translateY(0); }

.result-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.dienst-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.88rem;
    color: white;
}

.dienst-type-label {
    font-size: 0.8rem;
    color: var(--d-text-secondary);
}

.result-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--d-text);
}

.duur-badge {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.78rem;
    color: var(--d-text-muted);
    margin-left: auto;
}

.result-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dag-badge {
    color: var(--d-text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
}

.vestiging-badge {
    color: var(--d-accent);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.1);
}

.vestiging-pill {
    background: rgba(59, 130, 246, 0.15) !important;
    color: var(--d-accent) !important;
}

.lijnen-info {
    font-size: 0.78rem;
    color: var(--d-text-muted);
}

.no-results { text-align: center; padding: 32px 16px; color: var(--d-text-muted); }
.no-results-hint { font-size: 0.85rem; margin-top: 8px; }

.error-msg {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
}

/* ============================================
   Dienst Detail
   ============================================ */

.dienst-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 16px 32px;
}

.detail-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--d-accent-text);
    font-size: 0.88rem;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 0;
}
.back-btn:hover { color: var(--d-accent); }

/* Terug naar mijn dienst knop */
.mijn-dienst-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--d-accent-text);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}
.mijn-dienst-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    filter: brightness(1.08);
}

.dienst-header { margin-bottom: 0; }

.pdf-header {
    background: var(--d-bg-card);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 10px;
    border: 1px solid var(--d-border);
}

.pdf-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.pdf-dienst-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

.pdf-dienst-times {
    font-size: 1rem;
    color: var(--d-text);
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}
.pdf-dienst-times b { color: var(--d-text-secondary); font-weight: 600; }

.pdf-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.pdf-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--d-text-secondary);
}



/* ============================================
   PDF Table
   ============================================ */

.pdf-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid var(--d-border);
    background: var(--d-bg-card);
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    white-space: nowrap;
}

.pdf-table thead th {
    background: var(--d-bg-table-head);
    color: var(--d-text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid var(--d-border);
}

.pdf-table tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--d-border);
    color: var(--d-text);
}

.pdf-row-rit { transition: background 0.15s; }
.pdf-row-rit:hover { background: var(--d-hover); }

/* PAST rows = grayed out */
.pdf-row-past { opacity: var(--d-row-past-opacity); }

/* NEXT (upcoming) = subtle blue accent */
.pdf-row-next {
    background: rgba(59, 130, 246, 0.06) !important;
    border-left: 3px solid rgba(59, 130, 246, 0.4);
}
.pdf-row-next td:first-child { padding-left: 7px; }

/* CURRENT (active right now) = bright green */
.pdf-row-current {
    background: var(--d-row-next-bg) !important;
    border-left: 3px solid var(--d-row-next-border);
    animation: currentPulse 2s ease-in-out infinite;
}
.pdf-row-current td:first-child { padding-left: 7px; }

@keyframes currentPulse {
    0%, 100% { background: rgba(34, 197, 94, 0.08) !important; }
    50% { background: rgba(34, 197, 94, 0.14) !important; }
}

.col-lijn { font-weight: 700; }

.lijn-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--d-accent);
    color: white;
    min-width: 26px;
    height: 20px;
    padding: 0 5px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.78rem;
}

.col-omloop, .col-rit {
    color: var(--d-text-secondary);
    font-size: 0.82rem;
}

.col-time {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-weight: 600;
    color: var(--d-text-bright);
    font-size: 0.86rem;
}

.col-halte {
    color: var(--d-text);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Special rows - all unified style, no rainbow */
.pdf-row-special td { padding: 5px 10px; }


.next-materieel,
.omloop-materieel {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.72rem;
    color: var(--d-text-muted);
    opacity: 0.95;
}

.omloop-materieel {
    display: block;
    margin-left: 0;
    margin-top: 2px;
    font-size: 0.68rem;
}

.special-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--d-text-secondary);
}

.bus-op-lijn-halte {
    font-weight: 400;
    color: var(--d-text-muted);
    font-size: 0.78rem;
}

/* Perron / platform badge */
.perron {
    display: inline-block;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.13);
    padding: 0 4px;
    border-radius: 3px;
    font-size: 0.85em;
    letter-spacing: 0.02em;
}

/* Bus op lijn halte details */
.bus-halte-label {
    display: block;
    font-size: 0.82rem;
}
.bus-route-label {
    display: block;
    font-size: 0.75rem;
    color: var(--d-text-muted);
    margin-top: 2px;
}

.pauze-duur {
    font-size: 0.78rem;
    color: var(--d-text-muted);
    font-weight: 400;
    margin-left: 4px;
}

.pdf-row-special {
    border-left: 3px solid var(--d-border-input);
}

.pdf-row-subtle {
    opacity: 0.6;
    font-size: 0.88em;
    border-left-color: transparent;
}

/* Live clock in dienst detail */
.dienst-status-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.dienst-live-clock {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    flex-shrink: 0;
}

.live-clock-icon {
    font-size: 0.9rem;
}

.live-clock-time {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--d-accent-text);
    letter-spacing: 1px;
}

/* Omloop map button */
.omloop-map-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.omloop-map-btn.is-active {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.2);
}

.omloop-map-btn.is-inactive {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.3);
}

.omloop-map-btn.is-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.25);
}

.omloop-map-btn:hover {
    filter: brightness(1.08);
    text-decoration: none;
}

.break-alarm-test-btn {
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.16);
    color: var(--d-text);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.break-alarm-test-btn:hover {
    background: rgba(59, 130, 246, 0.24);
}

.dienst-link {
    color: var(--d-accent-text);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px solid var(--d-accent-text);
}
.dienst-link:hover { opacity: 0.7; text-decoration: none; }

.table-link {
    color: var(--d-accent-text);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--d-accent-text);
    transition: opacity 0.15s;
}
.table-link:hover { opacity: 0.7; }

/* Next Activity Info */
.next-activity-info {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(34, 197, 94, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.15);
    font-size: 0.82rem;
    flex-wrap: wrap;
    min-height: 34px;
}

.next-activity-info:empty { display: none; }

.next-prefix {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--d-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.next-type-badge {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--d-text-bright);
    padding: 1px 8px;
    border-radius: 4px;
    background: rgba(34, 197, 94, 0.12);
}

.next-type-badge.is-now {
    background: rgba(59, 130, 246, 0.15);
    color: var(--d-accent-text);
    animation: pulse 2s infinite;
}

.next-lijn {
    font-size: 0.72rem;
    height: 18px;
    min-width: 22px;
}

.next-omloop {
    font-size: 0.72rem;
    color: var(--d-text-muted);
}

.next-route {
    font-size: 0.78rem;
    color: var(--d-text-secondary);
}

.next-time {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--d-accent-text);
    margin-left: auto;
}

/* ============================================
   Break Alarm Setting
   ============================================ */

.break-alarm-setting {
    padding: 8px 0;
}

.break-alarm-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.break-alarm-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.break-alarm-icon {
    font-size: 1.3rem;
}

.break-alarm-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--d-text-bright);
}

.break-alarm-desc {
    display: block;
    font-size: 0.72rem;
    color: var(--d-text-muted);
    margin-top: 1px;
}

.break-alarm-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.break-alarm-select {
    padding: 4px 8px;
    background: var(--d-bg-input);
    border: 1px solid var(--d-border-input);
    border-radius: 6px;
    color: var(--d-text);
    font-size: 0.78rem;
    cursor: pointer;
}

/* ============================================
   Break Timer Widget
   ============================================ */

.break-timer-widget {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 10px 0;
    text-align: center;
}

.break-timer-widget.urgent {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    animation: urgentPulse 2s ease-in-out infinite;
}

.break-timer-widget.next-break {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.2);
}

@keyframes urgentPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: 0 0 12px 2px rgba(239, 68, 68, 0.15); }
}

.break-timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.break-timer-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--d-text-bright);
}

.break-timer-ends {
    font-size: 0.72rem;
    color: var(--d-text-muted);
}

.break-timer-countdown {
    margin: 4px 0;
}

.break-timer-big {
    font-size: 2.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--d-text-bright);
    letter-spacing: 2px;
}

.break-timer-widget.urgent .break-timer-big { color: #ef4444; }

.break-timer-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0 6px;
}

[data-theme="light"] .break-timer-bar {
    background: rgba(0, 0, 0, 0.06);
}

.break-timer-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 3px;
    transition: width 1s linear;
}

.break-timer-fill.urgent {
    background: #ef4444;
}

.break-timer-footer {
    font-size: 0.75rem;
    color: var(--d-text-muted);
}

.break-timer-time {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--d-text-bright);
}

.break-timer-sub {
    font-size: 0.75rem;
    color: var(--d-text-muted);
    margin-top: 2px;
}

/* ============================================
   Break Overview
   ============================================ */

.break-overview {
    padding: 8px 0;
    margin-top: 4px;
    border-top: 1px solid var(--d-border);
}

.break-overview-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--d-text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.break-overview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.78rem;
}

.break-overview-item.is-past { opacity: 0.35; }
.break-overview-item.is-current { font-weight: 600; }

.break-ov-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--d-text-muted);
    flex-shrink: 0;
}

.break-ov-dot.active {
    background: #22c55e;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.5);
}

.break-ov-label { color: var(--d-text); }
.break-ov-time {
    color: var(--d-text-muted);
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.72rem;
    margin-left: auto;
}
.break-ov-duur {
    color: var(--d-text-muted);
    font-size: 0.72rem;
    min-width: 40px;
    text-align: right;
}

/* Looptijden context rondom pauze */
.break-loop-context {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0 3px 14px;
    font-size: 0.75rem;
    color: var(--d-text-muted);
    border-left: 2px solid var(--d-border);
    margin-left: 3px;
}
.break-loop-context.is-past { opacity: 0.35; }

.break-loop-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
}
.break-loop-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.break-loop-time {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.7rem;
    margin-left: auto;
    flex-shrink: 0;
}
.break-loop-duur {
    font-size: 0.7rem;
    min-width: 36px;
    text-align: right;
    flex-shrink: 0;
}

/* ============================================
   Break Alert (In-Page)
   ============================================ */

.break-alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.break-alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.break-alert-text {
    flex: 1;
    min-width: 0;
}

.break-alert-text strong {
    display: block;
    font-size: 0.9rem;
    color: var(--d-text-bright);
    margin-bottom: 2px;
}

.break-alert-text span {
    font-size: 0.8rem;
    color: var(--d-text-muted);
}

/* ============================================
   Card View (Mobile)
   ============================================ */

.card-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
}

.act-card {
    background: var(--d-bg-card);
    border: 1px solid var(--d-border);
    border-radius: 10px;
    padding: 10px 12px;
    border-left: 3px solid var(--act-color, var(--d-accent));
    transition: opacity 0.2s, transform 0.2s;
}

.act-card.card-past {
    opacity: 0.35;
}

.act-card.card-current {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    border-left-color: var(--d-accent);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.12);
}

[data-theme="light"] .act-card.card-current {
    background: rgba(59, 130, 246, 0.06);
}

.act-card.card-next {
    background: rgba(34, 197, 94, 0.04);
    border-color: rgba(34, 197, 94, 0.18);
    border-left-color: #22c55e;
}

.act-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card-lijn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 6px;
    background: var(--act-color, var(--d-accent));
    color: #fff;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
}

.card-icon {
    font-size: 1rem;
}

.card-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--d-text-bright);
}

.card-duur-badge {
    font-size: 0.72rem;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--d-border);
    border-radius: 4px;
    color: var(--d-text-muted);
    margin-left: auto;
}

[data-theme="light"] .card-duur-badge {
    background: rgba(0, 0, 0, 0.03);
}

.card-countdown {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--d-accent);
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.act-card-mid {
    margin-top: 4px;
    font-size: 0.78rem;
}

.card-route {
    color: var(--d-text);
}

.act-card-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.card-times {
    font-size: 0.75rem;
    color: var(--d-text-muted);
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
}

.card-duur {
    font-size: 0.72rem;
    color: var(--d-text-muted);
}

.card-omloop {
    font-size: 0.72rem;
    color: var(--d-accent);
    text-decoration: none;
    margin-left: auto;
}

.card-omloop:hover {
    text-decoration: underline;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    text-align: center;
    padding: 48px 20px;
    max-width: 400px;
    margin: 0 auto;
}
.empty-state h2 { font-size: 1.2rem; color: var(--d-text-secondary); margin-top: 16px; }
.empty-state p { font-size: 0.88rem; color: var(--d-text-muted); margin-top: 8px; }
.no-data { text-align: center; color: var(--d-text-muted); font-size: 0.85rem; padding: 12px; }

/* ============================================
   Halte Names Toggle
   ============================================ */

.halte-toggle-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--d-bg-card);
    border: 1px solid var(--d-border);
    border-radius: 8px;
    margin-bottom: 10px;
}

.halte-toggle-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--d-text-secondary);
}

.halte-toggle-label {
    font-size: 0.82rem;
    font-weight: 600;
}

/* ============================================
   Active Controls (Notifications + Status)
   ============================================ */

.active-controls {
    margin-top: 10px;
    background: var(--d-bg-card);
    border-radius: 10px;
    border: 1px solid var(--d-border);
    overflow: hidden;
}

.active-controls-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--d-border);
}
.active-controls-header h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--d-text-bright);
}

.notifications-list { padding: 10px 16px; }

.notification-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--d-bg-input);
    border-radius: 8px;
    margin-bottom: 6px;
    border: 1px solid var(--d-border);
}
.notification-item.is-past { opacity: 0.35; }

.notification-item .notif-info { flex: 1; min-width: 0; }

.notif-title { font-size: 0.82rem; font-weight: 600; color: var(--d-text-bright); }

.notif-time {
    font-size: 0.72rem;
    color: var(--d-text-muted);
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

.notif-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.notif-toggle input { opacity: 0; width: 0; height: 0; }
.notif-toggle .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--d-border-input);
    border-radius: 22px;
    transition: 0.3s;
}
.notif-toggle .slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.notif-toggle input:checked + .slider { background: #22c55e; }
.notif-toggle input:checked + .slider::before { transform: translateX(18px); }
.notification-item.is-past .slider { cursor: not-allowed; }

.notif-active-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #22c55e;
    animation: pulse 2s infinite;
}

/* ============================================
   Omloop Status Panel
   ============================================ */



/* ============================================
   In-Page Alert
   ============================================ */

.in-page-alert {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 12px 16px;
    animation: slideDown 0.3s ease;
}

.alert-content {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #22c55e;
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    font-weight: 600;
    font-size: 0.9rem;
}
.alert-text { flex: 1; }
.alert-dismiss {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.82rem;
}
.alert-dismiss:hover { background: rgba(255,255,255,0.3); }

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 480px) {
    .header-content { padding: 10px 12px; }
    .header-title { font-size: 1.05rem; }
    #searchInput { font-size: 16px; padding: 11px 40px; }
    .result-card { padding: 10px 12px; }
    .pdf-dienst-badge { font-size: 0.95rem; padding: 4px 10px; }
    .pdf-dienst-times { font-size: 0.9rem; }
    .pdf-table { font-size: 0.78rem; }
    .pdf-table thead th { padding: 6px 6px; font-size: 0.68rem; }
    .pdf-table tbody td { padding: 4px 6px; }
    .col-halte { max-width: 90px; }
    .dienst-status-bar { flex-direction: column; align-items: stretch; gap: 6px; }
    .next-activity-info { justify-content: flex-start; }
}

@media (min-width: 768px) {
    .search-container { display: flex; gap: 12px; align-items: flex-start; }
    .search-input-wrapper { flex: 1; }
    .search-filters { margin-top: 0; }
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Bottom Navigation (Mobile)
   ============================================ */

.bottom-nav-diensten {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: var(--d-bg-card);
    border-top: 1px solid var(--d-border);
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav-diensten .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--d-text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 16px;
    border-radius: 8px;
    transition: all 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-diensten .bottom-nav-item svg {
    opacity: 0.5;
    transition: all 150ms ease;
}

.bottom-nav-diensten .bottom-nav-item.active {
    color: var(--d-accent);
}

.bottom-nav-diensten .bottom-nav-item.active svg {
    opacity: 1;
    fill: var(--d-accent);
}

.bottom-nav-diensten .bottom-nav-item:hover {
    color: var(--d-accent);
}

.bottom-nav-diensten .bottom-nav-item:hover svg {
    opacity: 1;
}

/* ============================================
   Omleidingen / Service Alerts
   ============================================ */

.omleidingen-container {
    margin: 6px 0 10px;
}

.omleidingen-outer {
    border: 1px solid rgba(255, 152, 0, 0.25);
    border-radius: 8px;
    overflow: hidden;
}

.omleidingen-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    background: rgba(255, 152, 0, 0.1);
    border-left: 3px solid #ff9800;
    list-style: none;
    user-select: none;
}

.omleidingen-summary::-webkit-details-marker {
    display: none;
}

.omleidingen-summary-text {
    font-size: 0.88em;
    font-weight: 700;
    color: var(--d-text);
    flex: 1;
}

.omleidingen-chevron {
    flex-shrink: 0;
}

.omleidingen-chevron::after {
    content: '▸';
    font-size: 0.85em;
    color: var(--d-text-muted);
}

details[open] > .omleidingen-summary .omleidingen-chevron::after {
    content: '▾';
}

.omleidingen-list {
    padding: 0;
}

.omleiding-item-details {
    border-left: 3px solid rgba(255, 152, 0, 0.4);
    border-radius: 0 6px 6px 0;
    margin-top: 0;
    background: rgba(255, 152, 0, 0.04);
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.omleiding-item-details:last-child {
    border-radius: 0 0 6px 0;
}

.omleiding-item {
    padding: 8px 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.omleiding-item::-webkit-details-marker {
    display: none;
}

.omleiding-item.my-lijn {
    background: rgba(255, 152, 0, 0.08);
}

.omleiding-item.my-lijn:hover {
    background: rgba(255, 152, 0, 0.14);
}

.omleiding-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.omleiding-chevron {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.8em;
    color: var(--d-text-muted);
    transition: transform 0.2s;
}

.omleiding-chevron::after {
    content: '▸';
}

details[open] > .omleiding-item .omleiding-chevron::after {
    content: '▾';
}

.omleiding-lijnen {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
    padding-top: 1px;
}

.omleiding-lijn {
    background: #ff9800;
    color: #fff;
    font-weight: 700;
    font-size: 0.72em;
    padding: 1px 5px;
    border-radius: 3px;
    line-height: 1.4;
}

.omleiding-lijn.muted {
    background: rgba(255, 152, 0, 0.3);
    color: var(--d-text-muted);
    font-weight: 500;
}

.omleiding-title {
    font-size: 0.82em;
    color: var(--d-text-muted);
    line-height: 1.3;
}

.omleiding-detail {
    padding: 0 10px 10px;
}

.omleiding-desc {
    font-size: 0.78em;
    color: var(--d-text-muted);
    line-height: 1.4;
    margin-bottom: 8px;
    opacity: 0.85;
}

.omleiding-map-container {
    width: 100%;
    height: 280px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.omleiding-link {
    font-size: 0.75em;
    color: #ff9800;
    text-decoration: none;
    display: inline-block;
    margin-top: 4px;
}

.omleiding-link:hover {
    text-decoration: underline;
}

/* Map marker styles */
.omleiding-stop-marker {
    background: transparent !important;
    border: none !important;
}

/* Halte iconen op de kaart (U-OV stijl) */
.oml-halte-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

/* Lichte popup voor lichte kaart */
.omleiding-popup-light .leaflet-popup-content-wrapper {
    background: #fff;
    color: #333;
    border-radius: 6px;
    font-size: 0.82em;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.omleiding-popup-light .leaflet-popup-tip {
    background: #fff;
}

/* Route info for chauffeurs */
.omleiding-route-info {
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.omleiding-route-section {
    padding: 6px 10px;
}
.omleiding-route-section + .omleiding-route-section {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.omleiding-route-label {
    font-size: 0.78em;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.omleiding-route-label.cancelled {
    color: #d32f2f;
}
.omleiding-route-label.replacement {
    color: #2e7d32;
}
.omleiding-route-stops {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-left: 4px;
}
.omleiding-route-stop {
    font-size: 0.78em;
    color: var(--d-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}
.omleiding-route-stop.cancelled {
    text-decoration: line-through;
    opacity: 0.6;
}
.omleiding-route-stop.replacement {
    color: var(--d-text);
    font-weight: 500;
}
.omleiding-stop-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.omleiding-stop-indicator.cancelled {
    background: #d32f2f;
}
.omleiding-stop-number {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2e7d32;
    color: #fff;
    font-size: 0.72em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
/* Map legend */
.omleiding-map-legend {
    display: flex;
    gap: 14px;
    padding: 6px 2px;
    font-size: 0.74em;
    color: var(--d-text-muted);
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.legend-dot.cancelled {
    background: #d32f2f;
}
.legend-dot.replacement {
    background: #2e7d32;
}
.legend-line {
    width: 22px;
    height: 3px;
    border-radius: 2px;
}
.legend-line.detour {
    background: #2e7d32;
}
.legend-line.normal {
    background: repeating-linear-gradient(90deg, #d32f2f 0, #d32f2f 6px, transparent 6px, transparent 10px);
    height: 3px;
}

/* Pijlmarkers op de route */
.omleiding-arrow-marker {
    background: transparent !important;
    border: none !important;
}


body {
    padding-bottom: 70px;
}

@media (min-width: 769px) {
    .bottom-nav-diensten {
        display: none !important;
    }
    
    body {
        padding-bottom: 0;
    }
}
