/* Standalone styles for the live departures board. Self-contained, no shared
   stylesheet is imported, so this cannot affect any existing page. */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f5f7fa;
  color: #1d3557;
  -webkit-font-smoothing: antialiased;
}

/* ---- Shared site navigation (mirrors the rest of Last Trip London) ----
   Kept non-sticky here so it doesn't collide with the sticky search bar. */
.main-nav {
  position: static;
  background: #000000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.nav-logo {
  font-size: 1.8em;
  font-weight: 800;
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-logo:hover { transform: translateY(-3px) scale(1.02); }
.nav-logo .logo-icon { width: 32px; height: 28px; flex-shrink: 0; }
.nav-center { display: flex; align-items: center; gap: 40px; flex: 1; justify-content: center; }
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 1.05em;
  position: relative;
  padding: 10px 16px;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-links a:hover { transform: translateY(-2px); }
.nav-links a:hover::after { width: calc(100% - 32px); }

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}
.hamburger-btn:hover { background: rgba(255, 255, 255, 0.1); }
.hamburger-btn span {
  display: block;
  width: 24px;
  height: 3px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger-btn span:nth-child(1) { margin-bottom: 5px; }
.hamburger-btn span:nth-child(3) { margin-top: 5px; }
.hamburger-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

.main-nav { position: relative; }
.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #000;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  padding: 12px 0;
  z-index: 1000;
}
.mobile-nav.show { display: block; }
.mobile-nav a {
  display: block;
  padding: 14px 24px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 1.1em;
  border-left: 4px solid transparent;
}
.mobile-nav a:hover {
  background: linear-gradient(90deg, rgba(255,255,255,0.1), transparent);
  color: #fff;
  border-left-color: rgba(255,255,255,0.8);
}
@media (max-width: 768px) {
  .nav-container { padding: 12px 16px; gap: 8px; }
  .nav-logo { font-size: 1.3em; gap: 6px; }
  .nav-center { display: none; }
  .hamburger-btn { display: flex; }
}

/* ---- Call-to-action card (mirrors the scheduled pages) ---- */
.cta-card {
  margin-top: 28px;
  padding: 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1d3557 100%);
  color: #fff;
  text-align: center;
  box-shadow: 0 8px 24px rgba(29, 53, 87, 0.25);
}
.cta-card h2 { margin: 0 0 8px; font-size: 1.3em; font-weight: 800; color: #fff; }
.cta-card p { margin: 0 0 18px; font-size: 0.95em; opacity: 0.92; line-height: 1.5; }
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 6px 0;
  padding: 13px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 44px;
}
.cta-btn-alt { background: rgba(255, 255, 255, 0.14); box-shadow: none; border: 1px solid rgba(255, 255, 255, 0.35); }
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(102, 126, 234, 0.45); }

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

#line-header {
  color: #fff;
  padding: 28px 16px 24px;
  text-align: center;
  background: linear-gradient(135deg, #00AFAD 0%, #008f8d 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
#line-header .inner { max-width: 1000px; margin: 0 auto; }
#line-title { margin: 0; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; }
#line-subtitle { margin: 6px 0 0; font-size: 0.95rem; opacity: 0.92; }
.header-links { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.back-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  font-size: 0.85rem;
  opacity: 0.88;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 5px 14px;
}
.back-link:hover { opacity: 1; }

/* ---- Hub / index page (lists every line) ---- */
.page-body { padding: 24px 16px 48px; }
.container { max-width: 820px; margin: 0 auto; }
.page-title { font-size: 1.8rem; margin: 8px 0 6px; color: #1d3557; }
.page-lede { color: #52606d; margin: 0 0 22px; line-height: 1.5; }
.line-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px;
}
.line-list a {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 12px;
  text-decoration: none; color: #1d3557; font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s, border-color 0.15s;
}
.line-list a:hover { border-color: #cbd5e1; transform: translateY(-1px); }
.swatch { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }

/* Prominent, sticky search, the primary way to find your station. */
.searchbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243, 244, 246, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 16px;
}
.searchbar-inner { max-width: 1000px; margin: 0 auto; }
.search-field {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 16px;
  font-size: 1.05rem;
  opacity: 0.6;
  pointer-events: none;
}
#filter {
  width: 100%;
  padding: 15px 44px 15px 46px;
  border: 2px solid #d1d5db;
  border-radius: 14px;
  font-size: 1.08rem;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  -webkit-appearance: none;
  appearance: none;
}
#filter::-webkit-search-cancel-button { display: none; }
#filter:focus {
  outline: none;
  border-color: #00AFAD;
  box-shadow: 0 0 0 4px rgba(0, 175, 173, 0.18);
}
#filter-clear {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  background: #eef0f2;
  border-radius: 50%;
  color: #6b7280;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
#filter-clear:hover { background: #e2e5e8; }

.searchbar-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #6b7280;
}
#result-count { font-weight: 600; padding-top: 7px; }

/* Right column: Refresh button sits just above the live indicator. */
.meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
#refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
}
#refresh-btn:hover { background: #f3f4f6; }
#refresh-btn:active { transform: scale(0.97); }
.refresh-icon { font-size: 0.95rem; line-height: 1; display: inline-block; }
#refresh-btn.spinning .refresh-icon { animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}
.live-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #9ca3af;
}
.live-dot.ok { background: #16a34a; animation: pulse 2s infinite; }
.live-dot.stale { background: #f59e0b; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

#global-empty {
  display: none;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.92rem;
  margin-bottom: 16px;
}

#board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

/* Direction-of-travel heading inside a card (Northbound / Southbound / ...) */
.dir-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin: 9px 0 1px;
}
.station-card-head + .dir-label { margin-top: 2px; }

.station-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.station-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f1f3;
}
.station-card-name { font-weight: 700; font-size: 1.02rem; }

.train-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.92rem;
}
.train-row + .train-row { border-top: 1px dashed #f0f1f3; }
.train-row.none { color: #9ca3af; font-style: italic; padding: 4px 0; }
/* Let the destination wrap so longer names (e.g. Stratford International) are
   never cut off in the narrower desktop grid cards. */
.train-dest { color: #374151; flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.train-dest.arriving { color: #b45309; font-style: italic; }
.train-meta { display: inline-flex; align-items: center; gap: 8px; flex: none; padding-top: 1px; }
.train-platform {
  font-size: 0.72rem;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 5px;
  padding: 2px 6px;
}
.train-time { font-weight: 700; color: #111827; font-variant-numeric: tabular-nums; }
.train-time.due { color: #16a34a; }

.empty-note {
  grid-column: 1 / -1;
  text-align: center;
  color: #6b7280;
  padding: 28px 16px;
}

.disclaimer {
  margin-top: 24px;
  font-size: 0.78rem;
  color: #9ca3af;
  text-align: center;
  line-height: 1.5;
}

/* ---- Static page content (intro, station list, FAQ) ---- */
.page-content { max-width: 760px; margin: 30px auto 0; color: #334155; line-height: 1.65; }
.page-content > p { margin: 0 0 14px; }
.page-content h2 { font-size: 1.15rem; color: #1d3557; margin: 26px 0 10px; }
.page-content a { color: #4f46e5; }
.station-index {
  columns: 2; column-gap: 28px;
  list-style: none; padding: 0; margin: 6px 0 0;
  font-size: 0.92rem;
}
.station-index li { padding: 4px 0; break-inside: avoid; }
.faq-item { margin: 0 0 14px; }
.faq-item h3 { font-size: 1rem; color: #1d3557; margin: 0 0 4px; }
.faq-item p { margin: 0; color: #475569; }

.line-footer { max-width: 760px; margin: 26px auto 0; }
.line-footer h2 { font-size: 1rem; color: #1d3557; margin: 0 0 10px; }
.line-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.line-footer a {
  font-size: 0.85rem; color: #3730a3; text-decoration: none;
  background: #eef2ff; padding: 6px 12px; border-radius: 999px;
}
.line-footer a:hover { background: #e0e7ff; }
@media (max-width: 560px) { .station-index { columns: 1; } }

@media (max-width: 560px) {
  #line-title { font-size: 1.35rem; }
  #board { grid-template-columns: 1fr; }
  #filter { font-size: 1.05rem; padding: 14px 44px 14px 44px; }
}
