/* flight_search.css — International Flights search page (mobile-first). */

.wg-flight { max-width: 760px; margin: 0 auto; padding: 8px 0 40px; }
.wg-flight-head h1 { font-size: 1.35rem; margin: 0 0 4px; }
.wg-flight-intro { color: var(--wg-muted, #6b7280); margin: 0 0 16px; font-size: 0.92rem; }

/* ── Form card ── */
.wg-flight-form {
  background: #fff; border: 1px solid var(--wg-border, #e5e7eb); border-radius: 16px;
  padding: 16px; box-shadow: 0 4px 18px rgba(0,0,0,0.05); display: flex; flex-direction: column; gap: 14px;
}
.wg-flight-form .wg-field { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.wg-flight-form .wg-field-label { font-size: 0.78rem; font-weight: 600; color: var(--wg-muted, #6b7280); }
.wg-flight-form select {
  padding: 10px 10px; border: 1px solid var(--wg-border, #e5e7eb); border-radius: 10px;
  font: inherit; background: #fff; width: 100%;
}

/* Trip-type segmented control */
.wg-flight-trip { display: inline-flex; background: #f1f3f5; border-radius: 999px; padding: 3px; align-self: flex-start; }
.wg-flight-seg {
  border: none; background: none; padding: 8px 18px; border-radius: 999px; font: inherit; font-weight: 600;
  color: var(--wg-muted, #6b7280); cursor: pointer; transition: background .15s, color .15s;
}
.wg-flight-seg.is-active { background: #fff; color: var(--wg-color, #0eaf4c); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }

/* Origin / destination row with swap */
.wg-flight-od { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; }

/* Airport search autocomplete */
.wg-ac { position: relative; }
.wg-ac-input {
  width: 100%; padding: 10px; border: 1px solid var(--wg-border, #e5e7eb); border-radius: 10px;
  font: inherit; background: #fff;
}
.wg-ac-input:focus { outline: none; border-color: var(--wg-color, #0eaf4c); box-shadow: 0 0 0 3px rgba(14,175,76,0.12); }
.wg-ac-list {
  list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; z-index: 30; left: 0; right: 0;
  background: #fff; border: 1px solid var(--wg-border, #e5e7eb); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.14); max-height: 280px; overflow-y: auto;
}
.wg-ac-list[hidden] { display: none; }
.wg-ac-item { padding: 9px 10px; border-radius: 7px; cursor: pointer; font-size: 0.9rem; }
.wg-ac-item:hover, .wg-ac-item.is-active { background: #eef7f0; }
.wg-flight-swap {
  border: 1px solid var(--wg-border, #e5e7eb); background: #fff; width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--wg-color, #0eaf4c); flex: none; margin-bottom: 1px;
}
.wg-flight-swap:hover { background: #f0fbf4; }

.wg-flight-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wg-flight-datebtn {
  text-align: left; padding: 10px; border: 1px solid var(--wg-border, #e5e7eb); border-radius: 10px;
  background: #fff; font: inherit; cursor: pointer; color: var(--wg-muted, #6b7280); width: 100%;
}
.wg-flight-datebtn.has-val { color: var(--wg-text, #111); font-weight: 600; }

.wg-flight-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* Modern toggle switch for "nonstop only" */
.wg-flight-nonstop { display: inline-flex; align-items: center; gap: 10px; font-size: 0.92rem; cursor: pointer; user-select: none; align-self: flex-start; }
.wg-switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wg-switch { width: 46px; height: 27px; border-radius: 999px; background: #d1d5db; position: relative; flex: none; transition: background .18s ease; }
.wg-switch-dot { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: transform .18s ease; }
.wg-switch-input:checked + .wg-switch { background: var(--wg-color, #0eaf4c); }
.wg-switch-input:checked + .wg-switch .wg-switch-dot { transform: translateX(19px); }
.wg-switch-input:focus-visible + .wg-switch { box-shadow: 0 0 0 3px rgba(14,175,76,0.3); }

.wg-flight-go { width: 100%; padding: 13px; font-size: 1rem; font-weight: 700; }

/* Save-search = compact chip (sized like a marketplace category chip, never bigger than Search) */
.wg-flight-save {
  align-self: center; display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border: 1px solid var(--wg-border, #e5e7eb); border-radius: 999px;
  background: #fff; color: var(--wg-text, #374151); font: inherit; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.wg-flight-save:hover { border-color: var(--wg-color, #0eaf4c); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.wg-flight-save:disabled { opacity: 0.6; cursor: default; }

/* Price caveat under the results toolbar */
.wg-flight-pricenote { margin: 0 0 12px; font-size: 0.76rem; color: var(--wg-muted, #6b7280); }
.wg-flight-go:disabled { opacity: 0.6; cursor: progress; }
.wg-flight-disclaimer { margin: 0; font-size: 0.75rem; color: var(--wg-muted, #6b7280); text-align: center; }

/* ── Logged-out gate ── */
.wg-flight-gate {
  text-align: center; background: #fff; border: 1px solid var(--wg-border, #e5e7eb); border-radius: 18px;
  padding: 36px 22px; box-shadow: 0 10px 30px rgba(0,0,0,0.06); max-width: 460px; margin: 10px auto;
}
.wg-flight-gate-art {
  width: 78px; height: 78px; margin: 0 auto 16px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; color: var(--wg-color, #0eaf4c); background: linear-gradient(135deg, #e9f9ef, #d3f0df);
}
.wg-flight-gate h2 { margin: 0 0 8px; font-size: 1.25rem; }
.wg-flight-gate p { margin: 0 0 22px; color: var(--wg-muted, #6b7280); }
.wg-flight-gate-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.wg-flight-gate-primary { min-width: 210px; padding: 12px 20px; font-weight: 700; }
.wg-flight-gate-alt { color: var(--wg-color, #0eaf4c); font-weight: 600; text-decoration: none; font-size: 0.9rem; }
.wg-flight-gate-alt:hover { text-decoration: underline; }

/* ── Saved searches ── */
.wg-flight-saved { max-width: 760px; margin: 0 auto 14px; }
.wg-flight-saved-head { font-size: 0.8rem; font-weight: 700; color: var(--wg-muted, #6b7280); margin-bottom: 8px; }
.wg-flight-saved-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wg-flight-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 7px 8px 7px 13px; border: 1px solid var(--wg-border, #e5e7eb);
  border-radius: 999px; background: #fff; font-size: 0.85rem; transition: border-color .15s, box-shadow .15s;
}
.wg-flight-chip:hover { border-color: var(--wg-color, #0eaf4c); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.wg-flight-chip-run { border: none; background: none; font: inherit; font-weight: 600; cursor: pointer; color: inherit; padding: 0; }
.wg-flight-chip-x { border: none; background: none; cursor: pointer; color: var(--wg-muted, #9aa0a6); font-size: 1.1rem; line-height: 1; padding: 0 3px; border-radius: 50%; }
.wg-flight-chip-x:hover { color: #c0392b; }

/* ── Results ── */
.wg-flight-results { margin-top: 20px; }
.wg-flight-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.wg-flight-count { font-weight: 700; font-size: 0.95rem; }
.wg-flight-sort { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--wg-muted, #6b7280); }
.wg-flight-sort select { padding: 7px 8px; border: 1px solid var(--wg-border, #e5e7eb); border-radius: 8px; font: inherit; background: #fff; }

.wg-flight-status { text-align: center; padding: 30px 12px; color: var(--wg-muted, #6b7280); font-size: 0.95rem; }
.wg-flight-status.is-error { color: #c0392b; }
/* Searching state: the Waegook logo gently flying */
.wg-flight-loader { display: inline-flex; flex-direction: column; align-items: center; gap: 12px; }
.wg-flight-loader-logo { width: 58px; height: 58px; object-fit: contain; animation: wg-fly 1.3s ease-in-out infinite; will-change: transform; }
.wg-flight-loader-txt { color: var(--wg-muted, #6b7280); font-size: 0.95rem; }
@keyframes wg-fly {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-9px) rotate(4deg); }
}

.wg-flight-list { display: flex; flex-direction: column; gap: 12px; }

/* Flight card (whole card links to Naver) */
.wg-fcard {
  display: block; text-decoration: none; color: inherit; background: #fff;
  border: 1px solid var(--wg-border, #e5e7eb); border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04); transition: box-shadow .15s, transform .05s, border-color .15s;
}
.wg-fcard:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.10); border-color: #cbd5e1; }
.wg-fcard:active { transform: translateY(1px); }

.wg-fcard-legs { display: flex; flex-direction: column; gap: 12px; }
.wg-fcard-leg { display: flex; flex-direction: column; gap: 4px; }
.wg-fcard-legtag { font-size: 0.68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--wg-muted, #9aa0a6); }
.wg-fcard-route { display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; gap: 6px; }
.wg-fcard-end { display: flex; flex-direction: column; }
.wg-fcard-end:last-child { text-align: right; }
.wg-fcard-end:last-child .wg-fcard-code { align-self: flex-end; }
.wg-fcard-time { font-size: 1.15rem; font-weight: 700; line-height: 1.1; }
.wg-fcard-time sup { font-size: 0.6rem; color: #c0392b; font-weight: 700; }
.wg-fcard-code { font-size: 0.8rem; color: var(--wg-muted, #6b7280); }
.wg-fcard-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wg-fcard-dur { font-size: 0.72rem; color: var(--wg-muted, #6b7280); }
.wg-fcard-line { width: 100%; height: 2px; background: linear-gradient(90deg, #cbd5e1, #cbd5e1); border-radius: 2px; position: relative; }
.wg-fcard-line::after { content: "✈"; position: absolute; right: -2px; top: -8px; font-size: 0.7rem; color: var(--wg-color, #0eaf4c); }
.wg-fcard-nonstop { font-size: 0.68rem; font-weight: 700; color: var(--wg-color, #0eaf4c); }
.wg-fcard-stops { font-size: 0.68rem; color: #b26a00; }
.wg-fcard-sub { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--wg-muted, #6b7280); }
.wg-fcard-air { font-weight: 600; color: var(--wg-text, #374151); }

.wg-fcard-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--wg-border, #e5e7eb);
}
/* Price highlighted in a distinct green pill so it stands out at a glance */
.wg-fcard-price { display: inline-flex; align-items: baseline; gap: 6px; background: #eafaf0; padding: 5px 12px; border-radius: 999px; }
.wg-fcard-amt { font-size: 1.2rem; font-weight: 800; color: #0b8a3e; letter-spacing: -0.01em; }
.wg-fcard-per { font-size: 0.72rem; color: #4a9c6d; }
.wg-fcard-open { font-size: 0.85rem; font-weight: 700; color: var(--wg-color, #0eaf4c); white-space: nowrap; }

@media (max-width: 560px) {
  .wg-flight-row { grid-template-columns: repeat(2, 1fr); }
  .wg-fcard-amt { font-size: 1.15rem; }
}
