.timeline {
  position: relative;
  margin: 80px 0;
  padding: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, #2D2C6E, #2D2C6E);
  transform: translateX(-50%);
  box-shadow: 0 0 15px rgba(108, 92, 231, 0.3);
}

.timeline-item {
  position: relative;
  margin-bottom: 70px;
  width: 50%;
  padding: 20px 40px;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-item.left {
  left: 0;
  text-align: right;
}

.timeline-item.right {
  left: 50%;
  text-align: left;
}

.timeline-badge {
  position: absolute;
  top: 20px;
  width: 70px;
  height: 70px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  z-index: 1;
  transition: all 0.3s ease;
}

.timeline-item:hover .timeline-badge {
  transform: scale(1.1);
}

.timeline-item.left .timeline-badge {
  right: -35px;
  background: linear-gradient(45deg, #6c5ce7, #a29bfe);
}

.timeline-item.right .timeline-badge {
  left: -35px;
  background: linear-gradient(45deg, #00b894, #00cec9);
}

.timeline-panel {
  background: #fff;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.timeline-item:hover .timeline-panel {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.timeline-item.left .timeline-panel {
  margin-right: 50px;
  border-left: 4px solid #6c5ce7;
}

.timeline-item.right .timeline-panel {
  margin-left: 50px;
  border-left: 4px solid #00b894;
}

.timeline-panel h4 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: #2d3436;
}

.timeline-panel p {
  font-size: 1rem;
  line-height: 1.6;
  color: #636e72;
  margin: 0;
}

.timeline-item:nth-child(1) .timeline-badge {
  background: linear-gradient(45deg, #ff7675, #ff7675);
}

.timeline-item:nth-child(1) .timeline-panel {
  border-left-color: #ff7675;
}

.timeline-item:nth-child(2) .timeline-badge {
  background: linear-gradient(45deg, #66b54f, #66b54f);
}

.timeline-item:nth-child(2) .timeline-panel {
  border-left-color: #66b54f;
}

.timeline-item:nth-child(3) .timeline-badge {
  background: linear-gradient(45deg, #469CDC, #469CDC);
}

.timeline-item:nth-child(3) .timeline-panel {
  border-left-color: #469CDC;
}

.timeline-item:nth-child(4) .timeline-badge {
  background: linear-gradient(45deg, #e2554d, #e2554d);
}

.timeline-item:nth-child(4) .timeline-panel {
  border-left-color: #e2554d;
}

@media (max-width: 767px) {
  .timeline::before {
    left: 30px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 80px;
    padding-right: 20px;
    margin-bottom: 50px;
  }

  .timeline-item.right {
    left: 0;
  }

  .timeline-badge {
    left: 0 !important;
    right: auto !important;
    top: 0;
    width: 60px;
    height: 60px;
    font-size: 1.2rem;
  }

  .timeline-panel {
    margin: 0 0 0 40px !important;
    padding: 15px;
  }

  .timeline-item.left .timeline-panel,
  .timeline-item.right .timeline-panel {
    margin-left: 40px !important;
    margin-right: 0 !important;
  }

  .timeline-panel h4 {
    font-size: 1.2rem;
  }

  .timeline-panel p {
    font-size: 0.9rem;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .timeline-item {
    width: 45%;
  }

  .timeline-item.left {
    left: 0;
  }

  .timeline-item.right {
    left: 55%;
  }

  .timeline-badge {
    width: 65px;
    height: 65px;
    font-size: 1.3rem;
  }

  .timeline-panel {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .timeline::before {
    left: 20px;
  }

  .timeline-item {
    padding-left: 60px;
    padding-right: 15px;
    margin-bottom: 40px;
  }

  .timeline-badge {
    width: 50px;
    height: 50px;
    font-size: 1rem;
  }

  .timeline-panel {
    margin-left: 30px !important;
    padding: 12px;
  }

  .timeline-panel h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
  }

  .timeline-panel p {
    font-size: 0.85rem;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .timeline {
    margin: 40px 0;
  }

  .timeline-item {
    margin-bottom: 30px;
  }

  .timeline-panel {
    padding: 15px;
  }
}
