/* ============================================================
   SkyDrift Flight Search v2.0 — skydrift.css
   /wp-content/plugins/skydrift-flights/assets/skydrift.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── VARIABLES ──────────────────────────────────────────────── */
.skydrift-wrap {
  --sd-ink:     #0d0f1a;
  --sd-sky:     #1e2f5e;
  --sd-sky-d:   #131f42;
  --sd-gold:    #d4a843;
  --sd-accent:  #e05c3a;
  --sd-green:   #1e7a4d;
  --sd-soft:    #f0ede8;
  --sd-muted:   #7a7570;
  --sd-border:  rgba(255,255,255,0.14);
  --sd-r:       14px;
  --sd-r-sm:    10px;
  --sd-shadow:  0 4px 24px rgba(13,15,26,0.10);
  --sd-shadow-lg: 0 16px 56px rgba(13,15,26,0.18);

  font-family: 'DM Sans', system-ui, sans-serif;
  max-width: 900px;
  margin: 0 auto;
}

/* ── SEARCH BOX ─────────────────────────────────────────────── */
.sd-search-box {
  background: var(--sd-sky);
  border-radius: 20px;
  padding: 32px 36px 36px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sd-shadow-lg);
}

.sd-search-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 85% 10%, rgba(212,168,67,0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 5% 95%,  rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}

/* decorative plane watermark */
.sd-search-box::after {
  content: '✈';
  position: absolute;
  right: 32px;
  top: 20px;
  font-size: 90px;
  opacity: 0.05;
  transform: rotate(-10deg);
  pointer-events: none;
  line-height: 1;
}

.sd-box-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 20px;
}

/* ── TRIP TABS ──────────────────────────────────────────────── */
.sd-trip-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  position: relative;
}

.sd-tab {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid var(--sd-border);
  color: rgba(255,255,255,0.55);
  padding: 9px 22px;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}

.sd-tab.active {
  background: var(--sd-gold);
  border-color: var(--sd-gold);
  color: var(--sd-ink);
  font-weight: 700;
}

.sd-tab:not(.active):hover {
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.9);
}

/* ── FORM ROWS ──────────────────────────────────────────────── */
.sd-form { position: relative; }

.sd-row {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  align-items: start;
}

.sd-route-row {
  grid-template-columns: 1fr 44px 1fr;
  align-items: end;
}

.sd-dates-row  { grid-template-columns: 1fr 1fr; }
.sd-pax-row    { grid-template-columns: 1fr 1fr; }

/* ── FIELD ──────────────────────────────────────────────────── */
.sd-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sd-field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  padding-left: 2px;
}

.sd-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sd-field-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  pointer-events: none;
  z-index: 1;
  line-height: 1;
}

.sd-field input,
.sd-field select {
  width: 100%;
  background: rgba(255,255,255,0.09);
  border: 1.5px solid var(--sd-border);
  border-radius: var(--sd-r);
  padding: 13px 16px 13px 44px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  appearance: none;
  -webkit-appearance: none;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sd-field input[type="date"],
.sd-field select {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

.sd-field input::placeholder {
  color: rgba(255,255,255,0.28);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  font-size: 14px;
}

.sd-field input:focus,
.sd-field select:focus {
  border-color: var(--sd-gold);
  background: rgba(255,255,255,0.13);
  outline: none;
}

.sd-field input.sd-invalid,
.sd-field select.sd-invalid {
  border-color: #fc8181;
  background: rgba(252,129,129,0.08);
}

.sd-field select option { background: var(--sd-sky-d); color: #fff; }
.sd-field input[type="date"] { color-scheme: dark; }

.sd-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.28);
  padding-left: 2px;
  font-style: italic;
}

/* ── SWAP BUTTON ────────────────────────────────────────────── */
.sd-swap-btn {
  width: 44px;
  height: 44px;
  background: var(--sd-gold);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sd-ink);
  transition: transform 0.35s ease, box-shadow 0.2s;
  align-self: flex-end;
  margin-bottom: 2px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(212,168,67,0.3);
}

.sd-swap-btn:hover {
  transform: rotate(180deg);
  box-shadow: 0 6px 20px rgba(212,168,67,0.4);
}

/* ── VALIDATION ERROR ───────────────────────────────────────── */
.sd-form-error {
  background: rgba(252,129,129,0.15);
  border: 1.5px solid rgba(252,129,129,0.4);
  border-radius: var(--sd-r-sm);
  padding: 12px 16px;
  color: #fed7d7;
  font-size: 14px;
  margin-bottom: 4px;
}

/* ── SEARCH BUTTON ──────────────────────────────────────────── */
.sd-search-btn {
  width: 100%;
  background: var(--sd-accent);
  color: #fff;
  border: none;
  padding: 17px 24px;
  border-radius: var(--sd-r);
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.sd-search-btn:hover:not(:disabled) {
  background: #c44e2f;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(224,92,58,0.4);
}

.sd-search-btn:active { transform: translateY(0); }
.sd-search-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* button spinner */
.sd-btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sd-spin 0.7s linear infinite;
  vertical-align: middle;
}

/* ── RESULTS SECTION ────────────────────────────────────────── */
.sd-results-section {
  margin-top: 32px;
  animation: sd-fade-in 0.4s ease both;
}

@keyframes sd-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── LOADING ────────────────────────────────────────────────── */
.sd-loading {
  text-align: center;
  padding: 56px 24px;
}

.sd-plane-loader-wrap { margin-bottom: 20px; }

.sd-plane-anim {
  font-size: 48px;
  display: block;
  margin-bottom: 14px;
  animation: sd-fly 2s ease-in-out infinite;
}

@keyframes sd-fly {
  0%,100% { transform: translateX(-6px) rotate(-5deg); }
  50%      { transform: translateX(6px)  rotate(5deg);  }
}

.sd-progress-bar {
  width: 200px;
  height: 4px;
  background: var(--sd-soft);
  border-radius: 100px;
  margin: 0 auto;
  overflow: hidden;
}

.sd-progress-fill {
  height: 100%;
  background: var(--sd-sky);
  border-radius: 100px;
  animation: sd-progress 2s ease-in-out infinite;
}

@keyframes sd-progress {
  0%   { width: 5%;   margin-left: 0; }
  50%  { width: 60%;  margin-left: 20%; }
  100% { width: 5%;   margin-left: 95%; }
}

.sd-loading-text {
  font-size: 16px;
  color: var(--sd-muted);
  margin: 0;
}

/* ── ERROR BOX ──────────────────────────────────────────────── */
.sd-error-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff5f5;
  border: 2px solid #fed7d7;
  border-radius: var(--sd-r);
  padding: 18px 20px;
}

.sd-error-box span:first-child { font-size: 22px; flex-shrink: 0; }
.sd-error-box p { flex: 1; color: #c53030; margin: 0; font-size: 15px; }
.sd-error-box button {
  background: none;
  border: 1.5px solid #fc8181;
  color: #c53030;
  padding: 6px 12px;
  border-radius: var(--sd-r-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  flex-shrink: 0;
}

/* ── RESULTS HEADER ─────────────────────────────────────────── */
.sd-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.sd-results-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--sd-ink);
  margin: 0 0 4px;
  line-height: 1.1;
}

.sd-results-meta {
  color: var(--sd-muted);
  font-size: 14px;
  margin: 0;
}

/* ── SORT BAR ───────────────────────────────────────────────── */
.sd-sort-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sd-sort-label {
  font-size: 13px;
  color: var(--sd-muted);
  font-weight: 500;
  margin-right: 2px;
}

.sd-sort-btn {
  background: #fff;
  border: 2px solid #e5e2dc;
  border-radius: 100px;
  padding: 7px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--sd-muted);
  cursor: pointer;
  transition: all 0.18s;
}

.sd-sort-btn.active {
  border-color: var(--sd-sky);
  color: var(--sd-sky);
  font-weight: 700;
  background: #fff;
}

.sd-sort-btn:hover:not(.active) {
  border-color: #bbb;
  color: var(--sd-ink);
}

/* ── FLIGHT CARD ────────────────────────────────────────────── */
.sd-flight-card {
  background: #fff;
  border-radius: 18px;
  padding: 22px 26px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 20px;
  align-items: center;
  border: 2px solid transparent;
  transition: all 0.22s ease;
  position: relative;
  box-shadow: var(--sd-shadow);
  animation: sd-card-in 0.35s ease both;
}

@keyframes sd-card-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sd-flight-card:hover {
  border-color: var(--sd-sky);
  box-shadow: 0 10px 36px rgba(30,47,94,0.13);
  transform: translateY(-3px);
}

.sd-flight-card.sd-best {
  border-color: var(--sd-gold);
}

.sd-best-badge {
  position: absolute;
  top: -12px;
  left: 22px;
  background: var(--sd-gold);
  color: var(--sd-ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 100px;
}

/* ── AIRLINE COL ────────────────────────────────────────────── */
.sd-airline-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.sd-airline-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: #fff;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.sd-airline-name {
  font-size: 11px;
  color: var(--sd-muted);
  line-height: 1.3;
  font-weight: 500;
}

.sd-flight-no {
  font-size: 10px;
  color: #bbb;
  font-weight: 500;
}

/* ── ROUTE COL ──────────────────────────────────────────────── */
.sd-route-col { display: flex; flex-direction: column; gap: 6px; }

.sd-leg {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sd-time-city { text-align: center; min-width: 52px; }

.sd-time {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  color: var(--sd-ink);
}

.sd-iata {
  font-size: 12px;
  color: var(--sd-muted);
  font-weight: 700;
  margin-top: 3px;
  letter-spacing: 1px;
}

.sd-mid-route {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.sd-line-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 5px;
}

.sd-line {
  flex: 1;
  height: 1.5px;
  background: #e5e2dc;
}

.sd-plane-dot { font-size: 16px; color: var(--sd-sky); }

.sd-dur  { font-size: 11px; color: var(--sd-muted); font-weight: 600; }
.sd-stops { font-size: 11px; font-weight: 700; color: var(--sd-accent); }
.sd-stops.nonstop { color: var(--sd-green); }

/* Return leg label */
.sd-return-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #bbb;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e5e2dc;
}

/* ── PRICE COL ──────────────────────────────────────────────── */
.sd-price-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 130px;
}

.sd-price {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  font-weight: 900;
  color: var(--sd-ink);
  line-height: 1;
  white-space: nowrap;
}

.sd-price-note { font-size: 11px; color: var(--sd-muted); margin-top: 2px; }

.sd-seats-left {
  font-size: 11px;
  color: var(--sd-accent);
  font-weight: 700;
  background: rgba(224,92,58,0.08);
  padding: 3px 10px;
  border-radius: 100px;
}

.sd-bag-info {
  font-size: 11px;
  color: var(--sd-muted);
}

.sd-cabin-badge {
  background: var(--sd-soft);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 100px;
  color: var(--sd-muted);
  font-weight: 600;
}

.sd-book-btn {
  display: inline-block;
  background: var(--sd-sky);
  color: #fff !important;
  border: none;
  padding: 12px 22px;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none !important;
  white-space: nowrap;
}

.sd-book-btn:hover {
  background: var(--sd-sky-d);
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(30,47,94,0.28);
}

/* ── NO RESULTS ─────────────────────────────────────────────── */
.sd-no-results {
  text-align: center;
  padding: 72px 24px;
  color: var(--sd-muted);
}

.sd-no-results-icon { font-size: 56px; margin-bottom: 16px; display: block; }

.sd-no-results h3 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--sd-ink);
  margin: 0 0 8px;
}

.sd-no-results p { margin: 0 0 16px; }

.sd-tips {
  display: inline-block;
  text-align: left;
  background: var(--sd-soft);
  border-radius: var(--sd-r);
  padding: 14px 20px;
  margin: 0;
  list-style: none;
}

.sd-tips li {
  font-size: 14px;
  padding: 5px 0;
  color: var(--sd-muted);
}

.sd-tips li::before { content: '💡 '; }

/* ── SPINNER ────────────────────────────────────────────────── */
@keyframes sd-spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 680px) {
  .sd-search-box { padding: 24px 18px 28px; }
  .sd-search-box::after { display: none; }

  .sd-route-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .sd-swap-btn {
    transform: rotate(90deg);
    align-self: center;
    margin: -4px auto;
  }
  .sd-swap-btn:hover { transform: rotate(270deg); }

  .sd-dates-row,
  .sd-pax-row { grid-template-columns: 1fr; }

  .sd-flight-card {
    grid-template-columns: 60px 1fr;
    grid-template-rows: auto auto;
    padding: 18px;
  }

  .sd-price-col {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    min-width: unset;
    border-top: 1px solid var(--sd-soft);
    padding-top: 14px;
    margin-top: 4px;
  }

  .sd-time { font-size: 20px; }
  .sd-price { font-size: 24px; }

  .sd-results-header { flex-direction: column; gap: 12px; }
  .sd-sort-bar { gap: 5px; }
  .sd-sort-btn { padding: 6px 12px; font-size: 12px; }

  .sd-return-field { display: none; }
  .sd-return-field.sd-visible { display: block; }
}

@media (max-width: 440px) {
  .sd-trip-tabs { flex-wrap: wrap; }
  .sd-flight-card { grid-template-columns: 1fr; }
  .sd-airline-col { flex-direction: row; justify-content: flex-start; }
}

/* ── AUTOCOMPLETE DROPDOWN ──────────────────────────────────── */
.sd-autocomplete-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(13,15,26,0.22), 0 2px 8px rgba(13,15,26,0.08);
  list-style: none;
  margin: 0;
  padding: 6px;
  z-index: 9999;
  max-height: 340px;
  overflow-y: auto;
  border: 1.5px solid #e8e4de;

  /* Hidden by default, shown when open */
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.sd-autocomplete-drop.sd-drop-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Custom scrollbar */
.sd-autocomplete-drop::-webkit-scrollbar { width: 4px; }
.sd-autocomplete-drop::-webkit-scrollbar-track { background: transparent; }
.sd-autocomplete-drop::-webkit-scrollbar-thumb { background: #d4d0ca; border-radius: 4px; }

/* Each airport option */
.sd-ac-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
  outline: none;
}

.sd-ac-item:hover,
.sd-ac-item.sd-ac-focused {
  background: #f0ede8;
}

.sd-ac-item:hover .sd-ac-iata,
.sd-ac-item.sd-ac-focused .sd-ac-iata {
  background: var(--sd-sky, #1e2f5e);
  color: #fff;
}

/* IATA badge */
.sd-ac-iata {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--sd-sky, #1e2f5e);
  background: #e8f0fe;
  padding: 5px 10px;
  border-radius: 8px;
  min-width: 44px;
  text-align: center;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}

/* City + airport name */
.sd-ac-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sd-ac-city {
  font-size: 15px;
  font-weight: 600;
  color: #0d0f1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sd-ac-name {
  font-size: 12px;
  color: #9a9590;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Country label */
.sd-ac-country {
  font-size: 11px;
  color: #bbb;
  font-weight: 500;
  flex-shrink: 0;
  text-align: right;
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Divider between items (light) */
.sd-ac-item + .sd-ac-item {
  border-top: 1px solid #f5f3ef;
}

/* ── CONFIRMED INPUT STATE ──────────────────────────────────── */
.sd-field input.sd-confirmed {
  border-color: var(--sd-green, #1e7a4d) !important;
  background: rgba(30,122,77,0.06) !important;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: #fff;
  font-size: 14px;
}

/* ── CONFIRM TICK ANIMATION ─────────────────────────────────── */
.sd-confirm-tick {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sd-green, #1e7a4d);
  font-size: 18px;
  font-weight: 700;
  pointer-events: none;
  transition: opacity 0.5s ease;
  opacity: 1;
}

.sd-confirm-tick.sd-tick-fade {
  opacity: 0;
}
