/* trains.css — CAMS rail-board styling
   =========================================================================
   Drop alongside css/style.css. Include after style.css so it can use the
   same CSS variables (--bg, --text-dim, --accent, etc).

   Aesthetic: dot-matrix departure board feel, matching CAMS's dark UI.
   ========================================================================= */

.rail-board {
  font-family: 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  padding: 12px 14px;
  background: var(--bg, #0a0e14);
  color: var(--text, #d8e4f0);
  font-size: 12px;
  line-height: 1.4;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.rb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.rb-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text, #d8e4f0);
}

.rb-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #51d88a;
}

.rb-dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: #51d88a;
  border-radius: 50%;
  box-shadow: 0 0 6px #51d88a;
  animation: rb-pulse 1.6s ease-in-out infinite;
}

@keyframes rb-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.85); }
}

/* ── NRCC disruption messages ───────────────────────────────────────────── */
.rb-messages {
  margin-bottom: 10px;
  padding: 6px 8px;
  background: rgba(255, 168, 38, 0.08);
  border-left: 2px solid #ffa826;
  border-radius: 2px;
}

.rb-msg {
  font-size: 11px;
  color: #ffd089;
  padding: 2px 0;
  line-height: 1.45;
}

/* ── The board table ────────────────────────────────────────────────────── */
.rb-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.rb-table thead th {
  text-align: left;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim, #6b7d92);
  text-transform: uppercase;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.rb-table tbody td {
  padding: 7px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
}

.rb-table tbody tr:last-child td {
  border-bottom: none;
}

.rb-table tbody tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* Column-specific styling */
.rb-time {
  width: 50px;
  font-weight: 600;
  color: var(--accent, #ffa826);
  font-variant-numeric: tabular-nums;
}

.rb-dest {
  font-weight: 500;
  color: var(--text, #d8e4f0);
}

.rb-op {
  display: block;
  font-size: 9px;
  color: var(--text-dim, #6b7d92);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.rb-plat {
  width: 38px;
  text-align: center;
  font-weight: 600;
  color: var(--text-dim, #6b7d92);
}

.rb-status {
  width: 90px;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.rb-status.on-time   { color: #51d88a; }
.rb-status.delayed   { color: #ffa826; }
.rb-status.cancelled { color: #ff6b6b; text-decoration: line-through; opacity: 0.8; }

/* ── Empty / loading / error states ─────────────────────────────────────── */
.rb-empty {
  text-align: center;
  padding: 18px 6px;
  color: var(--text-dim, #6b7d92);
  font-style: italic;
}

.rb-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  gap: 12px;
  color: var(--text-dim, #6b7d92);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.rb-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255,255,255,0.08);
  border-top-color: var(--accent, #ffa826);
  border-radius: 50%;
  animation: rb-spin 0.8s linear infinite;
}

@keyframes rb-spin {
  to { transform: rotate(360deg); }
}

.rb-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 107, 107, 0.06);
  border-left: 2px solid #ff6b6b;
  border-radius: 2px;
  color: #ffb3b3;
  font-size: 11px;
  line-height: 1.5;
}

.rb-error-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.rb-foot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-dim, #6b7d92);
  text-transform: uppercase;
}

/* ── Mobile / narrow viewer ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .rail-board { padding: 10px 8px; font-size: 11px; }
  .rb-table thead th { padding: 3px 4px; font-size: 8px; }
  .rb-table tbody td { padding: 6px 4px; }
  .rb-time { width: 44px; }
  .rb-plat { width: 30px; }
  .rb-status { width: 72px; font-size: 10px; }
  .rb-op { font-size: 8px; }
}
