.TrailProgress {
  margin: 0.25rem 0 0.5rem;
}

.TrailProgress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Invisible spacer to balance layout when one button is missing */
.TrailProgress-spacer {
  visibility: hidden;
  font-size: 0.6875rem;
  line-height: 1;
  white-space: nowrap;
}

/* Mobile: center when completed (no buttons) */
@media (max-width: 768px) {
  .TrailProgress-row--completed {
    justify-content: center;
  }
}

.TrailProgress-path {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  flex: 1 1 0;
  justify-content: center;
}

.TrailProgress-nodeWrapper {
  display: flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
}

.TrailProgress-node {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    box-shadow 0.2s ease;
  position: relative;
  flex-shrink: 0;
  /* Reset button styles */
  padding: 0;
  border: none;
  background: none;
  font: inherit;
}

.TrailProgress-node--clickable {
  cursor: pointer;
}

@media (max-width: 768px) {
  .TrailProgress-node--clickable::after {
    content: "";
    position: absolute;
    inset: -12px;
  }
}

@media (hover: hover) {
  .TrailProgress-node--clickable:hover {
    transform: scale(1.2);
  }
}

.TrailProgress-node--clickable:active {
  transform: scale(1.3);
  transition-duration: 0.1s;
}

.TrailProgress-node:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.TrailProgress-node--upcoming {
  background-color: rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  .TrailProgress-node--upcoming {
    background-color: rgba(255, 255, 255, 0.15);
  }
}

.TrailProgress-node--current {
  background-color: var(--accent-color);
  transform: scale(1.2);
  box-shadow: 0 0 0 4px var(--accent-color-transparent);
  animation: progressPulse 3s ease-in-out infinite;
  filter: var(--user-content-filter);
}

@keyframes progressPulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px var(--accent-color-transparent);
  }
  50% {
    box-shadow: 0 0 0 6px var(--accent-color-transparent);
  }
}

@media (hover: hover) {
  .TrailProgress-node--current.TrailProgress-node--clickable:hover {
    transform: scale(1.4);
  }
}

.TrailProgress-node--completed {
  background-color: var(--accent-color);
  opacity: 0.6;
  filter: var(--user-content-filter);
}

.TrailProgress-node--visited {
  background-color: var(--accent-color);
  opacity: 0.4;
  filter: var(--user-content-filter);
}

@media (hover: hover) {
  .TrailProgress-node--visited.TrailProgress-node--clickable:hover {
    transform: scale(1.2);
    opacity: 0.7;
  }
}

.TrailProgress-line {
  width: 14px;
  min-width: 2px;
  height: 2px;
  background-color: rgba(0, 0, 0, 0.08);
  margin: 0 1px;
  flex-shrink: 1;
}

@media (prefers-color-scheme: dark) {
  .TrailProgress-line {
    background-color: rgba(255, 255, 255, 0.15);
  }
}

.TrailProgress-statusWalking {
  color: var(--text-secondary);
  text-transform: lowercase;
  font-size: 0.6875rem;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  padding: 0.5rem 0;
  transition:
    color 0.2s ease,
    text-decoration 0.2s ease,
    filter 0.2s ease;
}

@media (hover: hover) {
  .TrailProgress-statusWalking:hover {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-color: var(--accent-color);
    filter: var(--user-content-filter);
  }
}

.TrailProgress-statusWalking:active {
  color: var(--accent-color);
  transition-duration: 0.05s;
}

.TrailProgress-statusLeave {
  font-size: 0.6875rem;
}

/* Tablet and desktop enhancements */
@media (min-width: 481px) {
  .TrailProgress-node {
    width: 10px;
    height: 10px;
  }

  .TrailProgress-line {
    width: 18px;
    min-width: 3px;
    margin: 0 2px;
  }
}

@media (min-width: 769px) {
  .TrailProgress-row {
    justify-content: center;
    gap: 2rem;
  }

  .TrailProgress-path {
    flex: 0 1 auto;
  }

  .TrailProgress-node {
    width: 12px;
    height: 12px;
  }

  .TrailProgress-node--current {
    transform: scale(1.3);
  }

  .TrailProgress-line {
    width: 24px;
    min-width: 4px;
    margin: 0 3px;
  }

  .TrailProgress-statusWalking,
  .TrailProgress-statusLeave,
  .TrailProgress-spacer {
    font-size: 0.75rem;
  }
}
