/* =====================================================
   TRAIN DISPLAY DEMO — Display Styles
   3840 × 1080px dual-screen layout
   Font: Roboto | Brand: #0075BF
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

/* ─── Reset & Root ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --zou-blue: #0075BF;
  --zou-blue-dark: #005A94;
  --zou-blue-light: #E8F4FC;
  --white: #FFFFFF;
  --gray-light: #F2F6FA;
  --gray-mid: #9EB3C2;
  --gray-dark: #2C3E50;
  --delay-orange: #E67E22;
  --delay-red: #E74C3C;
  --text-primary: #1A2940;
  --text-secondary: #5A7A96;

  --font: 'Roboto', sans-serif;
}

html,
body {
  width: 3840px;
  height: 1080px;
  overflow: hidden;
  font-family: var(--font);
  background: var(--gray-light);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  transform-origin: 0 0;
}

/* ─── Dual Screen Container ─── */
#display-container {
  display: flex;
  width: 3840px;
  height: 1080px;
}

/* ─── LEFT SCREEN ─── */
#left-screen {
  width: 1920px;
  height: 1080px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  /* Use box-shadow instead of border to avoid sub-pixel gaps at fractional scales */
  box-shadow: 2px 0 0 0 var(--zou-blue);
  overflow: hidden;
}

/* Header bar */
#route-header {
  background: var(--zou-blue);
  color: var(--white);
  height: 170px;
  display: flex;
  align-items: stretch;
  padding: 0;
  gap: 0;
  flex-shrink: 0;
}

/* Logo lives in its own white box, same height as header */
#zou-logo-wrapper {
  width: 320px;
  flex-shrink: 0;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 28px;
  overflow: hidden;
  /* Prevent sub-pixel rendering gaps at fractional scale factors */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

#zou-logo-wrapper img {
  max-width: 100%;
  max-height: 110px;
  width: auto;
  height: auto;
}

/* No divider — removed */
.header-divider {
  display: none;
}

#header-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 0 40px;
}

#terminus-name {
  font-size: 88px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#ter-number {
  font-size: 36px;
  font-weight: 400;
  opacity: 0.88;
  letter-spacing: 0.04em;
}

#header-clock {
  font-size: 80px;
  font-weight: 300;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  padding-right: 48px;
  display: flex;
  align-items: center;
}

/* ─── Journey Panel ─── */
#journey-panel {
  flex: 1;
  display: flex;
  overflow: hidden;
  transition: opacity 0.6s ease;
}

#journey-panel.hidden-fade {
  display: none;
}

/* ─── Station View Overlay ─── */
.station-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  background: var(--white);
  transition: opacity 0.6s ease;
  overflow: visible;
}

.station-view.hidden {
  display: none;
  opacity: 0;
}

.station-view.fade-in {
  opacity: 1;
}

.station-view.fade-out {
  opacity: 0;
}

.station-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  flex: 1;
  min-height: 0;
}

/* Station stop name */
.station-stop-name {
  font-size: 228px;
  font-weight: 700;
  color: var(--zou-blue);
  text-align: center;
  line-height: 1.1;
}

/* Station arrival time row */
.station-time-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.station-time {
  font-size: 80px;
  font-weight: 300;
  color: var(--zou-blue);
  font-variant-numeric: tabular-nums;
}

.station-time.delayed {
  color: var(--delay-orange);
  font-weight: 500;
}

.station-delay-suffix {
  font-size: 44px;
  color: var(--delay-orange);
  font-weight: 500;
}

/* Dwell time */
.station-dwell {
  font-size: 114px;
  font-weight: 400;
  color: var(--text-secondary);
}

/* Station weather bar */
.station-weather-bar {
  display: flex;
  gap: 40px;
  align-items: center;
  justify-content: center;
}

/* Station connections bar */
.station-connections-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

/* Station messages */
.station-message {
  font-size: 64px;
  font-weight: 400;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}

/* At-origin view */
.origin-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  align-items: stretch;
}

.origin-countdown {
  font-size: 70px;
  font-weight: 500;
  color: var(--zou-blue);
  text-align: center;
  line-height: 1.3;
  padding: 30px 0 20px;
  flex-shrink: 0;
}

.origin-countdown strong {
  font-size: 88px;
  font-weight: 800;
}

.origin-imminent {
  font-size: 88px;
  font-weight: 800;
  animation: imminent-blink 1s ease-in-out infinite;
}

@keyframes imminent-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.2;
  }
}

.origin-stops-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-height: 0;
}


.origin-stop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px 16px 0;
  flex-shrink: 0;
  position: relative;
}

.origin-stop-row.terminus {
  font-weight: 700;
}

/* Pearl line cell */
.origin-pearl-cell {
  width: 80px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  align-self: stretch;
}

.origin-pearl-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--white);
  border: 6px solid var(--zou-blue);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.origin-stop-row.origin .origin-pearl-dot {
  width: 56px;
  height: 56px;
  background: var(--zou-blue);
  border: 6px solid var(--white);
  box-shadow: 0 0 0 4px var(--zou-blue);
}

.origin-stop-row.terminus .origin-pearl-dot {
  width: 56px;
  height: 56px;
  background: var(--zou-blue);
  border: 6px solid var(--white);
  box-shadow: 0 0 0 4px var(--zou-blue);
}

/* Single continuous vertical line per stop group */
.origin-stops-track {
  will-change: transform;
  position: relative;
}

.origin-stop-group {
  position: relative;
}

.origin-stop-group::before {
  content: '';
  position: absolute;
  left: 40px;
  /* center of 80px pearl cell */
  top: var(--pearl-top, 52px);
  bottom: var(--pearl-bottom, 52px);
  width: 12px;
  background: var(--zou-blue);
  transform: translateX(-50%);
  z-index: 1;
}

.origin-stop-name {
  font-size: 60px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 32px;
}

.origin-stop-row.origin .origin-stop-name {
  color: var(--text-primary);
  font-weight: 700;
}

.origin-stop-row.terminus .origin-stop-name {
  color: var(--zou-blue);
  font-weight: 700;
}

.origin-stop-time {
  font-size: 60px;
  font-weight: 400;
  color: var(--zou-blue);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.origin-stop-time.delayed {
  color: var(--delay-orange);
  font-weight: 500;
}

.origin-delay-suffix {
  font-size: 36px;
  color: var(--delay-orange);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: 12px;
  flex-shrink: 0;
}

.origin-scroll-gap {
  height: 60px;
}

/* At-destination TERMINUS */
.station-terminus-label {
  font-size: 280px;
  font-weight: 900;
  color: var(--zou-blue);
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.station-terminus-message {
  font-size: 72px;
  font-weight: 700;
  color: #000;
  text-align: center;
  line-height: 1.4;
}

/* Left label column */
#journey-label-col {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 36px 0 40px 48px;
}

#prochain-arret-label {
  font-size: 52px;
  font-weight: 500;
  color: var(--zou-blue);
  line-height: 1.2;
}

/* Pearl line column — wider to fit bigger dots */
#pearl-col {
  width: 100px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 0 0;
  position: relative;
}

/* Journey content column */
#journey-content-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 56px 0 24px;
  min-width: 0;
}

/* ─── Stop Rows ─── */
.stop-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: opacity 0.4s ease;
}

.stop-row.next-stop {
  flex-direction: column;
  padding-bottom: 12px;
  /* No separator */
  margin-bottom: 8px;
}

.stop-name {
  font-size: 144px;
  font-weight: 700;
  color: var(--zou-blue);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stop-name.secondary {
  font-size: 76px;
  font-weight: 500;
  color: var(--text-primary);
}

.stop-name.terminus-label {
  font-size: 76px;
  font-weight: 500;
  color: var(--text-secondary);
}

.stop-time {
  font-size: 144px;
  font-weight: 300;
  color: var(--zou-blue);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stop-time.secondary {
  font-size: 76px;
  font-weight: 400;
  color: var(--text-primary);
}

.stop-time.delayed {
  color: var(--delay-orange);
  font-weight: 500;
}

.stop-time.terminus-time {
  font-size: 76px;
  color: var(--text-secondary);
}

/* Delay suffix: "+Xmn" shown after real arrival time */
.delay-suffix {
  color: var(--delay-orange);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: 16px;
}

/* Next stop hero: 40% of 144px = 58px */
.delay-suffix.hero {
  font-size: 58px;
}

/* Upcoming stops: 40% of 76px ≈ 30px */
.delay-suffix.secondary {
  font-size: 30px;
}

.stop-time-row {
  display: flex;
  align-items: baseline;
  gap: 0;
}

/* Next stop header row */
.next-stop-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* ─── Info Alternator (Connections ↔ Weather) ─── */
#info-alternator {
  position: relative;
  width: 100%;
  height: 100px;
  margin-top: 20px;
  overflow: visible;
}

.info-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  overflow: visible;
}

.info-panel.active {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Connection Badges ─── */
#connections-bar {
  gap: 16px;
  padding-left: 16px;
  z-index: 3;
}

.conn-type-label {
  font-size: 36px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 10px 18px;
  background: var(--gray-light);
  border-radius: 8px;
  letter-spacing: 0.03em;
}

.conn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 72px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

/* ─── Weather Cards ─── */
#weather-bar {
  gap: 40px;
}

.weather-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
}

.weather-top {
  display: flex;
  align-items: center;
  gap: 0;
}

.weather-icon {
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  margin: -30px -20px -30px -30px;
}

.weather-temp {
  font-size: 48px;
  font-weight: 700;
  color: var(--zou-blue);
  line-height: 1;
}

.weather-time {
  font-size: 28px;
  font-weight: 600;
  color: var(--zou-blue);
  line-height: 1;
  margin-top: -20px;
}

/* ─── Upcoming Stops (scrolling list) ─── */
.upcoming-stops-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.upcoming-viewport {
  position: relative;
  width: 100%;
  flex: 1;
  overflow: hidden;
  transition: opacity 600ms ease;
}

.upcoming-track {
  display: flex;
  flex-direction: column;
  gap: 0;
  will-change: transform;
}

.upcoming-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  flex-shrink: 0;
}

.upcoming-row:last-child {
  border-bottom: none;
}

/* ─── Dotted section spacer (kept for reference, hidden by default) ─── */
.dotted-spacer {
  display: none;
}

/* ─── Arrival Footer — fixed bottom bar ─── */
#arrival-footer {
  flex-shrink: 0;
  background: var(--zou-blue);
  color: var(--white);
  height: 130px;
  display: flex;
  align-items: center;
  padding: 0;
  overflow: hidden;
  width: 100%;
}

#arrival-text {
  font-size: 68px;
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1.2;
  display: inline-block;
  animation: marquee-scroll 18s linear infinite;
  padding-left: 100%;
}

@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Static footer mode (fade stops enabled) — no marquee, centered, 30% larger */
#arrival-footer.static-footer {
  justify-content: center;
  text-align: center;
}

#arrival-footer.static-footer #arrival-text {
  animation: none !important;
  transform: none !important;
  padding-left: 0;
  white-space: normal;
  display: block;
  width: 100%;
  text-align: center;
  font-size: 88px;
}

/* ─── Pearl Line ─── */
#pearl-col {
  position: relative;
  /* required for absolute dot/line children */
}

.pearl-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 6px solid var(--zou-blue);
  background: var(--white);
  flex-shrink: 0;
}

.pearl-dot.large {
  width: 72px;
  height: 72px;
  background: var(--zou-blue);
  border: 6px solid var(--white);
  box-shadow: 0 0 0 4px var(--zou-blue);
}

/* (terminus dot removed — terminus now shown in arrival-footer) */

.pearl-line-segment {
  width: 12px;
  background: var(--zou-blue);
  flex: 1;
}

/* ─── RIGHT SCREEN ─── */
#right-screen {
  width: 1920px;
  height: 1080px;
  background: #000;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* ─── TV Test Pattern ─── */
#test-pattern-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #131313;
}

/* Main color bars — top 67% */
#smpte-main-bars {
  flex: 67;
  display: flex;
}

#smpte-main-bars .bar {
  flex: 1;
}

/* Mid reverse bars — 12% */
#smpte-mid-bars {
  flex: 12;
  display: flex;
}

#smpte-mid-bars .bar {
  flex: 1;
}

/* Bottom PLUGE strip — 21% */
#smpte-bottom-bars {
  flex: 21;
  display: flex;
}

.pluge-section {
  display: flex;
}

#test-pattern-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border-radius: 28px;
  padding: 48px 72px;
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.15);
}

#test-pattern-logo img {
  height: 160px;
  width: auto;
}

/* ─── No trip state ─── */
#no-trip-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: 100;
}

#no-trip-overlay.hidden {
  display: none;
}

#no-trip-overlay .no-trip-icon {
  font-size: 80px;
  opacity: 0.3;
}

#no-trip-overlay .no-trip-text {
  font-size: 32px;
  font-weight: 400;
  color: var(--text-secondary);
}

/* ─── Animations ─── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes pulseBlue {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 117, 191, 0.6);
  }

  50% {
    box-shadow: 0 0 12px 20px rgba(0, 117, 191, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 117, 191, 0.6);
  }
}

.pearl-dot.large {
  animation: pulseBlue 1.8s ease-in-out infinite;
}