/* Tour Legs Sidebar Styles */

.map-container {
  position: relative;
}

.tour-legs-sidebar {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 1rem auto;
  max-height: 180px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
  border-radius: 12px;
}

.tour-legs-sidebar.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.tour-legs-sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--primary-color);
  color: white;
}

.tour-legs-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tour-legs-scroll-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-weight: 600;
}

.tour-legs-scroll-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.tour-legs-scroll-btn:active {
  background: rgba(255, 255, 255, 0.4);
}

.tour-legs-scroll-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.tour-legs-sidebar-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: white;
}

.toggle-sidebar-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.toggle-sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.tour-legs-list {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  position: relative;
}

.tour-leg-item {
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  position: relative;
  min-width: 120px;
  flex-shrink: 0;
  text-align: center;
}

/* Train stop circle */
.tour-leg-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--border);
  z-index: 2;
  transition: all 0.2s;
}

/* Connecting line between stops */
.tour-leg-item::after {
  content: '';
  position: absolute;
  top: 5px;
  left: calc(50% + 6px);
  width: calc(100% - 12px);
  height: 2px;
  background: var(--border);
  z-index: 1;
}

/* Remove line after last item */
.tour-leg-item:last-child::after {
  display: none;
}

.tour-leg-item:hover {
  background: var(--background);
}

.tour-leg-item:hover::before {
  background: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-color);
  transform: translateX(-50%) scale(1.2);
}

.tour-leg-item.active {
  font-weight: 500;
}

.tour-leg-item.active::before {
  background: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-color);
  transform: translateX(-50%) scale(1.3);
}

.tour-leg-item.active::after {
  background: var(--primary-color);
}

.tour-leg-name {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-top: 0.5rem;
  margin-bottom: 0.125rem;
  white-space: nowrap;
}

.tour-leg-item.active .tour-leg-name {
  color: var(--primary-color);
  font-weight: 600;
}

.tour-leg-date-range {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 0.125rem;
  white-space: nowrap;
}

.tour-leg-item.active .tour-leg-date-range {
  color: var(--primary-color);
  font-weight: 500;
}

.tour-leg-count {
  font-size: 0.65rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.tour-leg-item.active .tour-leg-count {
  color: var(--primary-color);
  font-weight: 500;
}

.no-tour-legs,
.loading {
  padding: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* No need to adjust map position since sidebar is above it */

/* Responsive: adjust sidebar on small screens */
@media (max-width: 768px) {
  .tour-legs-sidebar {
    max-height: 250px;
  }
}

