/* Filterable combobox — a text input over a listbox (a magnifier, a caret
   that flips while open, hover/active/selected rows, a no-match fallback),
   styled to the dark EVE palette via the app's design tokens.
   The class hooks are required by assets/combo.js. Shared by the jump route
   calculator and the station catalog. */
.route-combo { position: relative; }

.route-combo .route-combo-input {
  width: 100%;
  padding: 0.625rem 2.5rem;
  background-color: var(--color-eve-900, #1a1a1a);
  color: #e5e7eb;
  border: 1px solid var(--color-eve-700, #333333);
  border-radius: 0.6rem;
  font-family: var(--font-sans, "Inter", -apple-system, sans-serif);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  /* A magnifier on the left; room for the caret on the right. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.875rem center;
}

/* Select-only variant (jump level / optimise for, marked data-select-only
   and .route-combo--select by combo.js): the value is picked from the
   listbox, never typed, so the search magnifier is dropped. Kept after
   the base rule on purpose — equal specificity, last one wins. */
.route-combo--select .route-combo-input { background-image: none; }
.route-combo .route-combo-input::placeholder { color: #8a8f98; }
.route-combo .route-combo-input:disabled { opacity: 0.55; cursor: not-allowed; }
.route-combo .route-combo-input:focus {
  outline: none;
  border-color: var(--color-eve-primary, #00ceef);
  box-shadow: 0 0 0 3px rgba(0, 206, 239, 0.18);
}

/* Caret on the right; flips to a close chevron while the listbox is open
   (driven by the input's aria-expanded, so no extra state is needed). */
.route-combo::after {
  content: "";
  position: absolute;
  right: 0.875rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid #8a8f98;
  border-bottom: 2px solid #8a8f98;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.15s ease, border-color 0.15s ease;
  pointer-events: none;
}
.route-combo:has(.route-combo-input[aria-expanded="true"])::after {
  transform: translateY(-30%) rotate(-135deg);
  border-color: var(--color-eve-primary, #00ceef);
}

/* The listbox popup. */
.route-combo-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 0.375rem;
  padding: 0.25rem;
  max-height: 340px;
  overflow-y: auto;
  background: var(--color-eve-800, #262626);
  border: 1px solid var(--color-eve-700, #333333);
  border-radius: 0.75rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  list-style: none;
}

/* Option rows. */
.route-combo-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #d8d8dc;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: var(--font-sans, "Inter", -apple-system, sans-serif);
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s ease, color 0.1s ease;
}
.route-combo-item:hover {
  background: rgba(0, 206, 239, 0.10);
}
.route-combo-item.is-active {
  background: rgba(0, 206, 239, 0.16);
  color: var(--color-eve-primary, #00ceef);
}
.route-combo-item.is-selected {
  color: var(--color-eve-gold, #ffd700);
}

/* A gold check marks the committed selection. */
.route-combo-item.is-selected::after {
  content: "\2713";
  margin-left: auto;
  padding-left: 0.5rem;
  color: var(--color-eve-gold, #ffd700);
  font-size: 0.8rem;
}

/* No-match fallback. */
.route-combo-empty {
  color: #8a8f98;
  padding: 0.625rem 0.75rem;
  font-size: 0.8rem;
  font-style: italic;
  cursor: default;
  text-align: center;
}
