.timeline {
  position: relative;
  max-width: 1200px;
  margin: 40px auto;
}

/* The actual timeline (the vertical ruler) */
.timeline::after {
  content: "";
  position: absolute;
  width: 4px;
  background-color: #2d3748;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -2px;
  z-index: 0;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Container around content */
.timeline-container {
  padding: 15px 40px;
  position: relative;
  background-color: inherit;
  margin-bottom: 30px;
  width: 45%;
}

/* The circles on the timeline */
.timeline-container::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background-color: white;
  border: 3px solid #2d3748;
  top: 22px;
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.timeline-active::after {
  background-color: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

.timeline-left {
  left: 0;
}

.timeline-right {
  left: 50%;
}

/* Position the circles for left and right containers */
.timeline-left::after {
  right: -9px;
}

.timeline-right::after {
  left: -9px;
}

.timeline-center {
  width: 100%;
  text-align: center;
  display: flex;
  justify-content: center;
  margin-top: 2em;
  position: relative;
  z-index: 2;
}

.timeline-content {
  padding: 20px 25px;
  background-color: #1a202c;
  position: relative;
  border-radius: 8px;
  color: white;
  z-index: 1;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.timeline-active .timeline-content {
  border-left: 4px solid #f59e0b;
}

.timeline-time-text {
  margin: 0;
  margin-bottom: 0.5em;
  font-size: 0.9em;
  font-weight: 700;
  color: #f59e0b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.timeline-role-text {
  margin: 0.5em 0;
  font-size: 1.1em;
  font-weight: 600;
}

.timeline-place-text {
  margin: 0;
  font-size: 0.95em;
  font-weight: 500;
  color: #e2e8f0;
}

.timeline-center .timeline-content {
  background-color: #2d3748;
  border-left: none;
  padding: 15px 25px;
}

.timeline-center .timeline-role-text {
  color: #f59e0b;
}

/* Mobile styles */
@media (max-width: 768px) {
  .timeline::after {
    left: 31px;
  }

  .timeline-container {
    width: calc(100% - 70px);
    padding-left: 70px;
    padding-right: 25px;
    margin-left: 0;
  }

  .timeline-left::after,
  .timeline-right::after {
    left: 22px;
  }

  .timeline-right {
    left: 0;
  }

  /* Adjust the center timeline item */
  .timeline-center {
    width: calc(100% - 70px);
    margin-left: 70px;
    justify-content: flex-start;
  }

  .timeline-center .timeline-content {
    width: 100%;
  }

  /* Fix the hover effect on mobile */
  .timeline-content:hover {
    transform: none;
  }
  
  /* Ensure the border is visible on the correct side */
  .timeline-active .timeline-content {
    border-left: 4px solid #f59e0b;
    border-right: none;
  }
}