:root {
  --form-bg: #ffffff;
  --form-sidebar-width: 450px;

  --preview-primary: #0066cc;
  --preview-secondary: #004080;
  --preview-gray: #f5f5f5;
  --preview-text: #333333;
  --preview-text-light: #666666;
  --preview-white: #ffffff;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-family: "Roboto", sans-serif;
  background-color: #f0f2f5;
}

.app-container {
  display: flex;
  width: 100%;
  height: 100%;
}

.editor-pane {
  width: var(--form-sidebar-width);
  background: var(--form-bg);
  border-right: 1px solid #ddd;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

.editor-header {
  padding: 1rem 1.5rem;
  background: var(--preview-secondary);
  color: white;
  position: sticky;
  top: 0;
  z-index: 20;
}

.editor-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: white;
}

.editor-content {
  padding: 1.5rem;
}

.editor-pane input,
.editor-pane select {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  padding: 8px 12px;
}

.editor-pane label {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.form-section {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid #e9ecef;
}

.form-section h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--preview-secondary);
  border-bottom: 2px solid #dee2e6;
  padding-bottom: 0.5rem;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.preview-pane {
  flex: 1;
  background-color: #525659;
  overflow-y: auto;
  padding: 40px;
  display: flex;
  justify-content: center;
}

.preview-paper {
  width: 100%;
  max-width: 880px;
  min-height: 1000px;
  background: white;
  padding: 40px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  margin: 0 auto;
  position: relative;
}

.preview-paper h1,
.preview-paper h3 {
  color: var(--preview-secondary);
  margin-bottom: 0.5rem;
  margin-top: 0;
  line-height: 1.2;
}

.itinerary-header {
  background: linear-gradient(135deg, var(--preview-secondary), var(--preview-primary));
  color: white;
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.itinerary-header h1 {
  color: white;
  font-size: 2rem;
  font-weight: 700;
}

.header-logo {
  height: 40px;
  margin-top: 10px;
  object-fit: contain;
}

.header-ref {
  text-align: right;
}

.header-ref span {
  display: block;
  font-size: 0.9rem;
  opacity: 0.9;
}

.booking-ref-display {
  font-family: monospace;
  font-size: 1.2rem;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: 4px;
  display: inline-block;
}

.itinerary-summary {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  border-left: 5px solid var(--preview-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.summary-item label {
  display: block;
  font-size: 0.8rem;
  color: var(--preview-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.summary-item strong {
  display: block;
  font-size: 1.1rem;
  color: var(--preview-text);
}

.flight-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
  margin-bottom: 2rem;
  overflow: hidden;
}

.flight-card-header {
  background: var(--preview-gray);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flight-card-header h3 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.flight-body {
  padding: 1.5rem;
}

.flight-route {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.p-airport {
  flex: 1;
}

.p-code {
  font-size: 2rem;
  font-weight: 700;
  color: var(--preview-primary);
  line-height: 1;
}

.p-time {
  font-size: 1.5rem;
  font-weight: 300;
  margin-top: 4px;
}

.p-name {
  font-size: 0.9rem;
  color: var(--preview-text-light);
  margin-top: 4px;
}

.flight-visual {
  flex: 1.5;
  text-align: center;
  position: relative;
  padding: 0 1rem;
}

.visual-line {
  height: 2px;
  background: #e0e0e0;
  position: relative;
  margin: 10px 0;
}

.plane-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 0 8px;
  color: var(--preview-primary);
  font-size: 1.2rem;
}

.flight-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  background: #f8fbfe;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e1e8ed;
}

.detail-item span {
  display: block;
  font-size: 0.8rem;
  color: var(--preview-text-light);
}

.detail-item strong {
  color: var(--preview-text);
}

.price-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-top: 4px solid var(--preview-secondary);
}

.price-title {
  margin-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 0.5rem;
  font-size: 1.1rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.price-row:last-child {
  border-bottom: none;
  padding-top: 1rem;
  margin-top: 0.5rem;
  font-size: 1.2rem;
}

.total-label {
  font-weight: 700;
  color: var(--preview-secondary);
}

.total-amount {
  font-weight: 700;
  color: var(--preview-primary);
}

.itinerary-footer {
  text-align: center;
  color: var(--preview-text-light);
  font-size: 0.9rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.plus-one {
  color: #d32f2f;
  font-size: 0.6em;
  vertical-align: top;
  margin-left: 2px;
  font-weight: bold;
}

.hidden {
  display: none !important;
}

/* Small helpers used in the cleaned HTML */
.transit-box {
  background: #fff9e6;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  border-left: 4px solid #ffc107;
}
.transit-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.5rem;
}
.transit-label {
  color: #856404;
}
.transit-body {
  font-size: 0.95rem;
  color: #666;
}
.transit-code {
  color: var(--preview-primary);
  font-size: 1.1rem;
}
.transit-duration {
  color: #856404;
  font-weight: 500;
}

.connect-block {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px dashed #ccc;
}
.connect-title {
  color: var(--preview-secondary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.connect-airline {
  font-size: 0.9rem;
  font-weight: normal;
  color: var(--preview-text-light);
  margin-left: auto;
}
.connect-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}
.airline-logo {
  height: 30px;
  object-fit: contain;
  display: none;
}
.connect-layover {
  background: #e8f4fd;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  color: #1565c0;
}
.connect-layover.purple {
  background: #f3e5f5;
  color: #6a1b9a;
}
.connect-city {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--preview-primary);
}
.connect-mini {
  font-size: 0.85rem;
  color: var(--preview-text-light);
}
.connect-line {
  height: 2px;
  background: #ccc;
  margin: 8px 0;
  position: relative;
}
.connect-plane {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 0 6px;
}

/* Responsive */
@media (max-width: 900px) {
  .app-container {
    flex-direction: column;
    overflow: auto;
  }
  .editor-pane {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ddd;
    height: auto;
    max-height: 50vh;
  }
  .preview-pane {
    height: auto;
    min-height: 50vh;
  }
  .preview-paper {
    transform: scale(0.8);
    transform-origin: top center;
  }
}

/* Print */
@media print {
  .editor-pane {
    display: none;
  }
  .preview-pane {
    padding: 0;
    background: white;
    height: auto;
    overflow: visible;
  }
  .preview-paper {
    box-shadow: none;
    margin: 0;
    padding: 0;
    max-width: 100%;
  }
  body {
    height: auto;
    overflow: visible;
    background: white;
  }
  .itinerary-header {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}