/* My Trips, restyled onto the same design language as every other page.
 *
 * The page used to load style.css — a separate design system with its own
 * scale, colours and shadows — so it read as a different site. This restyles
 * the markup assets/js/my-trips.js already emits using the tokens from
 * sx-page-base.css, so nothing about that script had to change.
 *
 * Depends on sx-page-base.css for :root tokens. */

/* ---- booking list ---- */
.bookings-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.booking-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.booking-card:hover {
  border-color: var(--g300);
  box-shadow: var(--soft-shadow);
}

/* ---- header strip ---- */
.booking-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: var(--g50);
  border-bottom: 1px solid var(--border);
}
.booking-ref {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--navy-3);
}
.booking-flight-num {
  font-size: 12.5px;
  color: var(--g600);
  padding: 3px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.booking-date-created {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--g500);
}

.booking-status {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: 999px;
}
.booking-status.status-confirmed { background: #e4f5ec; color: #0d7f56; }
.booking-status.status-pending   { background: #fdf0d8; color: #8a5a0e; }
.booking-status.status-cancelled { background: var(--g100); color: var(--g500); text-decoration: line-through; }

/* ---- body: route + fare ---- */
.booking-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 22px 24px;
}

.booking-route {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}
.booking-endpoint { display: flex; flex-direction: column; gap: 2px; }
.b-iata {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.1;
  color: var(--navy-3);
}
.b-city { font-size: 12.5px; color: var(--g500); }

.booking-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--g400);
}
.b-line {
  display: block;
  width: 100%;
  min-width: 40px;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--g300) 0 4px, transparent 4px 8px);
}

.booking-info { display: flex; flex-direction: column; gap: 8px; }
.booking-info-row { display: flex; gap: 10px; align-items: baseline; }
.booking-info-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--g400);
  min-width: 74px;
}
.booking-info-value { font-size: 13.5px; color: var(--g700); }

.booking-price-col { text-align: right; white-space: nowrap; }
.booking-price-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--g400);
}
.booking-price-value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy-3);
}

/* ---- footer: passengers + toggle ---- */
.booking-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
}
.booking-passengers { display: flex; flex-wrap: wrap; gap: 6px; }
.passenger-pill {
  font-size: 12px;
  color: var(--g600);
  background: var(--g50);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}

.booking-card-actions { display: flex; align-items: center; gap: 8px; }

.btn-outline {
  font-size: 13px;
  font-weight: 600;
  color: var(--g600);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-outline:hover { border-color: var(--g300); color: var(--navy-2); }

/* Destructive, so it is visually distinct from "상세 보기" — but muted rather
   than a solid red block, since it sits next to it on every card. */
.btn-danger {
  font-size: 13px;
  font-weight: 600;
  color: #b62121;
  background: #fff;
  border: 1px solid #f0cccc;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-danger:hover { background: #fee4e4; border-color: #e3a9a9; }
.btn-danger:disabled { opacity: .55; cursor: default; background: #fff; }

/* ---- expandable detail ---- */
.booking-detail-panel {
  padding: 20px 24px;
  border-top: 1px dashed var(--border);
  background: var(--g50);
}
.booking-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 0;
}
.booking-detail-item dt,
.booking-detail-grid dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--g400);
}
.booking-detail-item dd,
.booking-detail-grid dd {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--navy-2);
}

.flight-notice-box {
  margin-top: 16px;
  padding: 14px 16px;
  background: #fdf0d8;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #8a5a0e;
}
.flight-notice-box strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-weight: 700;
}

/* ---- states ---- */
/* auth.js reveals #auth-gate by setting `display: flex` inline, which wins over
   any display set here — so these have to read correctly as a flex container.
   Stacking and centring explicitly keeps the icon, heading, copy and button in
   a column instead of strung across one row. */
.empty-state,
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
}
.empty-state h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-3);
}
.empty-state p,
.loading-state p { margin: 0; font-size: 14px; color: var(--g500); }

.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--g100);
  color: var(--g500);
}

.spinner {
  width: 30px;
  height: 30px;
  margin: 0 auto 14px;
  border: 3px solid var(--g200);
  border-top-color: var(--navy-1);
  border-radius: 50%;
  animation: sx-spin .7s linear infinite;
}
@keyframes sx-spin { to { transform: rotate(360deg); } }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  background: var(--navy-2);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: var(--navy-hover); }

.msg-alert {
  padding: 16px 18px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
}
.msg-error { background: #fee4e4; color: #b62121; }

/* ---- narrow screens ---- */
@media (max-width: 900px) {
  .booking-card-body { grid-template-columns: 1fr; gap: 20px; }
  .booking-price-col { text-align: left; }
}
@media (max-width: 560px) {
  .booking-card-header,
  .booking-card-body,
  .booking-card-footer,
  .booking-detail-panel { padding-left: 18px; padding-right: 18px; }
  .booking-date-created { margin-left: 0; width: 100%; }
  .b-iata { font-size: 22px; }
}
