/* --- MAIN TIMELINE CONTAINER --- */
.ht-timeline-container {
  width: 100%;
  overflow-x: auto; /* ✅ enable horizontal scroll */
  overflow-y: hidden; /* prevent vertical scroll */
  position: relative;
  white-space: nowrap;
  cursor: grab;
  padding: 350px 0;
  box-sizing: border-box;
  scroll-behavior: smooth; /* ✅ smooth scrolling */
  scrollbar-width: thin ; /* Firefox scrollbar */
  scrollbar-color: #1F6EB7 #f0f0f0;
}

/* --- Custom scrollbar for Chrome, Edge, Safari --- */
.ht-timeline-container::-webkit-scrollbar {
  height: 8px; /* horizontal scrollbar height */
}

.ht-timeline-container::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}

.ht-timeline-container::-webkit-scrollbar-thumb {
  background-color: #1F6EB7;
  border-radius: 10px;
}

/* --- Cursor behavior --- */
.ht-timeline-container:active {
  cursor: grabbing;
}

/* --- CENTRAL BASE LINE --- */
.ht-timeline-line {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 10px;
  background: #D8DADE;
  transform: translateY(-50%);
  z-index: 1;
  width: 100%; /* Will now expand with the scroll area */
}

/* --- SCROLL AREA --- */
.ht-timeline-scroll {
  display: inline-flex; /* ✅ allows horizontal scrolling */
  position: relative;
  gap: 280px;
  padding: 0 120px;
}

/* --- TIMELINE ITEMS --- */
.ht-timeline-item {
  position: relative;
  display: inline-block;
  text-align: left;
  z-index: 2;
}

/* --- DOT --- */
.ht-timeline-dot {
  width: 20px;
  height: 20px;
  background: #1F6EB7;
  border-radius: 50%;
  position: absolute;
  left: calc(50% - 70px);
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px #fff;
}

/* --- SMALL END DOTS --- */
.ht-timeline-item .end-dot-top,
.ht-timeline-item .end-dot-bottom {
  position: absolute;
  left: calc(50% - 70px);
  width: 5px;
  height: 5px;
  background: #888888;
  border-radius: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

.ht-timeline-item .end-dot-top {
  top: calc(50% - 160px);
}

.ht-timeline-item .end-dot-bottom {
  bottom: calc(50% - 160px);
}

/* --- CONNECTING LINES --- */
.ht-timeline-item::before,
.ht-timeline-item::after {
  content: "";
  position: absolute;
  left: calc(50% - 70px);
  width: 1px;
  background: #888888;
  transform: translateX(-50%);
  z-index: 2;
}

.ht-timeline-item::before {
  top: 50%;
  height: 160px; /* connects upward (top items) */
}

.ht-timeline-item::after {
  bottom: 50%;
  height: 160px; /* connects downward (bottom items) */
}

/* --- CONTENT CARD --- */
.ht-card-content {
  background: #F8F8F8;
  border: 1px solid #D8DADE;
  border-radius: 1px;
  padding: 15px;
  width: 230px;
  min-height: 120px;
  font-family: 'Lato', sans-serif;
  color: #151C20;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.6;
  position: relative;
  z-index: 4;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  overflow-wrap: break-word;
  white-space: normal;
  overflow: visible;
}

/* --- TRIANGLE POINTER --- */
.ht-card-content::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-right: 9px solid #D8DADE; /* Border color */
}

.ht-card-content::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid #F8F8F8; /* Inner background color */
}

/* --- YEAR TEXT --- */
.ht-card-year {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 34px;
  color: #2C5B87;
  position: relative;
  z-index: 4;
}

/* --- TOP ITEMS --- */
.ht-timeline-item.top .ht-card-content {
  position: absolute;
  bottom: calc(50% + 70px);
  left: calc(50% - 50px);
}

.ht-timeline-item.top .ht-card-year {
  position: absolute;
  top: calc(50% + 130px);
  left: calc(50% - 60px);
}

/* --- BOTTOM ITEMS --- */
.ht-timeline-item.bottom .ht-card-content {
  position: absolute;
  top: calc(50% + 70px);
  left: calc(50% - 50px);
}

.ht-timeline-item.bottom .ht-card-year {
  position: absolute;
  bottom: calc(50% + 130px);
  left: calc(50% - 60px);
}


/* --- WRAPPER --- */
.ht-timeline-wrapper {
  position: relative;
  width: 100%;
}

/* --- SCROLL ARROWS --- */
.ht-scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(31, 110, 183, 0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  z-index: 10;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: background 0.3s ease, transform 0.2s ease;
}

.ht-scroll-arrow:hover {
  background: #1F6EB7;
  transform: translateY(-50%) scale(1.1);
}

.ht-scroll-arrow.left {
  left: 10px;
}

.ht-scroll-arrow.right {
  right: 10px;
}

/* --- Hidden state when at edges --- */
.ht-scroll-arrow.hidden {
  opacity: 0.4;
  pointer-events: none;
}

/* --- RESPONSIVE FIXES --- */
@media (max-width: 1180px) {
.ht-scroll-arrow {
    top: calc(50% + 5px); /* Slightly lower for smaller screens */
  }
  .ht-card-content {
    width: 230px;
    padding: 16px;
    border-width: 1px;
  }
  .ht-timeline-container {
    padding: 400px 0;
  }
}

/* --- RESPONSIVE FIXES --- */
@media (max-width: 768px) {
  .ht-timeline-container {
    padding: 360px 0;
  }
  .ht-scroll-arrow {
    top: calc(50% + 5px); /* Slightly lower for smaller screens */
  }
  .ht-scroll-arrow.left {
  left: 0px;
  }
  .ht-timeline-scroll {
    gap: 220px; /* ✅ increase gap to avoid overlap */
    padding: 0 150px; /* ✅ extra left padding to show first item */
  }
  .ht-card-content {
    width: 190px;
    padding: 16px;
    border-width: 2px;
    font-size: 12px;
  }
  .ht-card-year {
    font-size: 26px;
  }
  .ht-timeline-dot {
    width: 16px;
    height: 16px;
  }
  .ht-timeline-item::before,
  .ht-timeline-item::after {
    height: 120px;
  }
  .ht-timeline-item .end-dot-top {
    top: calc(50% - 120px);
  }
  .ht-timeline-item .end-dot-bottom {
    bottom: calc(50% - 120px);
  }
}

/* --- EXTRA SMALL (Phones <480px) --- */
@media (max-width: 480px) {
  .ht-timeline-scroll {
    gap: 280px; /* ✅ wider gap for clarity on tiny screens */
    padding: 0 180px; /* ✅ ensures first item fully visible */
  }
  .ht-scroll-arrow {
    top: calc(50% + 5px); /* Slightly lower for smaller screens */
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  .ht-card-content {
    width: 200px;
    padding: 16px;
    border-width: 2px;

  }
  .ht-card-year {
    font-size: 22px;
  }
  .ht-timeline-container {
    padding: 320px 0px;
  }
}

