/* station-widgets.css — visual match for the homepage React widgets */

/* ── Animations (homepage defines these inline; we redeclare for station pages) */
@keyframes sw-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.85); }
}
@keyframes sw-spin {
  to { transform: rotate(360deg); }
}

/* ── Widget shell ──────────────────────────────────────────────────────────── */
.sw-widget {
  margin: 1.25rem 0 1.75rem;
}
.sw-shell {
  display: flex;
  flex-direction: column;
}
.sw-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px 10px;
  flex-wrap: wrap;
}
.sw-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #8d969e;
}
.sw-live[data-state="live"] { color: #0B6B2B; }
.sw-live-dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: #afafaf;
}
.sw-live[data-state="live"] .sw-live-dot {
  background: #0B6B2B;
  animation: sw-pulse 1.6s ease-in-out infinite;
}
.sw-refresh {
  margin-left: auto;
  padding: 6px 11px;
  border: none;
  background: #efefef;
  color: #000;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}
.sw-refresh-icon.sw-spinning {
  animation: sw-spin 0.9s linear infinite;
  transform-origin: 50% 50%;
}
.sw-foot {
  margin: 14px 0 0;
  padding: 0 4px;
  font-size: 12px;
  color: #8d969e;
  text-align: center;
  letter-spacing: 0.16px;
}

/* ── Reserve space (prevents CLS) ──────────────────────────────────────────── */
.sw-status .sw-body      { min-height: 260px; }
.sw-departures .sw-body  { min-height: 480px; }

/* ── Empty / error state ───────────────────────────────────────────────────── */
.sw-state {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  color: #8d969e;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
}
.sw-error { color: #A91212; background: #FCE4E4; box-shadow: none; }
.sw-error a { color: #A91212; font-weight: 600; }

/* ── Roundel (matches homepage LineRoundel) ────────────────────────────────── */
.sw-roundel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: -0.4px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.08);
}

/* ── Status pill (matches homepage StatusPill) ─────────────────────────────── */
.sw-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: -0.1px;
  white-space: nowrap;
}
.sw-pill-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.sw-tone-good   { background: #E6F4EA; color: #0B6B2B; }
.sw-tone-minor  { background: #FFF4D6; color: #7A4F00; }
.sw-tone-severe { background: #FCE4E4; color: #A91212; }

/* ── ETA pill (matches homepage) ───────────────────────────────────────────── */
.sw-eta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #efefef;
  color: #000;
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.sw-eta-due { background: #000; color: #fff; }

/* ── Status tiles (matches homepage .mc-status-tiles, including the
      ≥1024px 2-column grid of separate cards) ───────────────────────────────── */
.sw-tiles {
  display: block;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
}
.sw-status-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}
.sw-status-row:first-child { border-top: none; }
.sw-status-row:hover { background: rgba(0,0,0,0.02); }
.sw-status-row .sw-roundel-slot { padding-top: 2px; }
.sw-status-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.2px;
  color: #1f1f1f;
}
.sw-status-reason {
  font-size: 12px;
  color: #4b4b4b;
  margin-top: 3px;
  line-height: 1.55;
}
.sw-status-pill-slot { padding-top: 1px; }

@media (min-width: 1024px) {
  .sw-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
  }
  .sw-tiles > .sw-status-row {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
    border-top: none !important;
  }
}

/* ── Departures (matches homepage StationDetail — hero card + follow-ups) ──── */
.sw-dep-section { margin-bottom: 24px; }
.sw-dep-section:last-child { margin-bottom: 0; }
.sw-dep-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #8d969e;
  padding: 0 4px 8px;
}

/* Hero card — line-coloured background, big destination + huge ETA countdown */
.sw-hero {
  border-radius: 20px;
  padding: clamp(16px, 3vw, 24px);
  margin-bottom: 10px;
}
.sw-hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.85;
}
.sw-hero-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.sw-hero-info { flex: 1; min-width: 0; }
.sw-hero-dest {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.1;
}
.sw-hero-platform { font-size: 13px; opacity: 0.85; margin-top: 4px; }
.sw-hero-loc      { font-size: 12px; opacity: 0.75; margin-top: 4px; font-style: italic; }
.sw-hero-eta {
  font-size: clamp(40px, 9vw, 64px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Follow-up card — white rows for subsequent trains in the same direction */
.sw-dep-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
}
.sw-dep-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.sw-dep-row:first-child { border-top: none; }
.sw-dep-info { flex: 1; min-width: 0; }
.sw-dep-dest {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.1px;
  color: #1f1f1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-dep-platform { font-size: 12px; color: #4b4b4b; margin-top: 2px; }
.sw-dep-loc      { font-size: 12px; color: #8d969e; margin-top: 2px; font-style: italic; }
