/* ── DEPARTURE BOARD — FULL STYLESHEET ── */

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

:root {
  --bg:     #090f1a;
  --surf:   #0f1923;
  --surf2:  #141f2e;
  --border: rgba(255,255,255,0.07);
  --text:   #edf2f7;
  --muted:  #7a8fa6;
  --dim:    rgba(255,255,255,0.28);
  --soon:   #34d058;
  --gold:   #f0a500;
  --blue:   #2684d4;
  --font:   'Inter', sans-serif;
}

html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* ── TIME BAR (status bar) ── */
.time-bar {
  flex-shrink: 0;
  background: #0C2340;
  border-bottom: 2px solid rgba(255,255,255,0.09);
  padding: 1.1vh 2.2vw;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.time-bar-logo img { height: 5.5vh; display: block; }
.time-bar-center { text-align: center; grid-column: 2; }
.time-bar-location {
  font-size: 1.8vh;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 0.2vh;
  text-align: center;
}
.time-bar-clock {
  font-size: 7vh;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.time-bar-date { font-size: 1.6vh; color: var(--dim); margin-top: 0.3vh; }
.time-bar-right { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.day-toggle {
  display: none;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,0.14);
}
.day-btn {
  font-family: var(--font);
  font-size: 1.4vh;
  font-weight: 600;
  padding: 0.8vh 1.2vw;
  border: none;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.day-btn.active { background: var(--blue); color: #fff; }
.day-btn:hover:not(.active) { background: rgba(255,255,255,0.07); color: #fff; }
.auto-label { display: none; }
.legend-hint { display: inline-flex; align-items: center; gap: 0.45vw; font-size: 1.7vh; color: rgba(255,255,255,0.28); margin-top: 0.6vh; letter-spacing: .04em; }
.legend-swatch { width: 1.6vh; height: 1.6vh; border-radius: 3px; border: 1.5px solid var(--soon); flex-shrink: 0; }

/* ── MODIFIED SCHEDULE ALERT ── */
.mod-bar {
  flex-shrink: 0;
  background: rgba(110,50,0,0.85);
  border-bottom: 1px solid var(--gold);
  padding: 0.7vh 2.2vw;
  display: none;
}
.mod-bar.on { display: block; }
.mod-bar-inner {
  display: flex;
  align-items: center;
  gap: 0.8vw;
  font-size: 1.5vh;
  color: #ffe0a0;
}
.mod-bar-inner svg { flex-shrink: 0; width: 1.7vh; height: 1.7vh; }

/* ── NO WEEKEND SERVICE BAR ── */
.no-wkn-bar {
  flex-shrink: 0;
  background: rgba(12,35,64,0.95);
  border-bottom: 1px solid rgba(38,132,212,0.45);
  padding: 0.7vh 2.2vw;
  display: none;
}
.no-wkn-bar .mod-bar-inner { color: #93c5fd; }

/* ── LATE NITE BAR ── */
.ln-bar {
  flex-shrink: 0;
  background: rgba(40,10,70,0.92);
  border-bottom: 1px solid rgba(180,100,255,0.25);
  padding: 0.7vh 2.2vw;
  display: none;
}
.ln-bar.on { display: block; }
.ln-bar .mod-bar-inner { color: #c084fc; }

/* ── PANELS ── */
.panels {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.15fr 1px 1fr;
}
.panel-divider { background: var(--border); }
.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.panel-label {
  flex-shrink: 0;
  background: var(--surf2);
  border-bottom: 1px solid var(--border);
  padding: 0.7vh 2.2vw;
  font-size: 1.25vh;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--muted);
}
.panel-head {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 0.7fr 2.5fr 1.2fr 1fr;
  gap: 0.8vw;
  padding: 0.55vh 2.2vw;
  background: var(--surf);
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.ph-cell {
  font-size: 1.2vh;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
}
.ph-cell.c { text-align: center; }
.panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── DEPARTURE ROW ── */
.dep-row {
  flex: 1;
  display: grid;
  grid-template-columns: 0.7fr 2.5fr 1.2fr 1fr;
  gap: 0.8vw;
  padding: 0 2.2vw;
  align-items: center;
  border-bottom: 1px solid var(--border);
  min-height: 0;
  transition: background .15s;
}
.dep-row:last-child { border-bottom: none; }
.dep-row.hidden { display: none; }

/* ── ROUTE BADGE ── */
.badge {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6vh;
  font-weight: 800;
  border-radius: 8px;
  padding: 1.1vh 0;
  letter-spacing: .04em;
  color: #fff;
  width: 100%;
}
.badge.dark { color: #000; }

/* ── DESTINATION ── */
.td-dest { min-width: 0; overflow: hidden; }
.route-name {
  font-size: 1.7vh;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-stops {
  font-size: 1.4vh;
  color: var(--muted);
  margin-top: 0.25vh;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dir-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35vw;
  margin-top: 0.4vh;
  font-size: 1.35vh;
  color: var(--muted);
}
.dir-tag svg { flex-shrink: 0; width: 1.35vh; height: 1.35vh; }

.cross-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35vw;
  margin-top: 0.5vh;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.35);
  color: #fbbf24;
  font-size: 1.35vh;
  font-weight: 700;
  padding: 0.28vh 0.55vw;
  border-radius: 20px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.cross-tag svg { flex-shrink: 0; width: 1.35vh; height: 1.35vh; }

.mohawk-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35vw;
  margin-top: 0.5vh;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.35);
  color: #fbbf24;
  font-size: 1.35vh;
  font-weight: 700;
  padding: 0.28vh 0.55vw;
  border-radius: 20px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.mohawk-tag svg { flex-shrink: 0; width: 1.35vh; height: 1.35vh; }

/* ── DEPARTURE TIMES ── */
.td-time { text-align: center; }
.dep-time {
  font-size: 4.8vh;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}
.dep-time.no-svc {
  font-size: 1.7vh;
  font-weight: 500;
  color: var(--muted);
  font-style: italic;
}
.dep-time.soon { color: var(--soon); }
.dep-row.approaching { box-shadow: inset 0 0 0 2px var(--soon); }
.td-after { text-align: center; }
.after-time {
  font-size: 2.8vh;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.after-time.no-more {
  font-size: 1.65vh;
  font-weight: 400;
  font-style: italic;
  color: rgba(255,255,255,0.2);
}

/* ── SERVICE ALERTS BAR ── */
.alerts-bar {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: stretch;
  border-top: 2px solid rgba(255,255,255,0.11);
  background: rgba(0,0,0,0.38);
  min-height: 4.8vh;
  overflow: hidden;
}
.alerts-label {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 1.5vw;
  font-size: 1.3vh;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
  white-space: nowrap;
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
  z-index: 1;
}
.alerts-ticker {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.alert-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55vw;
  font-size: 1.75vh;
  font-weight: 600;
  padding: 0.55vh 1.2vw;
  border-radius: 20px;
  white-space: nowrap;
}
.alert-item.green { background: rgba(52,208,88,0.12); border: 1px solid rgba(52,208,88,0.35); color: #4ade80; }
.alert-item.yellow { background: rgba(240,165,0,0.12); border: 1px solid rgba(240,165,0,0.35); color: #fbbf24; }
.alert-item.red {
  background: rgba(220,38,38,0.15);
  border: 1px solid rgba(220,38,38,0.4);
  color: #f87171;
  position: absolute;
  animation: ticker-scroll 22s linear infinite;
}
.alert-item svg { flex-shrink: 0; width: 1.75vh; height: 1.75vh; }

@keyframes ticker-scroll {
  0%   { left: 100%; }
  100% { left: -100%; }
}

/* ── LATE NITE TAG ── */
.ln-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35vw;
  margin-top: 0.5vh;
  background: rgba(180,100,255,0.12);
  border: 1px solid rgba(180,100,255,0.3);
  color: #c084fc;
  font-size: 1.35vh;
  font-weight: 700;
  padding: 0.28vh 0.55vw;
  border-radius: 20px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.ln-tag svg { flex-shrink: 0; width: 1.35vh; height: 1.35vh; }

/* ── DISCLAIMER ── */
.disclaimer {
  flex-shrink: 0;
  padding: 0.55vh 2.2vw;
  text-align: center;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
}
.disclaimer p { font-size: 1.1vh; color: #fff; font-weight: 700; line-height: 1.5; }
.disclaimer a { color: rgba(255,255,255,0.25); }

/* ── MOBILE ── */
@media (max-width: 768px) {
  html, body {
    height: auto;
    overflow: auto;
  }

  /* Time bar */
  .time-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 16px 10px;
  }
  .time-bar-logo img { height: 32px; }
  .time-bar-center { grid-column: unset; }
  .time-bar-location { font-size: 0.65rem; letter-spacing: .12em; margin-bottom: 0; }
  .time-bar-clock { font-size: 2.6rem; }
  .time-bar-date { font-size: 0.72rem; margin-top: 1px; }
  .time-bar-right { align-items: center; margin-top: 4px; }
  .legend-hint { font-size: 0.7rem; gap: 6px; margin-top: 0; }
  .legend-swatch { width: 11px; height: 11px; }

  /* Alert bars */
  .mod-bar, .no-wkn-bar, .ln-bar { padding: 7px 16px; }
  .mod-bar-inner { font-size: 0.75rem; gap: 8px; }
  .mod-bar-inner svg { width: 15px; height: 15px; }

  /* Panels: stack vertically, scroll freely */
  .panels { display: flex; flex-direction: column; }
  .panel-divider { display: none; }
  .panel { overflow: visible; }
  .panel-label { padding: 7px 16px; font-size: 0.68rem; }
  .panel-head {
    grid-template-columns: 52px 1fr 90px 90px;
    gap: 6px;
    padding: 5px 16px;
  }
  .ph-cell { font-size: 0.62rem; }

  /* Departure rows */
  .dep-row {
    flex: none;
    grid-template-columns: 52px 1fr 90px 90px;
    gap: 6px;
    padding: 16px 16px;
    min-height: unset;
  }
  .badge { font-size: 0.95rem; padding: 5px 0; border-radius: 6px; }
  .route-name { font-size: 0.88rem; white-space: normal; }
  .route-stops { font-size: 0.68rem; white-space: normal; }
  .dir-tag { font-size: 0.65rem; gap: 4px; margin-top: 3px; }
  .dir-tag svg { width: 11px; height: 11px; }
  .cross-tag { font-size: 0.62rem; gap: 4px; padding: 2px 6px; white-space: normal; }
  .cross-tag svg { width: 10px; height: 10px; flex-shrink: 0; }
  .ln-tag { font-size: 0.62rem; padding: 2px 6px; gap: 4px; }
  .ln-tag svg { width: 10px; height: 10px; }
  .mohawk-tag { font-size: 0.62rem; padding: 2px 6px; gap: 4px; white-space: normal; }
  .mohawk-tag svg { width: 10px; height: 10px; flex-shrink: 0; }

  /* Times */
  .dep-time { font-size: 1.45rem; }
  .dep-time.no-svc { font-size: 0.62rem; white-space: normal; }
  .td-after { min-width: 0; }
  .after-time { font-size: 0.95rem; }
  .after-time.no-more { font-size: 0.6rem; white-space: normal; line-height: 1.3; }

  /* Alerts */
  .alerts-bar { min-height: 38px; }
  .alerts-label { font-size: 0.62rem; padding: 0 10px; }
  .alert-item { font-size: 0.75rem; gap: 5px; padding: 5px 10px; }

  /* Disclaimer */
  .disclaimer { padding: 8px 16px; }
  .disclaimer p { font-size: 0.68rem; }
}
