/* ==========================================================================
   1980s Mechanical Split-Flap Flight Information Display System (FIDS)
   Inspired by classic Solari di Udine mechanical airport flap boards
   ========================================================================== */

/* Outer Chassis / Frame */
.retro-board-container {
  background: #111317;
  border: 3px solid #232731;
  border-radius: 12px;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 30px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  margin-bottom: var(--spacing-xl);
  font-family: 'Share Tech Mono', 'Space Mono', monospace;
}

/* Mechanical Corner Screws */
.retro-screw {
  position: absolute;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 35% 35%, #4a5060 0%, #20242c 70%, #14171c 100%);
  border: 1px solid #101216;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  z-index: 10;
}
.retro-screw::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 3px;
  width: 8px;
  height: 2px;
  background: #0f1115;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: rotate(35deg);
}
.retro-screw.screw-tl { top: 10px; left: 10px; }
.retro-screw.screw-tr { top: 10px; right: 10px; }
.retro-screw.screw-bl { bottom: 10px; left: 10px; }
.retro-screw.screw-br { bottom: 10px; right: 10px; }

/* Top Chassis Bar / Airport Nameplate */
.retro-board-topbar {
  background: linear-gradient(180deg, #1d2027 0%, #16181e 60%, #121419 100%);
  border-bottom: 2px solid #0a0b0d;
  padding: 1.25rem 2rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.retro-station-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.retro-indicator-cluster {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #090a0d;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #1f232c;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9);
}

.retro-lamp {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #000;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.retro-lamp-active {
  background: #10b981;
  box-shadow: 0 0 8px #10b981, inset 0 1px 1px #a7f3d0;
  animation: retroGlowPulse 2.5s infinite;
}

.retro-lamp-amber {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b, inset 0 1px 1px #fde68a;
  animation: retroGlowPulse 3s infinite 0.5s;
}

@keyframes retroGlowPulse {
  0%, 100% { opacity: 0.9; filter: brightness(1); }
  50% { opacity: 0.5; filter: brightness(0.7); }
}

.retro-brand-titles {
  display: flex;
  flex-direction: column;
}

.retro-subhead {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: #fbbf24;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.4);
}

.retro-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: #f1f3f7;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Controls Cluster: Clock, Audio Toggle, Full Board */
.retro-controls-cluster {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* 80s VFD / LED Digital Clock */
.retro-clock-box {
  background: #090a0d;
  border: 2px solid #1a1d24;
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.95), 0 1px 0 rgba(255, 255, 255, 0.05);
}

.retro-clock-label {
  font-size: 0.62rem;
  color: #94a3b8;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.retro-clock-digits {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffb700;
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px rgba(255, 183, 0, 0.65), 0 0 2px #fff;
}

/* Mechanical Audio Clatter Button */
.retro-audio-toggle {
  background: linear-gradient(180deg, #2a2f3b 0%, #1e222b 100%);
  border: 1px solid #3d4454;
  border-radius: 6px;
  color: #cbd5e1;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: all 0.15s ease;
}

.retro-audio-toggle:hover {
  background: linear-gradient(180deg, #353b49 0%, #242934 100%);
  border-color: #64748b;
  color: #fff;
}

.retro-audio-toggle.audio-enabled {
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 10px rgba(245, 158, 11, 0.35);
}

.retro-audio-toggle:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Full Radar external link button */
.retro-ext-btn {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f1f5f9;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.retro-ext-btn:hover {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border-color: #f59e0b;
  color: #fbbf24;
}

/* Switch Bar / Industrial Rocker Tabs */
.retro-switch-bar {
  background: #15181e;
  border-bottom: 2px solid #090a0d;
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.retro-mode-switches {
  display: flex;
  gap: 0.75rem;
  background: #090a0d;
  padding: 5px;
  border-radius: 8px;
  border: 1px solid #232732;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9);
}

.retro-switch-btn {
  background: #14171d;
  border: 1px solid #252a36;
  border-radius: 6px;
  color: #94a3b8;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  transition: all 0.15s ease;
  position: relative;
}

.retro-switch-btn .switch-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #334155;
  border: 1px solid #0f172a;
  transition: all 0.2s ease;
}

.retro-switch-btn:hover {
  color: #f1f5f9;
  background: #1a1e27;
}

.retro-switch-btn.active {
  background: linear-gradient(180deg, #252a35 0%, #181c24 100%);
  color: #ffcc00;
  border-color: #f59e0b;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 15px rgba(245, 158, 11, 0.2);
}

.retro-switch-btn.active .switch-light {
  background: #ffcc00;
  box-shadow: 0 0 8px #ffcc00, 0 0 2px #fff;
}

.retro-count-chip {
  background: #0a0b0e;
  color: #ffd000;
  border: 1px solid rgba(255, 208, 0, 0.3);
  border-radius: 4px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  padding: 1px 6px;
  margin-left: 2px;
}

.retro-status-ticker {
  font-size: 0.75rem;
  color: #64748b;
  letter-spacing: 0.1em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.ticker-pulse {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
  animation: retroGlowPulse 1.5s infinite;
}

/* Mobile Scroll Hint Banner */
.retro-mobile-scroll-hint {
  display: none;
  background: #090a0d;
  color: #f59e0b;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 0.35rem 1rem;
  border-bottom: 1px dashed #2d3340;
}

/* Scroll Area for Mechanical Board */
.retro-board-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 #0a0c10;
  background: #0c0d10;
  padding: 1.25rem 1.5rem;
}

.retro-board-scroll::-webkit-scrollbar {
  height: 8px;
}
.retro-board-scroll::-webkit-scrollbar-track {
  background: #0a0c10;
}
.retro-board-scroll::-webkit-scrollbar-thumb {
  background: #28303f;
  border-radius: 4px;
}

/* Board Panels */
.retro-board-panel {
  min-width: 900px;
}

/* Split-Flap Table Header */
.retro-table-header {
  display: grid;
  grid-template-columns: 80px 105px 180px 1fr 65px 75px 145px;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.retro-col-head {
  background: #181b22;
  border: 1px solid #282e3c;
  border-radius: 3px;
  color: #ffcc00;
  font-family: 'Oswald', 'Share Tech Mono', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 3px rgba(0, 0, 0, 0.6);
}

.retro-col-head.text-center {
  justify-content: center;
}

/* Rows List */
.retro-rows-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Individual Flap Row */
.retro-flap-row {
  display: grid;
  grid-template-columns: 80px 105px 180px 1fr 65px 75px 145px;
  gap: 8px;
  background: #111317;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid #1c2028;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  perspective: 600px;
}

.retro-flap-row:hover {
  border-color: rgba(251, 191, 36, 0.4);
  background: #161920;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7), 0 0 10px rgba(251, 191, 36, 0.1);
}

/* Staggered 3D Flip Animation */
.retro-flap-row.flap-flip {
  animation: mechanicalFlip 0.5s ease-out forwards;
}

@keyframes mechanicalFlip {
  0% {
    transform: rotateX(0deg);
  }
  30% {
    transform: rotateX(-45deg);
    opacity: 0.6;
    filter: brightness(0.7);
  }
  60% {
    transform: rotateX(25deg);
    opacity: 0.9;
    filter: brightness(1.2);
  }
  100% {
    transform: rotateX(0deg);
    opacity: 1;
    filter: brightness(1);
  }
}

/* Split-Flap Character Unit / Cell */
.flap-unit {
  position: relative;
  background: linear-gradient(180deg, #1e2025 0%, #16181c 48%, #0d0e11 50%, #131418 52%, #191a1e 100%);
  border: 1px solid #08090b;
  border-radius: 4px;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.9),
    0 2px 4px rgba(0, 0, 0, 0.6);
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.96rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow: hidden;
  user-select: none;
}

/* Center Horizontal Split Seam (The physical gap between top/bottom flap) */
.flap-unit::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #000;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.09);
  pointer-events: none;
  z-index: 5;
}

/* Left & Right Mechanical Flap Hinge Clips */
.flap-unit::before {
  content: '';
  position: absolute;
  top: calc(50% - 3px);
  left: 0;
  width: 3px;
  height: 6px;
  background: #060708;
  border-radius: 0 2px 2px 0;
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.08);
  z-index: 6;
}

/* Cell Variations & Content */
.flap-time {
  color: #ffd000;
  font-weight: 700;
  justify-content: center;
  font-size: 1.05rem;
  text-shadow: 0 0 6px rgba(255, 208, 0, 0.4);
}

.flap-flight {
  color: #ffcc00;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.1em;
  justify-content: center;
  text-shadow: 0 0 4px rgba(255, 204, 0, 0.3);
}

.flap-airline {
  color: #f1f5f9;
  gap: 0.6rem;
}

.flap-airline-badge {
  background: #0a0b0d;
  color: #fbbf24;
  border: 1px solid #2a313e;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.72rem;
  font-weight: 700;
}

.flap-airline-text {
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e2e8f0;
}

.flap-dest {
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.flap-dest-city {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flap-dest-iata {
  background: #0c0e12;
  color: #ffcc00;
  border: 1px solid rgba(255, 204, 0, 0.35);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.flap-term, .flap-gate {
  justify-content: center;
  color: #cbd5e1;
  font-size: 0.95rem;
  font-weight: 700;
}

.flap-term {
  color: #94a3b8;
}

.flap-gate {
  color: #ffcc00;
}

/* Mechanical Status Badges on Flaps */
.flap-status {
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

/* Status Colors in 80s mechanical look */
.flap-status-ontime {
  background: linear-gradient(180deg, #064e3b 0%, #04382a 48%, #02241b 50%, #032b20 52%, #064e3b 100%) !important;
  border-color: #047857 !important;
  color: #34d399 !important;
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
}

.flap-status-scheduled {
  background: linear-gradient(180deg, #1e293b 0%, #151c28 48%, #0f141d 50%, #131a25 52%, #1e293b 100%) !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

.flap-status-boarding {
  background: linear-gradient(180deg, #78350f 0%, #58260b 48%, #3d1a07 50%, #4f2109 52%, #78350f 100%) !important;
  border-color: #b45309 !important;
  color: #fef08a !important;
  animation: retroBoardingBlink 1.4s infinite;
  text-shadow: 0 0 10px rgba(254, 240, 138, 0.8);
}

@keyframes retroBoardingBlink {
  0%, 100% { filter: brightness(1.2); box-shadow: 0 0 12px rgba(245, 158, 11, 0.4); }
  50% { filter: brightness(0.7); box-shadow: none; }
}

.flap-status-delayed {
  background: linear-gradient(180deg, #713f12 0%, #532e0d 48%, #3b2009 50%, #4a290c 52%, #713f12 100%) !important;
  border-color: #a16207 !important;
  color: #fcd34d !important;
  text-shadow: 0 0 8px rgba(252, 211, 77, 0.5);
}

.flap-status-cancelled {
  background: linear-gradient(180deg, #7f1d1d 0%, #5d1515 48%, #410e0e 50%, #521212 52%, #7f1d1d 100%) !important;
  border-color: #991b1b !important;
  color: #fca5a5 !important;
  text-shadow: 0 0 8px rgba(252, 165, 165, 0.6);
}

.flap-status-departed, .flap-status-arrived {
  background: linear-gradient(180deg, #181a20 0%, #121318 48%, #0a0b0e 50%, #0f1014 52%, #181a20 100%) !important;
  border-color: #272a33 !important;
  color: #94a3b8 !important;
}

/* Empty State Flap Row */
.retro-empty-row {
  background: #111317;
  border: 1px dashed #262c38;
  border-radius: 6px;
  padding: 2.5rem 1rem;
  text-align: center;
  color: #94a3b8;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.1em;
}

/* Bottom Chassis Trim */
.retro-board-footer {
  background: linear-gradient(180deg, #121418 0%, #0d0e11 100%);
  border-top: 2px solid #08090b;
  padding: 0.9rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.74rem;
  color: #64748b;
  letter-spacing: 0.1em;
}

.retro-footer-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.chassis-dot {
  color: #334155;
}

.chassis-model {
  color: #fbbf24;
  font-weight: 700;
}

.retro-footer-link {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.retro-footer-link:hover {
  color: #ffcc00;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .retro-board-topbar {
    padding: 1rem 1.25rem;
  }
  .retro-switch-bar {
    padding: 0.75rem 1.25rem;
  }
  .retro-controls-bar {
    padding: 0.75rem 1.25rem;
  }
  .retro-mobile-scroll-hint {
    display: block;
  }
}

@media (max-width: 640px) {
  .retro-title {
    font-size: 1.2rem;
  }
  .retro-switch-btn {
    font-size: 0.88rem;
    padding: 0.45rem 0.85rem;
  }
  .retro-controls-cluster {
    width: 100%;
    justify-content: space-between;
  }
  .retro-select {
    min-width: 100%;
  }
  .retro-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==========================================================================
   Retro Controls Strip (Airport Selector & Date Filters for flights.php)
   ========================================================================== */
.retro-controls-bar {
  background: #14171d;
  border-bottom: 2px solid #090a0d;
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.retro-selector-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.retro-control-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  color: #fbbf24;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.retro-select {
  background: #090a0d;
  color: #ffcc00;
  border: 1px solid #2e3544;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.05);
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 260px;
}

.retro-select:focus, .retro-select:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25), inset 0 2px 5px rgba(0, 0, 0, 0.9);
}

.retro-date-cluster {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #090a0d;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid #1f242e;
}

.retro-date-btn {
  background: #14171d;
  border: 1px solid #252a36;
  border-radius: 4px;
  color: #94a3b8;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.38rem 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
}

.retro-date-btn:hover {
  color: #fff;
  background: #1d212b;
}

.retro-date-btn.active {
  background: linear-gradient(180deg, #2b313e 0%, #1c2029 100%);
  color: #ffcc00;
  border-color: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

