.horizontal-timeline-wrapper {
  position: relative;
  overflow: hidden;
  padding: 40px 0;
  width: 100%;
}

.horizontal-timeline-container {
  display: flex;
  align-items: center;
  position: relative;
  overflow: visible;
  padding: 0;
  transition: transform 0.5s ease;
  will-change: transform;
  min-height: 450px;
}

.timeline-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
      #5cdb94 0%,
      #3498db 25%,
      #9b59b6 50%,
      #e67e22 75%,
      #e74c3c 100%);
  z-index: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-50%);
}

.timeline-event-item {
  position: relative;
  flex-shrink: 0;
  width: 280px;
  margin: 0 35px;
  z-index: 5;
}

.timeline-event-item:first-child {
  margin-left: 50px;
}

.timeline-event-item:last-child {
  margin-right: 50px;
}

/* Timeline Node (Circle) - Always centered on line */
.timeline-node {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  border: 4px solid white;
}

.timeline-event-item:hover .timeline-node {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.35);
}

.timeline-node.bg-green {
  background: linear-gradient(135deg, #5cdb94 0%, #4CAF50 100%);
}

.timeline-node.bg-blue {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.timeline-node.bg-orange {
  background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

.timeline-node.bg-purple {
  background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.timeline-node.bg-teal {
  background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
}

.timeline-node.bg-red {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* Timeline Card */
.timeline-card {
  width: 100%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  padding: 20px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.timeline-event-item:hover .timeline-card {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  transform: translateY(-5px);
}

/* Cards above the line (even index) */
.timeline-card.position-top {
  bottom: calc(50% + 50px);
}

.timeline-card.position-top::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-top-color: white;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

/* Cards below the line (odd index) */
.timeline-card.position-bottom {
  top: calc(50% + 50px);
}

.timeline-card.position-bottom::after {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-bottom-color: white;
  filter: drop-shadow(0 -2px 3px rgba(0, 0, 0, 0.1));
}

.timeline-event-item:hover .timeline-card.position-top {
  transform: translateY(-10px);
}

.timeline-event-item:hover .timeline-card.position-bottom {
  transform: translateY(5px);
}

.card-step {
  font-size: 10px;
  color: #999;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.card-date {
  font-size: 11px;
  color: #666;
  font-weight: 600;
  margin-bottom: 10px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i {
  font-size: 18px;
}

.card-description {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

.card-details {
  border-top: 1px solid #f0f0f0;
}

.detail-item {
  font-size: 12px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 6px;
}

.detail-item:last-child {
  margin-bottom: 0;
}

.detail-item strong {
  color: #333;
  font-weight: 600;
}

.detail-item .label {
  font-size: 11px;
  padding: 4px 8px;
  margin-top: 4px;
  display: inline-block;
}

.card-border-left {
  border-left: 4px solid #5cdb94;
}

.card-border-left.blue {
  border-left-color: #3498db;
}

.card-border-left.orange {
  border-left-color: #e67e22;
}

.card-border-left.purple {
  border-left-color: #9b59b6;
}

.card-border-left.teal {
  border-left-color: #1abc9c;
}

.card-border-left.red {
  border-left-color: #e74c3c;
}

.card-border-left.green {
  border-left-color: #5cdb94;
}

.timeline-navigation {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

.timeline-nav-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #5cdb94;
  background: white;
  color: #5cdb94;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(92, 219, 148, 0.2);
}

.timeline-nav-btn:hover:not(:disabled) {
  background: #5cdb94;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(92, 219, 148, 0.4);
}

.timeline-nav-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.timeline-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: #ccc;
  color: #ccc;
}

@media (max-width: 768px) {


  /* --- 2. Set up the wrapper for native scrolling --- */


  /* --- 3. Make each event item full-width --- */
  .timeline-event-item {
    /* Each item takes 100% of the wrapper's width */
    width: 100%;

    /* Tell the scroller to snap to the center of this item */
    scroll-snap-align: center;

    /* Remove horizontal margins */
    margin: 0;
  }

  /* Remove the special margins from the original code */
  .timeline-event-item:first-child,
  .timeline-event-item:last-child {
    margin: 0;
  }

  /* --- 4. Make cards mobile-friendly --- */

  /* Adjust the container height for a tighter view */
  .horizontal-timeline-container {
    min-height: 40vh;
  }

  /* Make the card narrower with side margins */
  .timeline-card {
    padding: 15px;
    margin: 0px 15px;
    /* Add 15px margins on left/right */
    width: auto;
    /* Let it fill the space between margins */
    left: 0;
    right: 0;
  }

  /* Force ALL cards to be at the bottom */
  .timeline-card.position-top,
  .timeline-card.position-bottom {
    top: calc(50% + 40px);
    /* Move them all below the line */
    bottom: auto;
    /* Unset any 'bottom' property */
    transform: none;
    /* Reset any hover effects */
  }

  /* Force ALL card triangles to point UP */
  .timeline-card.position-bottom::after,
  .timeline-card.position-top::after {
    /* Override the .position-top rule */
    content: '';
    position: absolute;
    top: -20px;
    /* Position at the top of the card */
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-bottom-color: white;
    /* Always point up */
    bottom: auto;
    /* Resets the original 'bottom: -20px' */
    border-top-color: transparent;
  }
  
  .timeline-node {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
}
