:root {
  --primary-color: #0d6efd;
  --primary-light: rgba(13, 110, 253, 0.1);
  --dark-color: #212529;
  --text-color: #6c757d;
}

/* Particles Background */
#particles-js {
  /* fallback: keep ID selector but scoped rules below override when inside .journey-section */
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
  background-color: #f8f9fa;
}

/* Ensure the journey section confines the particles canvas */
.journey-section {
  position: relative; /* create stacking context for absolute #particles-js */
  overflow: hidden;   /* prevent particles from overflowing into other sections */
}

.journey-section #particles-js {
  position: absolute;
  inset: 0; /* top:0; right:0; bottom:0; left:0 */
  width: 100%;
  height: 100%;
  z-index: 0;
  background-color: #f8f9fa;
  pointer-events: none; /* allow interactions to pass through to timeline */
}

.content-wrapper {
  position: relative;
  z-index: 1;
}

.header-section {
  text-align: center;
  margin-top: 3rem;
  color: var(--primary-color);
}

.timeline-wrapper {
  position: relative;
  padding: 2rem 0 15rem;
}

.timeline-vertical-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 6px;
  background-color: var(--primary-light);
  transform: translateX(-50%);
  border-radius: 3px;
}

.timeline-vertical-progress {
  position: absolute;
  top: 0;
  left: 50%;
  width: 6px;
  background-color: var(--primary-color);
  transform: translateX(-50%);
  border-radius: 3px;
  height: 0;
  transition: height 0.5s ease;
}

.timeline-item {
  position: relative;
  margin-bottom: -15rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: white;
  border: 3px solid var(--primary-color);
  z-index: 1;
  transition: all 0.3s ease;
}

.timeline-item.active .timeline-dot {
  background-color: var(--primary-color);
  transform: translate(-50%, -50%) scale(1.3);
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.3);
}

.timeline-year {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--primary-color);
  transition: all 0.3s ease;
  cursor: pointer;
}

.timeline-item:nth-child(odd) .timeline-year {
  right: 55%;
  text-align: right;
}

.timeline-item:nth-child(even) .timeline-year {
  left: 55%;
  text-align: left;
}

.timeline-item.active .timeline-year {
  font-size: 1.5rem;
}

.timeline-content-card {
  position: relative;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.9);
}

.timeline-content-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.timeline-item:nth-child(odd) .timeline-content {
  padding-right: 2rem;
  text-align: right;
}

.timeline-item:nth-child(even) .timeline-content {
  padding-left: 2rem;
  text-align: left;
}

.timeline-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.timeline-item:nth-child(odd) .card-content {
  padding: 1.5rem 2rem 1.5rem 1.5rem;
}

.timeline-item:nth-child(even) .card-content {
  padding: 1.5rem 1.5rem 1.5rem 2rem;
}

.timeline-title {
  color: var(--dark-color);
  margin-bottom: 1rem;
}

.timeline-description {
  color: var(--text-color);
  margin-bottom: 0;
}

.lottie-container {
  width: 120px;
  height: 120px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timeline-item.active .lottie-container {
  opacity: 1;
}

.timeline-connector {
  position: absolute;
  top: 50%;
  width: 50px;
  height: 3px;
  background-color: var(--primary-color);
}

.timeline-item:nth-child(odd) .timeline-connector {
  right: 50%;
  transform: translateY(-50%);
}

.timeline-item:nth-child(even) .timeline-connector {
  left: 50%;
  transform: translateY(-50%);
}

@media (max-width: 767.98px) {
  .timeline-vertical-line,
  .timeline-vertical-progress {
    left: 2rem;
  }

  .timeline-dot,
  .timeline-item.active .timeline-dot {
    left: 2rem;
  }

  .timeline-item:nth-child(odd) .timeline-year,
  .timeline-item:nth-child(even) .timeline-year {
    left: 4rem;
    right: auto;
    text-align: left;
  }

  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-item:nth-child(even) .timeline-content {
    padding-left: 6rem;
    padding-right: 0;
    text-align: left;
  }

  .timeline-item:nth-child(odd) .timeline-connector,
  .timeline-item:nth-child(even) .timeline-connector {
    left: 2rem;
    right: auto;
    width: 2rem;
  }

  .lottie-container {
    left: 2rem;
    width: 80px;
    height: 80px;
  }
}
