/* ==========================================================================
   Flight Result Card — Google-Flights-grade design
   ========================================================================== */

/* ---- card shell ---- */
.ag-card.ag-card--flight {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px;
  padding: 0;
  overflow: visible;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04) !important;
  transition: box-shadow .15s ease;
  position: relative;
}
.ag-card.ag-card--flight:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.08) !important;
}

/* ---- layout: three-column (logo | itinerary | price) ---- */
.ag-card--flight > .card-body {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 16px;
  padding: 20px 24px;
  align-items: center;
}

/* ---- airline column ---- */
.fc-airline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.fc-airline__logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.fc-airline__logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.fc-airline__logo-initials {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  letter-spacing: .5px;
  line-height: 1;
}
.fc-airline__code {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-align: center;
  line-height: 1.1;
  letter-spacing: .3px;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- itinerary column ---- */
.fc-itinerary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* -- one leg row -- */
.fc-leg {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fc-leg + .fc-leg {
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}
.fc-leg__label {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 2px;
}

/* -- route row: time  ···line···  time -- */
.fc-route {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fc-time {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -.02em;
}
.fc-iata {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: .5px;
}
.fc-endpoint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}

/* connector line */
.fc-connector {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  gap: 4px;
  min-width: 80px;
  position: relative;
}
.fc-connector__duration {
  grid-row: 1;
  align-self: end;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.fc-connector__track {
  grid-row: 2;
  width: 100%;
  height: 2px;
  background: #cbd5e1;
  border-radius: 1px;
  position: relative;
}
/* dots at each end of the line */
.fc-connector__track::before,
.fc-connector__track::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  transform: translateY(-50%);
}
.fc-connector__track::before { left: 0; }
.fc-connector__track::after  { right: 0; }
/* airplane icon centered on the line */
.fc-connector__plane {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.fc-connector__plane svg {
  width: 14px;
  height: 14px;
  fill: #2563eb;
  transform: rotate(90deg);
}

.fc-connector__stops {
  grid-row: 3;
  align-self: start;
  font-size: 11px;
  font-weight: 500;
  color: #ef4444;
}
.fc-connector__stops--direct {
  color: #16a34a;
}

/* meta line under the route */
.fc-meta {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.3;
}

/* ---- badges row ---- */
.fc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.fc-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.4;
}
.fc-badge--cabin   { background: #f1f5f9; color: #475569; }
.fc-badge--bags    { background: #f1f5f9; color: #475569; }
.fc-badge--refund  { background: #dcfce7; color: #15803d; }
.fc-badge--direct  { background: #eff6ff; color: #2563eb; }
.fc-badge--stops   { background: #fef2f2; color: #dc2626; }
.fc-badge--urgency { background: #fef2f2; color: #dc2626; }
.fc-badge--source  { background: #f1f5f9; color: #64748b; }

/* collapsed +more */
.fc-badges__toggle {
  background: #f1f5f9;
  color: #64748b;
  border: none;
  cursor: pointer;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
}
.fc-badges__toggle:hover { background: #e2e8f0; }
.fc-badges__overflow { display: none; }
.fc-badges__overflow.is-open { display: contents; }

/* ---- price column ---- */
.fc-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
  flex-shrink: 0;
  min-width: 120px;
  justify-content: center;
}
.fc-price__label {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.fc-price__amount {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  letter-spacing: -.03em;
}
.fc-price__pax {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}
.fc-price__note {
  font-size: 10px;
  color: #94a3b8;
  max-width: 150px;
  line-height: 1.3;
  display: none;           /* only show on hover */
}
.ag-card--flight:hover .fc-price__note {
  display: block;
}
.fc-price__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-radius: 8px;
  text-decoration: none;
  transition: opacity .15s;
  white-space: nowrap;
}
.fc-price__cta:hover {
  opacity: .9;
  color: #fff;
  text-decoration: none;
}

/* ============================================================
   RESPONSIVE — stack on mobile
   ============================================================ */
@media (max-width: 767.98px) {
  .ag-card--flight > .card-body {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  /* airline row becomes horizontal */
  .fc-airline {
    flex-direction: row;
    gap: 10px;
    align-items: center;
  }
  .fc-airline__logo { width: 36px; height: 36px; }
  .fc-airline__logo img { width: 28px; height: 28px; }

  .fc-time { font-size: 18px; }
  .fc-connector { min-width: 60px; }

  .fc-price {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
  }
  .fc-price__amount { font-size: 22px; }
  .fc-price__note { display: none !important; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .ag-card--flight, .fc-price__cta { transition: none; }
  .ag-card--flight:hover { transform: none; }
}
