/* ============================================================
   SECTION: SCHEDULE (5泊6日のモデルスケジュール)
   ============================================================ */

.schedule {
  position: relative;
  background-color: #f4f6f9; /* Nền trắng pha xanh/xám rất nhạt */
  border-top: 1px solid var(--color-navy); /* Thanh navy đậm mỏng ở trên */
  padding: 80px 0;
  overflow: clip;
  z-index: 1;
}

@media (min-width: 1024px) {
  .schedule {
    padding: 120px 0;
  }
}

/* Background vertical decorative text "SCHEDULE" */
.schedule__deco {
  position: absolute;
  top: 0;
  right: 0;
  height: 480px;
  width: auto;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.schedule.is-active .schedule__deco {
  opacity: 0.8;
}

@media (min-width: 1024px) {
  .schedule__deco {
    height: 917px;
  }
}

/* Inner Container */
.schedule__inner {
  position: relative;
  z-index: 2;
}

/* Header & Intro */
.schedule__header {
  text-align: left;
  margin-bottom: 48px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease;
}

.schedule.is-active .schedule__header {
  opacity: 1;
}

.schedule__badge-capsule {
  display: inline-block;
  background: linear-gradient(90deg, #996213 0%, #e7cd59 55%, #996213 100%);
  color: var(--color-navy-deep);
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.schedule.is-active .schedule__badge-capsule {
  opacity: 1;
  transform: scale(1);
}

.schedule__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 24px;
  color: var(--color-navy-deep);
  line-height: 1.4;
  margin: 0 0 16px;
  letter-spacing: 0.03em;
}

.schedule__divider {
  display: block;
  width: 60px;
  height: 2px;
  background-color: var(--color-orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1) 0.4s;
}

.schedule.is-active .schedule__divider {
  transform: scaleX(1);
}

@media (min-width: 1024px) {
  .schedule__header {
    margin-bottom: 80px;
  }
  .schedule__title {
    font-size: 38px;
  }
  .schedule__badge-capsule {
    font-size: 14px;
    padding: 6px 20px;
    margin-bottom: 16px;
  }
}

/* Timeline Layout */
.schedule__timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

/* Vertical Timeline Line */
.schedule__timeline::before {
  content: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 2px;
  background-color: #dedeff; /* Tím nhạt */
  z-index: 0;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.schedule__timeline.is-active::before {
  transform: scaleY(1);
}

@media (min-width: 1024px) {
  .schedule__timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .schedule__item:not(:first-child) {
    margin-top: -200px; /* Tạo xếp chồng so le dọc giữa các ngày */
  }

  .schedule__timeline::before {
    content: "";
    left: 50%;
    transform: translateX(-50%) scaleY(0);
  }
  
  .schedule__timeline.is-active::before {
    transform: translateX(-50%) scaleY(1);
  }
}

/* Timeline Item (Grid layout per day on PC) */
.schedule__item {
  position: relative;
  width: 100%;
}

@media (min-width: 1024px) {
  .schedule__item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: flex-start;
    width: 100%;
  }

  .schedule__item .schedule__badge,
  .schedule__item .schedule__card {
    grid-row: 1;
  }
}

/* Round DAY Badge */
.schedule__badge {
  position: absolute;
  top: -24px;
  left: 16px;
  width: 52px;
  height: 52px;
  background-color: var(--color-navy);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 80, 0.15);
  font-family: var(--font-serif);
  text-align: center;
  line-height: 1.1;
  z-index: 5;
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* So le trên Mobile: ngày lẻ (left) lệch phải, ngày chẵn (right) lệch trái */
.schedule__item--left .schedule__badge {
  left: auto;
  right: 16px;
}
.schedule__item--right .schedule__badge {
  left: 16px;
  right: auto;
}

.schedule__badge-day {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.schedule__badge-num {
  font-size: 20px;
  font-weight: 700;
}

.schedule__item.is-visible .schedule__badge {
  opacity: 1;
  transform: scale(1);
}

@media (min-width: 1024px) {
  .schedule__item--left .schedule__badge {
    position: absolute;
    left: auto;
    right: calc(50% + 20px);
    top: -34px;
    width: 68px;
    height: 68px;
    z-index: 5;
    transform: scale(0.3);
    transform-origin: right center;
  }

  .schedule__item--right .schedule__badge {
    position: absolute;
    left: calc(50% + 20px);
    right: auto;
    top: -34px;
    width: 68px;
    height: 68px;
    z-index: 5;
    transform: scale(0.3);
    transform-origin: left center;
  }

  .schedule__item--left.is-visible .schedule__badge,
  .schedule__item--right.is-visible .schedule__badge {
    opacity: 1;
    transform: scale(1);
  }
  
  .schedule__badge-day {
    font-size: 10px;
  }

  .schedule__badge-num {
    font-size: 26px;
  }
}

/* Connector Lines & Dots (Desktop only) */
.schedule__connector {
  display: none;
}

@media (min-width: 1024px) {
  .schedule__connector {
    display: block !important;
    position: absolute;
    top: 0px; /* Thẳng hàng với tâm Badge (top -34px + chiều cao 68px/2 = 0px) */
    height: 2px;
    z-index: 2;
  }

  .schedule__item--left .schedule__connector {
    left: auto;
    right: 50%;
    width: 20px;
  }

  .schedule__item--right .schedule__connector {
    left: 50%;
    right: auto;
    width: 20px;
  }

  .schedule__connector-line {
    display: block;
    height: 2px;
    background-color: #dedeff;
    width: 100%;
    transform: scaleX(0);
    transition: transform 0.6s ease 0.2s;
  }

  .schedule__item--left .schedule__connector-line {
    transform-origin: right;
  }

  .schedule__item--right .schedule__connector-line {
    transform-origin: left;
  }

  .schedule__item.is-visible .schedule__connector-line {
    transform: scaleX(1);
  }

  .schedule__connector-dot {
    display: block;
    position: absolute;
    top: -2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-navy);
    border: 2px solid #dedeff;
    opacity: 0;
    z-index: 3;
    transition: opacity 0.3s ease 0.6s, transform 0.3s ease 0.6s;
  }

  .schedule__item--left .schedule__connector-dot {
    right: -3px;
    left: auto;
  }

  .schedule__item--right .schedule__connector-dot {
    left: -3px;
    right: auto;
  }

  .schedule__item.is-visible .schedule__connector-dot {
    opacity: 1;
    animation: dotPulse 1.2s ease-out 0.8s 1;
  }
}

@keyframes dotPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 0, 80, 0.4);
  }
  70% {
    transform: scale(1.3);
    box-shadow: 0 0 0 8px rgba(0, 0, 80, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 0, 80, 0);
  }
}

/* Card Styling */
.schedule__card {
  background-color: var(--color-white);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 80, 0.05);
  padding: 32px 20px 24px;
  width: 100%;
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.schedule__item.is-visible .schedule__card {
  opacity: 1;
  transform: translateY(0);
}

.schedule__card-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-navy-deep);
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}

.schedule__card-text {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
  margin: 0;
  letter-spacing: 0.01em;
}

@media (min-width: 1024px) {
  .schedule__card {
    padding: 40px;
    max-width: 520px;
    box-shadow: 0 15px 45px rgba(0, 0, 80, 0.06);
    transform: translateX(40px);
  }

  .schedule__item--left .schedule__card {
    grid-column: 1;
    justify-self: end;
    margin-right: 48px;
    transform: translateX(-40px);
  }

  .schedule__item--right .schedule__card {
    grid-column: 2;
    justify-self: start;
    margin-left: 48px;
    transform: translateX(40px);
  }

  .schedule__item.is-visible .schedule__card {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Media/Images Overlap Bố cục */
.schedule__media {
  position: relative;
  margin-top: 24px;
  width: 100%;
  padding-bottom: 12%; /* Rút ngắn để ảnh nhỏ đè lên ảnh lớn */
}

.schedule__img-wrap {
  position: relative;
  overflow: visible; /* Cho phép hiển thị drop-shadow của ảnh bị clip */
  filter: drop-shadow(0 8px 24px rgba(0, 0, 80, 0.12));
}

.schedule__img-wrap--main {
  width: 80%;
  aspect-ratio: 16/10;
}

.schedule__img-wrap--sub {
  width: 42%;
  aspect-ratio: 16/10;
  position: absolute;
  bottom: 0;
  z-index: 3;
  opacity: 0;
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) 0.18s, opacity 1.0s ease 0.18s;
}

/* Left alignment on SP and day-left layout on PC */
.schedule__item--left .schedule__img-wrap--sub,
.schedule__img-wrap--sub {
  right: 0;
  transform: translate(10px, 10px) scale(0.85);
}

@media (min-width: 1024px) {
  /* Right alignment for day-right cards */
  .schedule__item--right .schedule__img-wrap--sub {
    left: auto;
    right: 0;
    transform: translate(-10px, 10px) scale(0.85);
  }
}

.schedule__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%); /* Hình bình hành lệch phải / / */
  transform: scale(1.08);
  transition: transform 1.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Zoom out main image on scroll active */
.schedule__item.is-visible .schedule__img-wrap--main .schedule__img {
  transform: scale(1);
}

/* Pop/slide sub image into place */
.schedule__item.is-visible .schedule__img-wrap--sub {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

.schedule__item.is-visible .schedule__img-wrap--sub .schedule__img {
  transform: scale(1);
}

/* CTA Area & Button */
.schedule__cta {
  margin-top: 56px;
  display: flex;
  justify-content: center;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.0s ease, transform 1.0s ease;
}

.schedule.is-active .schedule__cta {
  opacity: 1;
  transform: translateY(0);
}

/* Special outline style button for Schedule */
.btn-booking--schedule {
  background-color: transparent;
  color: var(--color-navy);
  border: 1.5px solid var(--color-navy);
  box-shadow: none;
  min-height: 52px;
  min-width: 280px;
  padding: 6px 24px;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.btn-booking--schedule .btn-booking__text {
  color: var(--color-navy) !important;
  font-weight: 600;
  margin-right: 12px;
  transition: color 0.3s;
}

.btn-booking--schedule .btn-booking__arrow {
  background-color: transparent;
  border: none;
  width: auto;
  height: auto;
  transform: none; /* Khử nghiêng khung bọc mũi tên */
  color: var(--color-navy);
  transition: transform 0.3s, color 0.3s;
}

.btn-booking--schedule .btn-booking__arrow span {
  transform: none; /* Khử nghiêng ký tự mũi tên */
  color: var(--color-navy) !important;
  font-family: var(--font-latin);
  font-weight: 600;
  font-size: 16px;
  transition: color 0.3s;
}

/* Hover effects */
.btn-booking--schedule:hover {
  background-color: var(--color-navy);
  border-color: var(--color-navy);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(8, 0, 82, 0.15);
}

.btn-booking--schedule:hover .btn-booking__text {
  color: var(--color-white) !important;
}

.btn-booking--schedule:hover .btn-booking__arrow {
  background-color: transparent !important;
  border: none !important;
  transform: translateX(4px);
}

.btn-booking--schedule:hover .btn-booking__arrow span {
  color: var(--color-white) !important;
}

@media (min-width: 1024px) {
  .btn-booking--schedule {
    min-height: 60px;
    min-width: 320px;
    font-size: 18px;
    padding: 6px 36px;
  }
}
