/**
 * Thai Practice - Video end nudge popup
 * Shown right after the free lesson video ends. Colors reuse the active
 * theme's own tokens (--blue, --navy, --saffron — loaded site-wide, not
 * just on the homepage) so the popup doesn't introduce a second palette.
 */

.taj-lesson-popup {
  --tlp-bg: var(--navy, #111d3d);
  --tlp-panel: var(--navy-2, #18284f);
  --tlp-muted: #aebbd6;
  --tlp-blue: var(--blue, #526cf4);
  --tlp-yellow: var(--saffron, #ffc638);

  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    visibility 0s linear 0.25s;
}

.taj-lesson-popup.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.25s ease,
    visibility 0s linear 0s;
}

.taj-lesson-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 13, 36, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.taj-lesson-popup__modal {
  position: relative;
  z-index: 1;
  width: min(470px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 36px 30px 28px;
  color: #fff;
  background: var(--tlp-bg);
  border: 1px solid rgba(115, 145, 255, 0.32);
  border-radius: 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  text-align: center;
  transform: translateY(18px) scale(0.97);
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease;
}

.taj-lesson-popup.is-open .taj-lesson-popup__modal {
  transform: translateY(0) scale(1);
}

.taj-lesson-popup__close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #dce4fa;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.82;
}

.taj-lesson-popup__close:hover {
  opacity: 1;
}

.taj-lesson-popup__badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  margin-bottom: 22px;
  background: var(--tlp-panel);
  border-radius: 999px;
  color: #eef1ff;
  font-size: 14px;
  font-weight: 800;
}

.taj-lesson-popup__badge-icon {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  color: #fff;
  background: var(--tlp-blue);
  font-size: 12px;
}

.taj-lesson-popup__badge-icon svg {
  width: 13px;
  height: 13px;
  stroke: #fff;
}

.taj-lesson-popup__header {
  position: relative;
}

.taj-lesson-popup__header h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(22px, 5vw, 27px);
  line-height: 1.2;
  font-weight: 850;
  letter-spacing: -0.4px;
  max-width: 290px;
}

.taj-lesson-popup__header p {
  margin: 16px 0 0;
  color: var(--tlp-muted);
  font-size: 17px;
  line-height: 1.5;
}

.taj-lesson-popup__test {
  margin-top: 28px;
  padding: 22px 24px;
  background: var(--tlp-panel);
  border: 1px solid rgba(119, 146, 255, 0.22);
  border-radius: 18px;
  text-align: left;
}

.taj-lesson-popup__test-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.taj-lesson-popup__test-icon {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.taj-lesson-popup__test-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.taj-lesson-popup__test-title {
  margin: 0;
  color: #fff;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 650;
}

.taj-lesson-popup__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin: 14px auto 0;
}

.taj-lesson-popup__primary,
.taj-lesson-popup__secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 24px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 850;
  transition:
    transform 0.2s ease,
    filter 0.2s ease,
    background 0.2s ease;
}

.taj-lesson-popup__primary {
  color: #fff;
  background: var(--tlp-blue);
  box-shadow: 0 13px 28px rgba(74, 99, 231, 0.28);
}

.taj-lesson-popup__test .taj-lesson-popup__primary {
  width: 100%;
  margin-top: 18px;
}

.taj-lesson-popup__primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.taj-lesson-popup__secondary {
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.taj-lesson-popup__secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

.taj-lesson-popup__promo-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.taj-lesson-popup__promo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  padding: 16px 18px;
  background: var(--tlp-panel);
  border: 1px solid rgba(255, 198, 56, 0.18);
  border-radius: 16px;
  text-align: left;
}

.taj-lesson-popup__promo-emoji {
  flex: 0 0 auto;
  font-size: 26px;
}

.taj-lesson-popup__promo strong {
  display: block;
  color: var(--tlp-yellow);
  font-size: 15px;
  line-height: 1.35;
}

.taj-lesson-popup__promo p {
  margin: 4px 0 0;
  color: var(--tlp-muted);
  font-size: 13px;
  line-height: 1.4;
}

.taj-lesson-popup__title-wrap {
  position: relative;
  display: inline-block;
}

.taj-lesson-popup__spark {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 4px;
  border-radius: 999px;
  background: var(--tlp-blue);
  opacity: 0.95;
}

.taj-lesson-popup__spark::after {
  content: "";
  position: absolute;
  top: 17px;
  width: 19px;
  height: 4px;
  border-radius: 999px;
  background: var(--tlp-blue);
}

.taj-lesson-popup__spark--left {
  left: -14px;
  transform: translateY(-720%) rotate(48deg);
}

.taj-lesson-popup__spark--left::after {
  left: 9px;
  transform: rotate(-38deg);
}

.taj-lesson-popup__spark--right {
  right: -13px;
  transform: translateY(-739%) rotate(-38deg);
}

.taj-lesson-popup__spark--right::after {
  right: 5px;
  transform: rotate(28deg);
}

@media (max-width: 650px) {
  .taj-lesson-popup {
    align-items: flex-end;
    padding: 12px;
  }

  .taj-lesson-popup__modal {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 34px 20px 22px;
    border-radius: 24px;
    transform: translateY(100%);
  }

  .taj-lesson-popup.is-open .taj-lesson-popup__modal {
    transform: translateY(0);
  }

  .taj-lesson-popup__badge {
    margin-bottom: 18px;
    font-size: 12px;
  }

  .taj-lesson-popup__header h2 {
    font-size: 22px;
  }

  .taj-lesson-popup__spark {
    width: 20px;
  }

  .taj-lesson-popup__spark::after {
    top: 10px;
    width: 13px;
  }

  .taj-lesson-popup__spark--left {
    left: -30px;
  }

  .taj-lesson-popup__spark--right {
    right: -30px;
  }

  .taj-lesson-popup__header p {
    margin-top: 12px;
    font-size: 15px;
  }

  .taj-lesson-popup__test {
    padding: 18px 16px;
  }

  .taj-lesson-popup__test-top {
    align-items: flex-start;
  }

  .taj-lesson-popup__primary,
  .taj-lesson-popup__secondary {
    min-height: 54px;
    font-size: 15px;
  }

  .taj-lesson-popup__promo {
    padding: 14px;
  }

  .taj-lesson-popup__promo strong {
    font-size: 13px;
  }

  .taj-lesson-popup__promo p {
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .taj-lesson-popup__spark {
    display: none;
  }
}
