/* ============================================================
   VIEW: TRADE ROUTES
   ============================================================ */

/* Configurator panel */
.tr-configurator {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--orange);
  margin-bottom: 14px;
  padding: 16px 18px;
  position: relative;
}
.tr-configurator::before {
  content: '// CONFIG';
  position: absolute;
  top: 0;                     /* badge bottom sedi presne na orange line top */
  left: 16px;
  transform: translateY(-100%);
  font-family: var(--f-mono);
  font-size: 0.625rem;
  color: var(--orange);
  letter-spacing: 0.12em;
  background: var(--bg-panel);
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-bottom: none;
}
.tr-config-hd {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.tr-config-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-strong);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tr-config-sub {
  margin-top: 2px;
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  color: var(--text-mute);
}

.tr-config-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;       /* labels aligned at bottom — controls row matches */
}
.tr-row--actions {
  justify-content: flex-end;
  margin-top: 4px;
  align-items: center;
}
.tr-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.tr-field--full   { flex: 1 1 100%; }
.tr-field--ship   { width: 280px; }
.tr-field--invest { width: 160px; }
.tr-field--dist   { width: 120px; }

/* Pill button groups — replaces native checkbox/radio/select for SC aesthetic */
.tr-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}
/* Force-break pill onto its own row (= "Doesn't matter" sits below specifics) */
.tr-pill--break { flex-basis: 100%; max-width: max-content; }
.tr-pill {
  padding: 7px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--line-bright);
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--text-mute);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color var(--t), background var(--t), border-color var(--t);
  white-space: nowrap;
  text-transform: uppercase;
}
.tr-pill:hover {
  color: var(--text-strong);
  border-color: var(--orange-dim);
}
.tr-pill.is-active {
  background: var(--orange-ghost);
  border-color: var(--orange);
  color: var(--orange);
  font-weight: 600;
}
.tr-pill.is-active:hover {
  background: var(--orange);
  color: var(--bg-base);
}

/* Filter chips strip (after search) */
.tr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.tr-chip {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  color: var(--text);
  letter-spacing: 0.04em;
}

/* Result state container */
.tr-state { padding: 24px 0; }

/* Container size badge in table */
.tr-cs {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 0.625rem;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}

/* Flag badges (M/S/D/F) — terminal capability indicators */
.tr-flag {
  display: inline-block;
  width: 14px;
  height: 14px;
  text-align: center;
  line-height: 14px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  font-family: var(--f-mono);
  font-size: 0.5625rem;
  color: var(--text-mute);
  margin-right: 1px;
  cursor: help;
}
.tr-flag--ok { color: var(--green-cta); border-color: var(--green-cta); }

/* Sortable column headers in routes table */
#trTable thead th.tr-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
#trTable thead th.tr-sortable:hover { background: var(--orange-ghost); color: var(--orange); }
#trTable thead th.tr-sorted { color: var(--orange); }
.tr-sort {
  margin-left: 4px;
  color: var(--orange);
  font-weight: 700;
}

/* Limited-by warning glyph in SCU column */
.tr-limit { color: var(--orange); cursor: help; }

/* Stock available indicator — sekundarni cislo "/STOCK" za __load v SCU sloupci */
.tr-stock { color: var(--text-dim); font-size: 0.75em; margin-left: 1px; }

/* Favorite star button — auth-gated, click toggluje user favorite. Click guest -> login modal. */
.tr-fav-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-mute);
  padding: 2px 4px;
  transition: color var(--t), transform var(--t);
}
.tr-fav-btn:hover { color: var(--orange); transform: scale(1.1); }
.tr-fav-btn.is-fav { color: var(--orange); }

/* "Local" suborbital indicator — intra-body trasa bez QT (distance=0).
   Misto pomlcky v ETA sloupci ukazuje orbit icon + "Local" text. */
.tr-local {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-mute);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  cursor: help;
}
.tr-local svg { width: 12px; height: 12px; flex-shrink: 0; }

/* Loading state — pulsing text aby bylo videt ze neco bezi */
.tr-loading {
  color: var(--orange);
  animation: tr-pulse 1.4s ease-in-out infinite;
  font-family: var(--f-mono);
  letter-spacing: 0.06em;
}
@keyframes tr-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* External UEX deep links — subtle underline on hover, no garish blue */
.tr-uex-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color var(--t), border-color var(--t);
}
.tr-uex-link:hover {
  color: var(--orange);
  border-bottom-color: var(--orange);
}
.tr-uex-link:visited { color: inherit; }
.tr-uex-link:visited:hover { color: var(--orange); }

/* Mobile — full width fields below 700 */
@media (max-width: 700px) {
  .tr-row { gap: 10px; }
  .tr-field--ship, .tr-field--invest, .tr-field--dist { width: 100%; }
  .tr-row--actions { flex-direction: column; align-items: stretch; }
  .tr-row--actions .btn { width: 100%; }
}
