/* Gentle in-flight bobbing for the progress plane. */
@keyframes plane-bob {
  0%, 100% { margin-top: -2px; }
  50%      { margin-top: 2px; }
}
.plane-bob {
  animation: plane-bob 1.6s ease-in-out infinite;
}

/* Alpine cloak: hide x-show elements until Alpine boots. */
[x-cloak] { display: none !important; }

/* Instant custom tooltip on any element carrying data-tip. Native title=""
   waits about a second before appearing, which is too slow for something a
   reader scans across a table. Shows on hover or keyboard focus.
   The tooltip itself is a single fixed-position div injected by JS at body
   level so it is never clipped by overflow:auto table containers. */

/* Small "?" marker for explanations attached to a label. */
.hint-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 9999px;
  border: 1px solid #cbd5e1; /* slate-300 */
  color: #94a3b8;            /* slate-400 */
  font-size: 9px;
  line-height: 1;
  vertical-align: 1px;
  user-select: none;
}
.hint-badge:hover,
.hint-badge:focus-visible {
  border-color: #38bdf8; /* sky-400 */
  color: #0284c7;        /* sky-600 */
  outline: none;
}

/* Value that carries its own explanation: dotted underline as the cue, and a
   default cursor because nothing here is clickable — a pointer would promise
   an action that does not exist. */
.tip-underline {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: #cbd5e1; /* slate-300 */
  text-underline-offset: 4px;
  cursor: default;
}
.tip-underline:focus-visible {
  outline: none;
  text-decoration-color: #38bdf8; /* sky-400 */
}

/* Column header carrying a definition. A lighter cue than .tip-underline: the
   header row is already dense and nearly every column has one, so a rule at
   cell strength would read as noise rather than as an affordance. */
.tip-header {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: #e2e8f0; /* slate-200 */
  text-underline-offset: 3px;
  cursor: help;
}
.tip-header:hover,
.tip-header:focus-visible {
  text-decoration-color: #38bdf8; /* sky-400 */
  color: #64748b;                 /* slate-500 */
  outline: none;
}

/* What one row of a section is — route, trip, itinerary, airline, search.
   Sits beside the heading and stays quiet: it is there to be checked when the
   reader is unsure, not to compete with the title. */
.grain-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid #e2e8f0; /* slate-200 */
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #94a3b8;            /* slate-400 */
  vertical-align: 1px;
  cursor: help;
  user-select: none;
}
.grain-chip:hover,
.grain-chip:focus-visible {
  border-color: #bae6fd; /* sky-200 */
  color: #0284c7;        /* sky-600 */
  outline: none;
}

/* A verdict card that filters the table below to its own rows. */
.verdict-jump {
  display: block;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.verdict-jump:focus-visible {
  outline: 2px solid #38bdf8; /* sky-400 */
  outline-offset: 2px;
}
.verdict-jump:hover {
  border-color: #7dd3fc; /* sky-300 */
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Tooltip popup — a single fixed div injected by JS at body level.
   position:fixed escapes every overflow:auto scroll container. */
#tip-popup {
  position: fixed;
  max-width: 220px;
  padding: 6px 9px;
  border-radius: 6px;
  background: #1e293b; /* slate-800 */
  color: #f1f5f9;      /* slate-100 */
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: pre-line;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
}
#tip-popup.is-visible {
  opacity: 1;
  visibility: visible;
}

/* --- scan progress: plane in flight ---------------------------------- */

/* A hint of sky behind the flight path, fading to the card's white. */
.plane-card {
  background: linear-gradient(180deg, #f6fbff 0%, #ffffff 60%);
}

/* Contrail: brightest at the plane and fading out behind it, so the shape
   reads as something left in the air rather than a filled progress bar. */
.plane-trail {
  height: 3px;
  border-radius: 9999px;
  background: linear-gradient(90deg,
    rgba(56, 189, 248, 0) 0%,
    rgba(56, 189, 248, 0.4) 38%,
    rgba(56, 189, 248, 1) 100%);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  transition: width 1s linear, background 0.6s ease, box-shadow 0.6s ease;
}
.plane-trail.is-done {
  background: linear-gradient(90deg,
    rgba(16, 185, 129, 0) 0%,
    rgba(16, 185, 129, 0.4) 38%,
    rgba(16, 185, 129, 1) 100%);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.plane-trail.is-failed {
  background: linear-gradient(90deg,
    rgba(244, 63, 94, 0) 0%,
    rgba(244, 63, 94, 0.35) 38%,
    rgba(244, 63, 94, 0.9) 100%);
  box-shadow: none;
}

/* The percentage travels with the plane instead of sitting in the caption,
   so the number is always where the eye already is. */
.plane-pct {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 3px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #94a3b8;
  white-space: nowrap;
}

/* Clouds drift backwards past the plane. The plane's own travel is slow
   enough to read as static second to second; the drift is what sells motion. */
.plane-clouds {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.plane-clouds .cloud {
  position: absolute;
  left: 100%;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.14);
  opacity: 0;
}
.plane-clouds.is-flying .cloud {
  opacity: 1;
  animation-name: cloud-drift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.plane-clouds .cloud-1 { width: 56px; height: 10px; top: 20%; animation-duration: 7.5s; }
.plane-clouds .cloud-2 { width: 32px; height: 7px;  top: 58%; animation-duration: 9.5s;  animation-delay: -3.5s; }
.plane-clouds .cloud-3 { width: 74px; height: 12px; top: 82%; animation-duration: 12s;   animation-delay: -7s; }
@keyframes cloud-drift {
  from { left: 100%; }
  to   { left: -30%; }
}

/* One ring at touchdown, then done — a loop would keep pulling the eye back
   to a finished run. */
.landing-pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 9999px;
  border: 2px solid #10b981;
  animation: landing-ring 1.5s ease-out 2 both;
  pointer-events: none;
}
@keyframes landing-ring {
  from { transform: scale(1);   opacity: 0.65; }
  to   { transform: scale(3.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .plane-bob,
  .plane-clouds.is-flying .cloud,
  .landing-pulse {
    animation: none;
  }
  .plane-trail { transition: none; }
}

/* Offer count with a magnitude bar behind it. Two runs of 244 and 39,200
   offers are otherwise two similar-looking numbers in a column; the bar makes
   the difference between a probe and a full sweep readable without reading.
   Scaled to the largest run on the page, so it ranks rows rather than
   claiming an absolute meaning. */
.offer-cell {
  position: relative;
  display: inline-block;
  width: 120px;
  padding-bottom: 6px;
  text-align: right;
}
/* A rule under the number rather than a fill behind it: a tint behind the
   digits reads as a selection highlight, and at small widths it looks like one
   digit has been marked. */
.offer-bar {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 9999px;
  background: #7dd3fc; /* sky-300 */
}
