/* The Route panel beside the swap card. Venue rows are built and played by route.js. */

.routing {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 26rem;
  padding: 8px;
  border-radius: var(--radius-2xl);
  background: var(--surface-primary);
  box-shadow: 0 0 0 .5px var(--border-surface-strong), 0 20px 25px -5px #0000000f, 0 8px 10px -6px #0000000f;
}
.routing-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 10px 10px;
  font-size: var(--text-sm);
}
.routing-head strong { font-weight: var(--font-weight-medium); }
.replay {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: -4px -4px -4px 8px;
  align-self: center;
  border-radius: 999px;
  pointer-events: auto;
  transition: background-color .2s, scale .2s;
}
.replay:hover { background: color-mix(in oklab, var(--foreground) 6%, transparent); }
.replay:active { scale: .92; }
.replay img { width: 14px; height: 14px; opacity: .55; }
.checks-count { margin-left: auto; color: var(--muted-foreground); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }

/* Venue rows */
.venue {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 10px;
  border-radius: var(--radius-lg);
  opacity: .35;
  transition: opacity .25s, background-color .3s;
}
.venue.is-checking, .venue.is-checked { opacity: 1; }
.venue-pair { display: flex; flex-shrink: 0; }
.venue-pair img, .venue-pair .hook { width: 22px; height: 22px; font-size: 10px; }
.venue-pair .hook { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface-primary); }
.venue-name { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.venue-name strong { font-size: var(--text-sm); font-weight: var(--font-weight-medium); }
.venue-name small { color: var(--muted-foreground); font-size: var(--text-xs); }

.venue-status { font-size: var(--text-xs); font-weight: var(--font-weight-medium); white-space: nowrap; }
.venue-status b { display: none; font-weight: inherit; }
.venue .spinner { display: none; }
.venue.is-checking .spinner { display: block; }
.venue.is-checked .venue-status b { display: inline; }
.venue.is-blocked .venue-status { color: var(--color-red-600); }
.venue.is-allowed .venue-status { color: var(--color-green-600); }
/* Blocked pools get a strike drawn left to right instead of a static line-through. */
.venue-name strong {
  align-self: flex-start;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 55% / 0 1px;
  transition: background-size .4s cubic-bezier(.2, .8, .2, 1) .1s, color .3s;
}
.venue.is-checked.is-blocked strong { color: var(--muted-foreground); background-size: 100% 1px; }

/* The verdict ripples in letter by letter as the spinner resolves. */
.venue-status b span { display: inline-block; white-space: pre; }
@media (prefers-reduced-motion: no-preference) {
  .venue.is-checked .venue-status b span {
    animation: verdict-in .5s cubic-bezier(.2, .8, .2, 1) calc(var(--i) * 22ms) both;
  }
}
@keyframes verdict-in { from { opacity: 0; translate: 0 6px; filter: blur(4px); } }
.is-routed .venue.is-blocked { opacity: .5; }
.is-routed .venue.is-allowed { background: var(--color-sky-50); }

/* Final path: ETH → canonical pool → HOOK */
.path {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 4px 0;
  padding: 12px 10px;
  border-top: 1px dashed var(--border);
  opacity: 0;
  transition: opacity .3s;
}
.path img, .path .hook { width: 22px; height: 22px; font-size: 10px; }
.hop { flex: 1; border-top: 1.5px dashed var(--color-neutral-300); }
.hop-pool {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--color-sky-50);
  color: var(--brand-content);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}
.routing-note {
  padding: 0 10px 6px;
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  line-height: var(--text-xs--line-height);
  opacity: 0;
  transition: opacity .3s;
}
.routing-note code { font-family: var(--font-mono); color: var(--foreground); }
.is-routed :is(.path, .routing-note) { opacity: 1; }
