/* === ADVENTURE TRAIL === */
/* Replaces the old progress bar with a journey map */

#adventure-trail {
  position: relative;
  height: 60px;
  margin: 4px 0;
  overflow: visible;
}

/* The winding path - dotted golden trail */
.trail-path {
  position: absolute;
  top: 50%;
  left: 5%;
  right: 5%;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--storybook-gold-muted) 0px,
    var(--storybook-gold-muted) 8px,
    transparent 8px,
    transparent 16px
  );
  transform: translateY(-50%);
  border-radius: 2px;
}

/* Trail stops container */
.trail-stops {
  position: absolute;
  top: 50%;
  left: 5%;
  right: 5%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
}

/* Individual stop - circular clearing */
.trail-stop {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--storybook-cream);
  border: 2px solid var(--storybook-gold-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.trail-stop img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Completed stop - green with checkmark */
.trail-stop.completed {
  background: linear-gradient(135deg, #5e8c31, #4a7024);
  border-color: #5e8c31;
}

.trail-stop.completed::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.trail-stop.completed img {
  opacity: 0;
}

/* Current stop - pulsing gold glow */
.trail-stop.current {
  border-color: var(--storybook-gold-highlight);
  box-shadow:
    0 0 0 4px rgba(255, 215, 0, 0.3),
    0 0 20px rgba(255, 215, 0, 0.5);
  animation: stopPulse 1.5s ease-in-out infinite;
  transform: scale(1.1);
  z-index: 5;
}

@keyframes stopPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 4px rgba(255, 215, 0, 0.3),
      0 0 20px rgba(255, 215, 0, 0.5);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(255, 215, 0, 0.2),
      0 0 30px rgba(255, 215, 0, 0.6);
  }
}

/* Future stops - faded out */
.trail-stop.future {
  opacity: 0.5;
  filter: grayscale(50%);
}

/* Player character on trail */
.trail-player {
  position: absolute;
  width: 40px;
  height: 40px;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
  pointer-events: none;
}

.trail-player img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  animation: playerBob 1s ease-in-out infinite;
}

@keyframes playerBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Mobile: horizontal scroll */
@media (max-width: 480px) {
  #adventure-trail {
    height: 60px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #adventure-trail::-webkit-scrollbar {
    display: none;
  }

  .trail-path {
    left: 20px;
    right: 20px;
    min-width: 450px;
  }

  .trail-stops {
    min-width: 450px;
    left: 20px;
    right: 20px;
    padding: 0;
  }

  .trail-stop {
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-width: 2px;
  }

  .trail-stop img {
    width: 22px;
    height: 22px;
  }

  .trail-stop.completed::after {
    font-size: 18px;
  }

  .trail-player {
    width: 40px;
    height: 40px;
  }
}
