/* ===== GENERAL ===== */
:root {
  --primary: #2e7dff;
  --accent: #ff9f43;
  --accent-hover: #ff7a00;
  --bg: #f4f6fb;
  --text: #111;
  --text-muted: #666;
  --card-bg: #fff;
  --border: #eaeaea;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 32px 12px;
  margin-bottom: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden; /* Verhindert, dass das Bild über den Header hinausragt falls margin negativ ist */
}

.logo-img { 
  height: 320px; 
  width: auto; 
  margin: -80px 0 -70px 0; /* Zieht drastisch das durchsichtige Padding des Logos ab, was den Header viel schmaler macht! */
}
.header-subtitle p { margin: 0 0 0 0; z-index: 2; position: relative; font-size: 15px; font-weight: 500; color: var(--text-muted); }

.weather {
  position: absolute;
  top: 50%; right: 24px;
  transform: translateY(-50%);
  background: #eef4ff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* ===== SEARCH ===== */
.search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 16px;
}

.search-icon { width: 20px; height: 20px; color: var(--primary); }
.search input {
  flex: 1;
  padding: 14px 0;
  font-size: 16px;
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
}

/* ===== TABLE HEADER ===== */
.table-header {
  display: flex;
  align-items: center;
  padding: 10px 24px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 4px;
}

.col-dest { width: 200px; flex-shrink: 0; }
.col-price { width: 90px; flex-shrink: 0; text-align: right; }
.col-weekly { display: flex; flex: 1; gap: 4px; padding: 0 12px; }
.col-day { flex: 1; text-align: center; font-size: 12px; }
.col-action { width: 100px; flex-shrink: 0; text-align: right; }

/* ===== FLIGHT LIST ===== */
.flight-list {
  display: flex;
  flex-direction: column;
}

/* ===== FLIGHT ROW ===== */
.flight-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 6px;
  transition: all 0.3s ease;
  position: relative;
}

.flight-row:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: var(--primary);
  z-index: 10;
}

.flight-row .col-dest {
  width: 200px; flex-shrink: 0;
  display: flex; flex-direction: column;
}
.flight-row .col-dest strong { font-size: 15px; font-weight: 700; }
.flight-row .col-dest small { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.flight-row .col-price {
  width: 90px; flex-shrink: 0;
  text-align: right;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.flight-row .col-weekly {
  display: flex; flex: 1; gap: 4px; padding: 0 12px;
}

.flight-row .col-day {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 8px;
  background: #f8fafc;
}

.price-low {
  color: #16a34a !important;
  background: #f0fdf4 !important;
}

.price-na {
  color: #ccc !important;
  background: transparent !important;
}

.col-action { width: 100px; flex-shrink: 0; text-align: right; }

/* ===== BUCHEN BUTTON ===== */
.btn-book {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  font-weight: 700;
  font-size: 13px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-book:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,122,0,0.3);
}

/* ===== HOVER EXPAND (Chart + CO2) ===== */
.hover-expand {
  width: 100%;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
  display: flex;
  gap: 24px;
  margin-top: 0;
}

.flight-row.loaded:hover .hover-expand {
  max-height: 140px;
  opacity: 1;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  overflow: visible;
}

.expand-left {
  flex: 1;
}

.chart-wrap {
  height: 90px;
  width: 100%;
  position: relative;
}

.expand-right {
  width: 180px;
  display: flex;
  align-items: center;
}

.expand-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.expand-info b { color: var(--text); }

/* ===== SKELETON ===== */
.skeleton-text {
  color: transparent !important;
  background: linear-gradient(90deg, #eaeaea 25%, #f5f5f5 50%, #eaeaea 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  min-width: 30px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== PAUSED ROW ===== */
.flight-row.paused {
  opacity: 0.5;
  order: 99;
}
.flight-row.paused:hover {
  box-shadow: none;
  border-color: var(--border);
}

.badge-paused {
  background: #e5e5e5;
  color: #666;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}

/* ===== FOOTER ===== */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

.footer-logo { 
  height: 200px; 
  opacity: 1; 
  margin: -60px 0 -50px -20px; /* Nimmt auch hier den Weißraum weg */
}
.footer-right p { margin: 0; font-size: 13px; color: var(--text-muted); text-align: right; line-height: 1.6; }
.footer-link { color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; transition: color 0.2s; }
.footer-link:hover { color: var(--primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .col-dest { width: 140px; }
  .col-price { width: 70px; }
  .col-action { width: 80px; }
  .flight-row .col-day { font-size: 11px; padding: 4px 2px; }
}

@media (max-width: 600px) {
  /* Header Fix */
  .header { padding: 12px 16px; margin-bottom: 20px; }
  .weather { position: relative; top: auto; right: auto; transform: none; margin: 0 auto 12px auto; display: inline-block; z-index: 10; }
  .logo-img { height: 160px; margin: -40px 0 -30px 0; }
  .header-subtitle p { font-size: 13px; text-align: center; }

  /* Table Layout Fix */
  .table-header { padding: 0 16px; margin-bottom: 6px; border: none; }
  .table-header .col-dest, .table-header .col-price, .table-header .col-action { display: none; }
  .table-header .col-weekly { width: 100%; padding: 0; }

  .flight-row { padding: 16px; align-items: flex-start; gap: 12px 0; }
  
  .flight-row .col-dest { width: 70%; }
  .flight-row .col-price { width: 30%; font-size: 22px; margin-top: 4px; }
  
  .flight-row .col-weekly { width: 100%; padding: 0; margin-bottom: 4px; }
  .col-day { padding: 8px 2px; font-size: 12px; }
  
  .flight-row .col-action { width: 100%; text-align: center; }
  .flight-row .btn-book { display: block; width: 100%; padding: 14px; font-size: 16px; }

  /* Chart Expansion Fix */
  .hover-expand { flex-direction: column; gap: 16px; }
  .flight-row.loaded:hover .hover-expand { max-height: 380px; }
  .expand-right { width: 100%; justify-content: center; }
  .co2-tooltip { left: 50%; transform: translateX(-50%); width: 220px; text-align: center; }
  .co2-tooltip::before { left: 50%; margin-left: -6px; }
  .co2-tooltip::after { left: 50%; margin-left: -5px; }

  /* Modals */
  .disclaimer-box { width: 95%; padding: 24px 20px; }
  .footer-logo { height: 120px; margin: -30px 0 -20px -10px; }
  .footer { flex-direction: column; gap: 20px; align-items: flex-start; padding: 24px; text-align: left; }
  .footer-right p { text-align: left; }
}

/* --- CO2 Tooltip --- */
.co2-tooltip-trigger {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted #888;
}

.co2-tooltip {
  visibility: hidden;
  position: absolute;
  bottom: 120%; 
  left: 50%;
  margin-bottom: 8px;
  transform: translateX(0); /* Baut sich nach rechts auf */
  background: #ffffff;
  color: #111;
  font-weight: 500;
  border: 1px solid var(--border, #eaeaea);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 11px;
  width: 250px;
  text-align: left;
  line-height: 1.5;
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: 0.2px;
}

.co2-tooltip strong {
  color: #2e7dff;
  font-size: 13px;
}

.co2-tooltip-trigger:hover .co2-tooltip {
  visibility: visible;
  opacity: 1;
}

.co2-tooltip::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 12px;
  border-width: 6px;
  border-style: solid;
  border-color: var(--border, #eaeaea) transparent transparent transparent;
}

.co2-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 13px; /* Slightly offset over the border */
  margin-top: -1px;
  border-width: 5px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

/* --- DISCLAIMER MODAL --- */
.disclaimer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.4); /* Leichte Aufhellung */
  backdrop-filter: blur(12px); /* Unscharfer Hintergrund */
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.disclaimer-box {
  background: #fff;
  width: 90%;
  max-width: 420px; /* Ca. A5 Breite (148x210 Proportion) */
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  border-radius: 16px;
  padding: 32px 28px;
  text-align: left;
  border: 1px solid rgba(0,0,0,0.05);
}

.disclaimer-box h2 {
  font-size: 20px;
  font-weight: 700;
  color: #111;
  margin-top: 0;
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

.disclaimer-box p {
  font-size: 13px;
  line-height: 1.6;
  color: #444;
  margin-bottom: 14px;
}

.disclaimer-buttons {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  justify-content: space-between;
}

.disclaimer-buttons button {
  flex: 1;
  padding: 12px 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-blue {
  background: #2e7dff;
  color: #fff;
}

.btn-blue:hover {
  background: #1b63da;
}

.btn-outline {
  background: transparent;
  color: #2e7dff;
  border: 1px solid #2e7dff !important;
}

.btn-outline:hover {
  background: #f0f6ff;
}