.how-it-work-section {
  text-align: center;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.how-it-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 100px 100px 50px 100px;
}

span.how-it-headings {
  background: linear-gradient(180deg, #9C03A6, #69018D);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 90px;
  font-weight: 700;
  line-height: 100px !important;
}

span.how-it-egifters {
  color: transparent;
  -webkit-text-stroke: 2px #720074;
  text-stroke: 2px #720074;
  font-size: 90px;
  font-weight: 700;
  line-height: 100px !important;
}

.how-it-description {
  font-weight: 400;
  font-size: 24px;
  line-height: 100%;
  color: #1F1F1F;
  margin-bottom: 0px !important;
}

.step-number {
  width: 74px;
  height: 74px;
  background: transparent;
  font-size: 36px;
  font-weight: 500;
  border-radius: 50%;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid transparent;
  margin-bottom: 10px !important;
  z-index: 2;
  color: #000000;
}

.step-number span {
  background: linear-gradient(180deg, #8B0791, #5600C5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.timeline-content h3 {
  font-size: 36px;
  margin-bottom: 10px !important;
  color: #000000 !important;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 100%;
}

.timeline-content p {
  font-size: 18px;
  font-weight: 400;
  color: #000000 !important;
  max-width: 700px;
  line-height: 27px;
  margin-bottom: 30px !important;
}

.step-img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.step-img:hover {
  transform: scale(1.02);
}

/* General Timeline Line Styling */
.timeline-container {
  position: relative;
  /* max-width: 800px; */
  margin: 50px auto;
  margin-bottom: 0px !important;
  transition: all 0.5s;
  padding: 100px;
  background-color: transparent;
  background-image: linear-gradient(180deg, #6e0094 0%, #410057 86%);
}

@media (max-width: 768px) {
  /* Center the top-level timeline container on small screens */
  .timeline-container {
    margin: 50px auto !important;
  }
}

.timeline-item {
  display: grid;
  grid-template-columns: 1fr 118px 1fr;
  position: relative;

  @media (max-width: 768px) {
    &:not(.timeline-item-right) .timeline-circle {
      order: -1;
    }

    grid-template-columns: 60px 1fr;

    .empty-circle {
      display: none;
    }

    .timeline-line {
      width: 3px !important;
      height: 100%;
      border-radius: 9999px 9999px 0 0;
      background-color: #cbb5f9;
    }
  }
  @media (max-width: 375px) {
    grid-template-columns: 53px 1fr !important;
    .timeline-circle{
      left: 3px;
    }
  }
  @media (max-width: 344px) {
    .timeline-circle{
      left: 4px;
    }
  }
  @media (width: 360px) {
    .timeline-circle{
      left: 3px;
    }
    .timeline-container {
      margin: 50px 5px;
    }
    .timeline-content{
      width: 265px !important;
    }
  }
  @media (width: 390px) {
    .timeline-circle{
      left: 3px;
    }
    .timeline-container {
      margin: 50px 5px;
    }
    .timeline-content{
      width: 287px !important;
    }
  }
  @media (width: 412px) {
    .timeline-circle{
      left: 2px;
    }
    .timeline-container {
      margin: 50px 5px;
    }
    .timeline-content{
      width: 309px !important;
    }
  }
  @media (width: 414px) {
    .timeline-circle{
      left: 2px;
    }
    .timeline-container {
      margin: 50px 5px;
    }
    .timeline-content{
      width: 309px !important;
    } 
  }
  @media (width: 425px) {
    .timeline-circle{
      left: 4px;
    }
    .timeline-container {
      margin: 50px 5px;
    }
    .timeline-content{
      width: 325px !important;
    }
  }
  @media (width: 430px) {
    .timeline-circle{
      left: 2px;
    }
    .timeline-container {
      margin: 50px 5px;
    }
    .timeline-content{
      width: 325px !important;
    } 
  }
  @media (width: 768px) {
    .timeline-card-right{
      margin-left: 0px !important;
    }
    .timeline-card-left{
      margin-right: 0px !important;
    }
  }


  &.active {
    opacity: 1;
    transform: translateY(0);
    .timeline-line,
    .timeline-circle::before,
    .timeline-circle::after {
      background: linear-gradient(90deg, #5524ea 0%, #ae47ff 100%) !important;
    }
    .step-number {
      background: 
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(180deg, #8B0791, #5600C5) border-box;
    }
  }

  &.timeline-item-right .timeline-circle::after {
    left: unset;
    right: -152px;

    @media (max-width: 768px) {
      right: 3px;
    }
  }


  @media (min-width: 200px) and (max-width: 374px) {
    .timeline-item {
      grid-template-columns: 17px 1fr;
    }

    .timeline-item:not(.timeline-item-right) .timeline-circle {
      order: -1;
    }

    .empty-circle {
      display: none;
    }

    .timeline-line {
      width: 3px !important;
      height: 100%;
      border-radius: 9999px 9999px 0 0;
      background-color: #cbb5f9;
    }

    .timeline-circle {
      justify-content: flex-start;
    }

    .timeline-circle::before {
      width: 10px;
      height: 10px;
      left: 1px;
    }

    .timeline-circle::after {
      width: 35px;
      height: 3px;
      top: 53px;
      left: 20px;
    }

    .timeline-content {
      width: 250px;
      justify-self: left !important;
    }

    .timeline-item-right .timeline-circle::after {
      right: 33px;
    }

    .timeline-item-right .timeline-content::before {
      left: -74px;
    }
  }

  @media (min-width: 220px) and (max-width: 340px) {
    .timeline-item {
      grid-template-columns: 17px 1fr;
    }

    .timeline-item:not(.timeline-item-right) .timeline-circle {
      order: -1;
    }

    .empty-circle {
      display: none;
    }

    .timeline-line {
      width: 3px !important;
      height: 100%;
      border-radius: 9999px 9999px 0 0;
      background-color: #cbb5f9;
    }

    .timeline-circle {
      justify-content: flex-start;
    }

    .timeline-circle::before {
      width: 10px;
      height: 10px;
      left: 1px;
    }

    .timeline-circle::after {
      width: 35px;
      height: 3px;
      top: 53px;
      left: 20px;
    }

    .timeline-content {
      width: 220px;
      justify-self: left !important;
    }

    .timeline-item-right .timeline-circle::after {
      right: 3px;
    }

    .timeline-item-right .timeline-content::before {
      left: -74px;
    }
  }
}

.timeline-circle {
  position: relative;
  display: flex;
  justify-content: center;
  width: 6px;
  height: 100%;
  right: -20px;

  @media (max-width: 768px) {
    justify-content: flex-start;
  }

  &::before,
  &::after {
    content: "";
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f7edff;
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);

    @media (max-width: 768px) {
      width: 10px;
      height: 10px;
      left: 1px;
    }
  }

  &::after {
    width: 100px;
    height: 6px;
    border-radius: 6px;
    top: 58px;
    left: -36px;
    z-index: -1;

    @media (max-width: 768px) {
      width: 35px;
      height: 3px;
      top: 53px;
      left: 20px;
    }
  }
}

.timeline-item.active p {
  color: #23004f;
}

.timeline-item.active .timeline-content {
  top : 100px;
  transition: all 0.5s;
  background-color: #fff;
  box-shadow: 0 0 6px 0 #0000001f;
  border: 1px solid #ae47ff;
  z-index: 1;
  border-radius: 30px;
  
  @media (min-width: 769px) {
    scale: 1.03;
  }
}

.timeline-content {
  text-align: center;
  justify-content: center;
  padding: 20px;
  width: 91%;

  @media (max-width: 768px) {
    width: 280px;
    justify-self: left !important;
  }

  .timeline-item-right & {
    &::before {
      left: -74px;
      right: unset;
    }
  }
}


@media (max-width: 768px) {
  .timeline-item.active .timeline-content {
    /* scale: 1.03; */
    top: 0px;
  }

  .how-it-main {
    padding: 50px 20px 25px 20px;
  }
  #how-it-works {
    padding: 0px;
  }
  .timeline-item {
    left: -70px;
    top: -70px;
    right: -70px;
  }
  span.how-it-headings {
    font-size: 45px;
    line-height: normal !important;
  }

  span.how-it-egifters {
    font-size: 45px;
    line-height: normal !important;
  }

  /* Extend connector length on very small screens to close gaps */
  .timeline-circle::after {
    width: 45px !important;
    left: 20px !important;
  }

  .timeline-container {
    padding-bottom: 0px;
  }
  /* Force all horizontal sticks to point to the right on small screens */
  .timeline-item-right .timeline-circle::after {
    left: 20px !important;
    right: auto !important;
  }
}
.timeline-item.active .timeline-circle::after {
  background: linear-gradient(180deg, #9C03A6, #69018D);
}


.timeline-line {
  width: 6px;
  height: 100%;
  border-radius: 9999px 9999px 0 0;
  background-color: #cbb5f9;
}

.last-step .timeline-line {
  height: 100%;
  border-radius: 9999px 9999px 9999px 9999px;
}
