:root {
  --lijn-yellow: #FFD100;
  --lijn-black: #1A1A1A;
  --ink: #1A1A1A;
  --paper: #FAFAF7;
  --line: #E4E1D8;
  --muted: #6B6A63;
  --good: #1E7A4C;
  --bad: #B23B2E;
  --you-blue: #2A6FDB;
  --radius: 10px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  overscroll-behavior-y: contain;
}
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
#main-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
h1, h2, .display {
  font-family: 'Barlow Condensed', system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ---- Header ---- */
header {
  background: var(--lijn-black);
  color: var(--lijn-yellow);
  padding: 14px 16px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 4px solid var(--lijn-yellow);
  gap: 10px;
}
header h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  line-height: 1;
}
header .tag {
  font-family: 'Inter', sans-serif;
  text-transform: none;
  font-size: 11px;
  color: #C9C7BC;
  letter-spacing: 0;
  margin-top: 2px;
}
#status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4a4a3a;
  display: inline-block;
  margin-right: 6px;
  transition: background 0.25s;
}
#status-dot.live { background: var(--lijn-yellow); }
.status-line {
  font-size: 11px;
  color: #C9C7BC;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  text-align: right;
  white-space: nowrap;
}
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.header-buttons {
  display: flex;
  gap: 6px;
}
.header-btn {
  border: 1.5px solid var(--lijn-yellow);
  background: transparent;
  color: var(--lijn-yellow);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
}
.header-btn:active { transform: translateY(1px); }

/* ---- Add form ---- */
#add-panel {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}
#add-form {
  display: flex;
  gap: 6px;
}
#add-form input {
  font-family: 'Inter', sans-serif;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  font-size: 14px;
  background: var(--paper);
  min-width: 0;
}
#add-form input:focus {
  outline: none;
  border-color: var(--lijn-black);
}
#vehicle-id { flex: 0 0 32%; }
#alias { flex: 1 1 auto; }
#add-form button {
  flex: 0 0 auto;
  background: var(--lijn-yellow);
  color: var(--lijn-black);
  border: 1.5px solid var(--lijn-black);
  border-radius: var(--radius);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0 14px;
  cursor: pointer;
}
#add-form button:active { transform: translateY(1px); }
#form-error {
  font-size: 12px;
  color: var(--bad);
  margin: 6px 2px 0;
  min-height: 14px;
}
#poll-caption {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 2px 0;
}

/* ---- Route (GPX) controls ---- */
#route-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
#route-input { display: none; }
#route-load-btn {
  flex: 0 0 auto;
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--lijn-black);
  border-radius: var(--radius);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
#route-load-btn:active { transform: translateY(1px); }
#route-load-btn .swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--lijn-yellow) 50%, var(--lijn-black) 50%);
  flex: 0 0 auto;
}
#route-chip {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-left: 5px solid var(--lijn-black);
  border-radius: var(--radius);
  padding: 5px 6px 5px 10px;
  max-width: 100%;
}
#route-chip .route-name {
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
#route-chip button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 35px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 0px;
  flex: 0 0 auto;
}
#route-error {
  font-size: 12px;
  color: var(--bad);
  width: 100%;
}

/* ---- Tracked list (bus stop board feel) ---- */
#board {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  white-space: nowrap;
  padding: 8px 10px;
  display: flex;
  gap: 8px;
}
#board:empty { display: none; padding: 0; border-bottom: none; }
.chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-left: 5px solid var(--chip-color, var(--lijn-black));
  border-radius: var(--radius);
  padding: 6px 8px 6px 10px;
  cursor: pointer;
}
.chip.following {
  background: var(--chip-color, var(--lijn-black));
  border-color: var(--chip-color, var(--lijn-black));
}
.chip.following .alias,
.chip.following .vehicle-num { color: #fff; }
.chip.following .sub { color: rgba(255,255,255,0.8); }
.chip.following .sub.err { color: #FFD9D3; }
.chip.following button { color: rgba(255,255,255,0.8); }
.chip .meta { line-height: 1.2; }
.chip .alias {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 15px;
  text-transform: none;
}
.chip .vehicle-num {
  font-size: 11px;
  color: var(--ink);
  font-weight: 500;
}
.chip .sub {
  font-size: 10.5px;
  color: var(--muted);
}
.chip .sub.err { color: var(--bad); }
.chip .sub.paused { font-style: italic; }
.chip button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 35px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}

/* ---- Map ---- */
#map-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
#map {
  width: 100%;
  height: 100%;
}
.map-hint {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 500;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  text-align: left;
}
.map-hint h2 { font-size: 17px; margin: 0 0 2px; color: var(--ink); }
.map-hint p { font-size: 12.5px; margin: 0; color: var(--muted); }

.bus-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(45deg);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.bus-pin span {
  transform: rotate(-45deg);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,0.35);
}
.you-pin {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--you-blue);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--you-blue), 0 1px 5px rgba(0,0,0,0.4);
}
.leaflet-popup-content-wrapper { border-radius: 8px; }
.leaflet-popup-content { font-family: 'Inter', sans-serif; font-size: 13px; margin: 8px 10px; }
.popup-title { font-family: 'Barlow Condensed', sans-serif; font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.popup-address { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.popup-address.loading { font-style: italic; }

.footer {
    display: flex;
    position: fixed;
    left: 5px;
    bottom: 5px;
    background: #222;
    color: #888;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 5px;
    width: 116px;
    z-index: 1000000;
    cursor: pointer;
}

/* ── INTRO OVERLAY ── */
#intro-overlay {
    position: fixed;
    inset: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* start visible; JS adds .hide to fade out */
}

    #intro-overlay.hide {
        animation: overlayFadeOut 0.6s ease forwards;
    }

@keyframes overlayFadeOut {
    to {
        opacity: 0;
        pointer-events: none;
    }
}

/* Logo wrapper */
.logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: logoIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes logoIn {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.logo-wrap.pulse {
    animation: logoPulse 1.2s ease-in-out forwards;
}

@keyframes logoPulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.06);
    }

    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}

.logo-icon {
    width: 50%;
    /*background-color: white;*/
}

@media (max-width: 412px) and (max-height: 915px) {
    .logo-icon {
        width: 50%;
    }

    .logo-name {
        font-size: 1rem;
        width: 80%;
        text-align: center;
    }

    .nav-links {
        /*gap: 0.5rem !important;*/
        height: 47px;
        width: 167px;
        flex-wrap: wrap;
    }
}

@media (max-width: 915px) and (max-height: 412px) {
    .logo-icon {
        width: 35%;
    }

    .logo-name {
        font-size: 0.8rem;
        width: 80%;
        text-align: center;
    }
}

.vrijwilligers {
    color: #f0f0f0;
    animation: vrijwilligers 3s ease;
}

@keyframes vrijwilligers {
    0%, 33% {
        color: blue;
        transform: scale(1.2);
    }

    34%, 100% {
        color: #f0f0f0;
        transform: scale(1);
    }
}

.tappen {
    color: #f0f0f0;
    animation: tappen 3s ease;
}

@keyframes tappen {
    0%, 33% {
        color: #f0f0f0;
        transform: scale(1);
    }

    34%, 66% {
        color: yellow;
        transform: scale(1.2);
    }

    67%, 100% {
        color: #f0f0f0;
        transform: scale(1);
    }
}

.goededoel {
    color: #f0f0f0;
    animation: goededoel 3s ease;
}

@keyframes goededoel {
    0%, 66% {
        color: #f0f0f0;
        transform: scale(1);
    }

    67%, 100% {
        color: red;
        transform: scale(1.2);
    }
}



.menu-logo {
    width: 65px;
    /*height: 100px;
            background-color: white;*/
}

.logo-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    /*text-transform: uppercase;*/
    color: #ffffff;
}

/* loading dots */
.dots {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

    .dots span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #555;
        animation: dotPop 1.2s ease infinite;
    }

        .dots span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .dots span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes dotPop {
    0%, 80%, 100% {
        background: #444;
        transform: scale(1);
    }

    40% {
        background: #aaa;
        transform: scale(1.4);
    }
}
