/* yamtam evolution: month-stepping transit timeline. */

:root {
  --bg: #111827;
  --fg: #e5e7eb;
  --muted: #9ca3af;
  --accent: #f59e0b;
  --panel: #1f2937;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}

#app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100% - 52px);
}

#mapLink {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 10px;
  z-index: 1000;
  background: var(--panel);
  color: var(--fg);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

#mapLink:hover {
  color: var(--accent);
}

#map {
  flex: 1;
  min-height: 55%;
  background: var(--bg);
}

#panel {
  flex: none;
  height: 32vh;
  overflow-y: auto;
  background: var(--panel);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}

#month {
  margin: 0;
  font-size: 20px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

#summary {
  color: var(--muted);
  margin-bottom: 8px;
}

#summary .sys {
  font-weight: 600;
}

#summary button.sys {
  display: block;
  background: none;
  border: none;
  padding: 2px 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

#summary button.sys:hover {
  text-decoration: underline;
}

.sys-list {
  list-style: none;
  margin: 2px 0 6px;
  padding-left: 18px;
  color: var(--fg);
}

.sys-list li {
  padding: 2px 0;
  border-bottom: 1px solid #374151;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
}

.sys-list li:hover {
  color: var(--accent);
}

.sys-list li.nolat {
  color: var(--muted);
  cursor: default;
}

.station-arrow {
  background: none;
  border: none;
}

/* downward arrow hovering just above the picked station's dot */
.station-arrow span {
  position: absolute;
  left: -7px;
  top: -42px;
  width: 14px;
  height: 34px;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px #000);
}

.station-arrow span::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0;
  width: 4px;
  height: 24px;
  background: var(--accent);
}

.station-arrow span::after {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 12px solid var(--accent);
}

#events {
  list-style: none;
  margin: 0;
  padding: 0;
}

#events li {
  padding: 4px 0;
  border-bottom: 1px solid #374151;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

#events li:hover {
  color: var(--accent);
}

#events .kind {
  width: 12px;
  flex: none;
  text-align: center;
}

#events .kind.open { color: #22c55e; }
#events .kind.close { color: #ef4444; }

#events .system {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
  text-transform: uppercase;
}

#bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 12px calc(env(safe-area-inset-bottom));
  background: var(--panel);
  box-sizing: border-box;
}

#bar button {
  background: none;
  border: 1px solid var(--muted);
  color: var(--fg);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
}

#scrub {
  flex: 1;
  accent-color: var(--accent);
}

#date {
  min-width: 84px;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 900px) {
  #app {
    flex-direction: row;
  }

  #map {
    flex: 1;
    height: 100%;
  }

  #panel {
    width: 340px;
    height: 100%;
    border-left: 1px solid #374151;
  }
}
