/* ==========================================================================
   Alina Timeline
   ========================================================================== */

.alina-tl { --alina-ypv: 7; }

/* ---- Root ---- */
.alina-tl {
  background-color: transparent;
  padding: 0;
  box-sizing: border-box;
  width: 100%;
  position: relative;
  font-family: inherit;
}

/* ---- Title ---- */
.alina-tl__header { margin-bottom: 20px; }

.alina-tl__title {
  margin: 0;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 700;
  color: #1a3d2e;
  text-align: center;
  line-height: 1.3;
}

/* ---- Nav row ---- */
.alina-tl__nav {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 16px;
}

/* ---- Years viewport ---- */
.alina-tl__years-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
}

.alina-tl__years-wrap.is-dragging { cursor: grabbing; }

/* ---- Years sliding track ---- */
.alina-tl__years {
  display: flex;
  align-items: flex-end;
  padding-bottom: 12px;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}

.alina-tl__year {
  flex: 0 0 calc(100% / var(--alina-ypv, 7));
  box-sizing: border-box;
  padding-right: 8px;
  font-family: 'Public Sans', sans-serif;
  font-size: 24px;
  font-weight: 300;
  color: #aabfc9;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s, font-size 0.35s;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.alina-tl__year.is-active {
  color: #1a3d2e;
  font-size: 70px;
  overflow: visible;
  z-index: 2;
}

.alina-tl__year:not(.is-active):hover { color: #7a9aa6; }

/* ---- Track: line + dots ---- */
.alina-tl__track {
  position: relative;
  height: 30px;
  display: flex;
  align-items: center;
}

.alina-tl__line {
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 2px;
  background-color: #aabfc9;
  transform: translateY(-50%);
  pointer-events: none;
}

.alina-tl__dots {
  display: flex;
  width: 100%;
  position: relative;
  z-index: 1;
  will-change: transform;
  user-select: none;
}

.alina-tl__dot {
  flex: 0 0 calc(100% / var(--alina-ypv, 7));
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding-right: 8px;
  cursor: pointer;
}

.alina-tl__dot::before {
  content: '';
  display: block;
  width: 12px; height: 12px;
  border-radius: 50%;
  background-color: #aabfc9;
  flex-shrink: 0;
  transition: background-color 0.3s, width 0.3s, height 0.3s;
}

.alina-tl__dot.is-active::before {
  width: 18px; height: 18px;
  background-color: #1a3d2e;
}

/* ---- Buttons ---- */
.alina-tl__buttons {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 4px;
  position: relative;
  z-index: 10;
}

.alina-tl__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid #aabfc9;
  background: transparent;
  color: #1a3d2e;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  transition: border-color 0.25s, background-color 0.25s, color 0.25s, opacity 0.25s;
}

.alina-tl__btn:hover:not(:disabled) {
  border-color: #1a3d2e;
  background-color: #1a3d2e;
  color: #fff;
}

/* Ngăn Elementor editor override màu hover của button */
.elementor-editor-active .alina-tl__btn:hover:not(:disabled) {
  border-color: #1a3d2e !important;
  background-color: #1a3d2e !important;
  color: #fff !important;
}

.alina-tl__btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ---- Panels ---- */
.alina-tl__panels { position: relative; }

.alina-tl__panel { display: none; }

.alina-tl__panel.is-active {
  display: block;
  animation: alina-tl-in 0.4s ease both;
}

@keyframes alina-tl-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Panel body: wrapper quanh Elementor nested container ---- */
.alina-tl__panel-body {
  background-color: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  min-height: 100px;
}

/* ==========================================================================
   Elementor Editor
   ========================================================================== */

/* Hiện tất cả panel trong editor để dễ edit */
.elementor-editor-active .alina-tl__panel {
  display: block !important;
  animation: none !important;
  margin-bottom: 24px;
  position: relative;
}

/* Badge tên năm trên mỗi panel */
.elementor-editor-active .alina-tl__panel::before {
  content: attr(data-year-label);
  display: inline-block;
  margin-bottom: 8px;
  background: #1a3d2e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 4px;
}

/* Highlight panel đang active */
.elementor-editor-active .alina-tl__panel.is-active .alina-tl__panel-body {
  outline: 2px solid #1a3d2e;
  outline-offset: 6px;
  border-radius: 4px;
}

/* Placeholder khi chưa gán template */
.alina-tl__panel-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 140px;
  border: 2px dashed #aabfc9;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  color: #666;
}

.alina-tl__panel-placeholder span { font-size: 28px; }
.alina-tl__panel-placeholder strong { font-size: 18px; color: #1a3d2e; }
.alina-tl__panel-placeholder p { margin: 0; font-size: 13px; }
.alina-tl__panel-placeholder small { color: #999; font-size: 11px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767px) {
  .alina-tl__header { margin-bottom: 16px; }
  .alina-tl__title { font-size: 18px; }

  .alina-tl__nav { flex-wrap: wrap; gap: 8px; }
  .alina-tl__years-wrap { flex: 1 1 100%; order: 1; }
  .alina-tl__buttons { order: 2; margin-left: auto; }
  .alina-tl__btn { width: 36px; height: 36px; }
  .alina-tl__nav { margin-bottom: 24px; }
}
