/* Custom crawl route: drag-reorder list and bar-chip grids (start/skip/select) */

.bar-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.bar-chip {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.42rem 0.8rem;
  background: rgba(var(--c), 0.045);
  border: 1px solid rgba(var(--c), 0.12);
  border-radius: 999px;
  color: rgba(var(--c), 0.7);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.bar-chip:active {
  transform: scale(0.95);
}

@media (hover: hover) {
  .bar-chip:hover {
    background: rgba(var(--c), 0.09);
    color: rgba(var(--c), 0.92);
    border-color: rgba(var(--c), 0.24);
  }

  .bar-chip.selected:hover {
    background: rgba(var(--a), 0.24);
  }
}

.bar-chip.selected {
  background: rgba(var(--a), 0.16);
  border-color: rgba(var(--a), 0.55);
  color: rgba(var(--a), 0.95);
}

/* Excluded from auto routes (nearest/random/near) — red strikethrough */
.bar-chip.excluded {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: rgba(239, 68, 68, 0.85);
  text-decoration: line-through;
}

@media (hover: hover) {
  .bar-chip.excluded:hover {
    background: rgba(239, 68, 68, 0.18);
    color: rgba(239, 68, 68, 1);
  }
}

.custom-route-selected {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.custom-route-empty {
  font-size: 0.86rem;
  color: rgba(var(--c), 0.45);
  font-style: italic;
  padding: 0.2rem 0;
}

.custom-route-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  background: rgba(var(--c), 0.05);
  border-radius: 0.5rem;
  animation: fadeIn 0.15s ease;
  transition: transform 0.15s ease, background 0.15s ease;
  position: relative;
}

.custom-route-item.dragging {
  transition: none;
  z-index: 5;
  background: rgba(var(--a), 0.16);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.custom-route-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  color: rgba(var(--a), 0.8);
  min-width: 1.4rem;
  text-align: center;
  flex-shrink: 0;
}

.custom-route-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(var(--c), 0.92);
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-route-count {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(var(--a), 0.7);
}

.custom-route-controls {
  display: flex;
  gap: 0.15rem;
  flex-shrink: 0;
}

.custom-route-handle {
  background: transparent;
  border: none;
  color: rgba(var(--c), 0.4);
  font-size: 1.2rem;
  line-height: 1;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.4rem;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  touch-action: none;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

@media (hover: hover) {
  .custom-route-handle:hover {
    background: rgba(var(--c), 0.09);
    color: rgba(var(--c), 0.9);
  }
}

.custom-route-handle:active,
.custom-route-item.dragging .custom-route-handle {
  cursor: grabbing;
  background: rgba(var(--c), 0.09);
  color: rgba(var(--c), 0.9);
  transform: scale(0.9);
}

.custom-route-handle:focus-visible {
  outline: 2px solid rgba(var(--a), 0.6);
  outline-offset: 1px;
}

.custom-route-remove {
  background: transparent;
  border: none;
  color: rgba(var(--c), 0.3);
  font-size: 1.2rem;
  line-height: 1;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  touch-action: manipulation;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

@media (hover: hover) {
  .custom-route-remove:hover {
    color: rgba(239, 68, 68, 0.85);
    background: rgba(239, 68, 68, 0.08);
  }
}

.custom-route-remove:active {
  color: rgba(239, 68, 68, 0.85);
  background: rgba(239, 68, 68, 0.08);
  transform: scale(0.88);
}

/* Start pressed with an empty custom route */
@keyframes customShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.custom-picker-shake {
  animation: customShake 0.45s ease;
}
