/* ================== BASE ================== */
#timeline ul {
  list-style: none;
  margin-top: 50px;
  padding-left: 0;
  position: relative; 
}

#timeline ul li {
  position: relative;
  width: 0;
  border-left:2px solid #D9D9D9;
  margin: 0 auto;
  min-height: 120px;
}

/* Dots */
#timeline ul li:before {
  content: "";
  position: absolute;
  top: 0;
  left: -7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 4px #ff8f8f,
    0 0 0 10px #ffeaea;
}

/* Timeline Cards */
#timeline ul li > div {
  width: 350px;
  margin-bottom: 5px;
  position: relative;
  opacity: 0;
  visibility: hidden;
  transition: all 0.8s ease-in-out;
}

#timeline ul li:nth-child(odd) > div {
  left: -400px;
  text-align: right;
}

#timeline ul li:nth-child(even) > div {
  left: 70px;
  text-align: left;
}

/* Animasi */
#timeline ul li.show > div {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* ================== TABLET ================== */
@media (max-width: 900px) {
  #timeline ul li > div {
    width: 280px;
  }
  #timeline ul li:nth-child(odd) > div {
    left: -300px;
  }
  #timeline ul li:nth-child(even) > div {
    left: 60px;
  }
}

/* ================== MOBILE ================== */
@media (max-width: 600px) {
  #timeline ul {
    padding-left: 30px; /* Keep the line closer to the left edge */
  }

  #timeline ul li {
    width: auto; /* Allow li to expand naturally */
    min-height: auto;
    margin: 0 0 30px 0; /* space between items */
    border-left: 2px solid #D9D9D9; /* vertical line */
    position: relative;
  }

  #timeline ul li:before {
    left: -7px; /* Keep dot centered on the line */
  }

  #timeline ul li > div {
    width: calc(100% - 40px); /* full width minus gap from line */
    margin-left: 20px; /* space between line and card */
    margin-bottom: 0;
    padding: 15px;
    box-sizing: border-box;
    text-align: left;
    left: 0 !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

