/* General Reset and Body */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #000000; /* Clean black background */
  color: #ffffff;
  font-family: 'VT323', monospace;
  font-size: 20px;
  line-height: 1.2;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 10px 30px;
  overflow-x: hidden;
}

/* CRT Screen Frame & Bezel Simulation - Borderless & Expanded */
.crt-frame {
  position: relative;
  width: 100%;
  max-width: 1600px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.crt-bezel {
  display: none;
}

.crt-glare {
  display: none;
}

.crt-screen {
  position: relative;
  background-color: #000000; /* Clean black background */
  border: none;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  box-shadow: none;
  animation: crt-flicker 0.15s infinite;
}

/* Scanline Effect Overlay */
.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.28) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 5;
}

/* CRT Vignette Curve Effect - Removed */
.crt-screen::after {
  display: none;
}

/* Flicker Animation */
@keyframes crt-flicker {
  0% { opacity: 0.985; }
  50% { opacity: 1; }
  100% { opacity: 0.99; }
}

/* Teletext Core Container */
.teletext-container {
  display: flex;
  flex-direction: column;
  background-color: #000000;
  border: none;
  padding: 10px 0px;
  z-index: 2;
}

/* Teletext Header Row */
.teletext-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #00ff00;
  padding-bottom: 5px;
  margin-bottom: 15px;
  font-size: 24px;
  letter-spacing: 2px;
}

.page-num { color: #ffff00; text-shadow: 0 0 3px #ffff00; }
.sys-name { color: #00ff00; text-shadow: 0 0 3px #00ff00; }
.current-date { color: #00ffff; text-shadow: 0 0 3px #00ffff; }
.live-clock { color: #ffffff; text-shadow: 0 0 3px #ffffff; }
.status-indicator { color: #ff00ff; text-shadow: 0 0 3px #ff00ff; font-weight: bold; }

.blink {
  animation: teletext-blink 1s steps(2, start) infinite;
}

@keyframes teletext-blink {
  to { visibility: hidden; }
}

/* Main Banner */
.teletext-banner {
  background-color: #00ff00;
  color: #000000;
  text-align: center;
  padding: 8px 10px;
  margin-bottom: 20px;
  font-weight: bold;
  letter-spacing: 4px;
}

.banner-text {
  font-size: 36px;
  line-height: 1.1;
}

.banner-sub {
  font-size: 20px;
  color: #000000;
  background-color: #00ffff;
  margin-top: 5px;
  padding: 2px;
  letter-spacing: 1px;
}

/* Workspace Layout */
.terminal-workspace {
  display: flex;
  gap: 20px;
  min-height: 620px;
  margin-bottom: 15px;
}

.terminal-panel {
  flex: 1;
  border: 2px solid #00ffff;
  background-color: #000000;
  padding: 15px;
  display: flex;
  flex-direction: column;
}

.form-panel {
  border-color: #ffff00;
  max-width: 50%;
}

.output-panel {
  border-color: #00ff00;
}

.panel-header {
  text-align: center;
  font-size: 22px;
  margin-bottom: 15px;
  padding-bottom: 5px;
  border-bottom: 1px dashed;
}

.form-panel .panel-header {
  color: #ffff00;
  border-color: #ffff00;
}

.output-panel .panel-header {
  color: #00ff00;
  border-color: #00ff00;
}

/* Form Styles */
.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 12px;
}

.input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.double-width {
  flex: 2;
}

.input-group label {
  color: #00ffff;
  font-size: 18px;
  margin-bottom: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.input-wrap {
  display: inline-flex;
  align-items: center;
  background-color: #050505;
  font-size: 24px;
}

.bracket {
  color: #ff00ff;
  font-weight: bold;
}

.input-wrap input, .input-wrap select {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: 'VT323', monospace;
  font-size: 24px;
  padding: 2px 8px;
  width: 100%;
  text-align: center;
}

/* Inputs specialized size styling */
#origin, #destination {
  text-transform: uppercase;
  letter-spacing: 2px;
}

#depart-range, #return-range, #adults, #children {
  width: 50px;
}

.date-flex {
  display: flex;
  align-items: center;
  gap: 10px;
}

.label-inline {
  color: #ff00ff;
  font-size: 18px;
  white-space: nowrap;
}

.api-readout {
  color: #ffff00;
  background-color: #050505;
  border: 1px solid #333;
  font-family: 'Share Tech Mono', monospace;
  font-size: 15px;
  min-height: 34px;
  padding: 8px 10px;
  text-transform: uppercase;
}

.confirm-live {
  align-items: center;
  border: 1px solid #ff0000;
  color: #ff0000;
  cursor: pointer;
  display: flex;
  font-size: 20px;
  gap: 10px;
  letter-spacing: 1px;
  padding: 8px 10px;
  text-transform: uppercase;
  width: 100%;
}

.confirm-live input {
  accent-color: #ff0000;
  height: 18px;
  width: 18px;
}

input:disabled {
  color: #777777;
  cursor: not-allowed;
}

/* Remove arrow counters on numeric inputs */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

/* Select input retro overlay */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
}

select option {
  background-color: #050505;
  color: #ffffff;
}

/* Form Action Buttons */
.button-row {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 15px;
}

.btn {
  flex: 1;
  font-family: 'VT323', monospace;
  font-size: 20px;
  padding: 8px 5px;
  background-color: transparent;
  border: 2px solid;
  cursor: pointer;
  text-transform: uppercase;
  text-align: center;
  transition: all 0.1s ease;
}

.btn-yellow { color: #ffff00; border-color: #ffff00; }
.btn-yellow:hover { background-color: #ffff00; color: #000; }
.btn-green { color: #00ff00; border-color: #00ff00; }
.btn-green:hover { background-color: #00ff00; color: #000; }
.btn-red { color: #ff0000; border-color: #ff0000; }
.btn-red:hover { background-color: #ff0000; color: #fff; }
.btn-cyan { color: #00ffff; border-color: #00ffff; }
.btn-cyan:hover { background-color: #00ffff; color: #000; }

/* Result Output Box */
.results-container {
  flex: 1;
  background-color: #050508;
  border: 1px solid #222;
  border-radius: 4px;
  padding: 10px;
  overflow: auto;
  max-height: 460px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  color: #d8ffd8;
  margin-bottom: 15px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
  white-space: pre;
}

.results-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.results-container::-webkit-scrollbar-track {
  background: #000;
}
.results-container::-webkit-scrollbar-thumb {
  background: #00ff00;
  border-radius: 4px;
}

#results-output {
  display: block;
  white-space: pre-wrap;
}

/* API Instructions & Commands */
.api-instructions {
  background-color: #050805;
  border: 1px solid #005500;
  padding: 10px;
}

.vm-header {
  font-size: 16px;
  color: #00ff00;
  margin-bottom: 5px;
  letter-spacing: 1px;
}

.proxy-note {
  display: flex;
  align-items: center;
  background-color: #000000;
  border: 1px solid #333;
  color: #ffffff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  padding: 2px 8px;
  margin-bottom: 5px;
}

.prompt {
  color: #00ffff;
  font-weight: bold;
  margin-right: 8px;
  font-size: 20px;
}

.btn-mini {
  font-family: 'VT323', monospace;
  font-size: 16px;
  padding: 2px 8px;
  border: 1px solid;
  background: transparent;
  cursor: pointer;
}

.status-bar {
  font-size: 16px;
  color: #ffff00;
  text-transform: uppercase;
}

/* Teletext Footer Styling */
.teletext-footer {
  display: flex;
  justify-content: space-between;
  border-top: 2px solid #00ffff;
  padding-top: 10px;
  margin-top: 10px;
  align-items: center;
}

.footer-routing {
  font-size: 28px;
  font-weight: bold;
  color: #00ffff;
}

.routing-arrow {
  color: #ff00ff;
  margin: 0 10px;
}

.footer-arrows {
  color: #ffff00;
  margin-left: 10px;
  animation: teletext-blink 1.2s steps(2, start) infinite;
}

.footer-banner {
  text-align: right;
}

.footer-msg {
  display: block;
  font-size: 22px;
  color: #ffffff;
}

.footer-alert {
  display: block;
  font-size: 16px;
  color: #ff0000;
  letter-spacing: 1px;
}

/* Modal Help Panel */
.modal {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 20;
}

.modal-content {
  background-color: #000000;
  border: 4px solid #ffff00;
  border-radius: 10px;
  width: 80%;
  max-width: 600px;
  padding: 25px;
  box-shadow: 0 0 50px rgba(255, 255, 0, 0.2);
}

.modal-header {
  font-size: 32px;
  color: #ffff00;
  border-bottom: 2px dashed #ffff00;
  margin-bottom: 20px;
  text-align: center;
}

.modal-body {
  font-size: 24px;
  line-height: 1.4;
  margin-bottom: 25px;
}

.modal-body p {
  margin-bottom: 8px;
}

.modal-footer {
  text-align: center;
  color: #ff00ff;
  font-size: 22px;
  animation: teletext-blink 1s steps(2, start) infinite;
}

/* Highlight Helper Classes */
.cyan { color: #00ffff; }
.yellow { color: #ffff00; }
.green { color: #00ff00; }
.magenta { color: #ff00ff; }
.red { color: #ff0000; }

/* Date Input custom styling */
input[type="date"] {
  position: relative;
  font-family: 'VT323', monospace;
  font-size: 24px;
  width: 190px;
  color-scheme: dark;
}

/* Style the native calendar picker indicator icon to match the retro theme */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) sepia(100%) saturate(10000%) hue-rotate(150deg) brightness(1.2); /* turns it cyan */
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.1s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

@media (max-width: 900px) {
  body {
    padding: 8px;
  }

  .terminal-workspace {
    flex-direction: column;
  }

  .form-panel {
    max-width: none;
  }

  .form-row,
  .date-flex,
  .button-row,
  .teletext-footer {
    flex-wrap: wrap;
  }

  .teletext-header {
    gap: 8px;
    flex-wrap: wrap;
  }
}
