.snake-timeline-container {
  display: flex;
  flex-direction: column;
  gap: 60px;
  width: 100%;
  position: relative;
  padding: 20px 0;
  box-sizing: border-box;
}

.snake-timeline-row {
  display: flex;
  justify-content: space-around;
  width: 100%;
  position: relative;
}

.snake-timeline-row.row-ltr {
  flex-direction: row;
}

.snake-timeline-row.row-rtl {
  flex-direction: row-reverse;
}

.snake-timeline-item {
  flex: 1;
  max-width: calc(100% / var(--items-per-row) - 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  padding: 0 10px;
}

.snake-timeline-icon-box {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  margin-bottom: 15px;
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.snake-timeline-icon-box svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.snake-timeline-title {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.snake-timeline-desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #666;
}

/* horizontal dotted line inside rows */
.snake-timeline-item::after {
  content: '';
  position: absolute;
  top: 30px;
  left: 50%;
  width: 100%;
  border-top: 3px dotted #3498db;
  z-index: 1;
}

/* Remove dot trail on last item of row based on LTR/RTL flow */
.snake-timeline-row.row-ltr .snake-timeline-item:last-child::after,
.snake-timeline-row.row-rtl .snake-timeline-item:first-child::after {
  display: none;
}

/* Connector curve between rows */
.snake-timeline-row::after {
  content: '';
  position: absolute;
  top: 30px;
  height: calc(100% + 60px);
  width: 50px;
  border: 3px dotted #3498db;
  z-index: 1;
  display: none;
}

/* Mobile responsive fallback (Vertical Layout) */
@media (max-width: 767px) {
  .snake-timeline-row,
  .snake-timeline-row.row-ltr,
  .snake-timeline-row.row-rtl {
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
  }

  .snake-timeline-item {
    max-width: 100%;
    align-items: flex-start;
    text-align: left;
    padding-left: 80px;
  }

  .snake-timeline-icon-box {
    position: absolute;
    left: 0;
    top: 0;
  }

  .snake-timeline-item::after {
    left: 30px;
    top: 60px;
    width: 0;
    height: calc(100% + 40px);
    border-left: 3px dotted #3498db;
    border-top: none;
  }

  .snake-timeline-row:last-child .snake-timeline-item:last-child::after {
    display: none;
  }
}
