/*
 * ChatFU guided tour overlay.
 *
 * Used by framepack_web/static/js/chatfu-tour.js.
 * Palette matches the ChatFU surface: dark plum panels, coral to violet accent.
 */

.chatfu-tour {
  position: fixed;
  inset: 0;
  z-index: 1075;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  color: #fff9fb;
  -webkit-user-select: none;
  user-select: none;
}

.chatfu-tour[hidden] {
  display: none;
}

.chatfu-tour *,
.chatfu-tour *::before,
.chatfu-tour *::after {
  box-sizing: border-box;
}

.chatfu-tour:focus {
  outline: none;
}

.chatfu-tour__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 11, 28, 0.78);
}

.chatfu-tour__pointer {
  position: fixed;
  z-index: 1;
  border: 3px solid #ff9fb9;
  border-radius: 18px;
  box-shadow: 0 0 0 5px rgba(255,159,185,.22), 0 0 22px rgba(255,105,155,.9);
  pointer-events: none;
}

.chatfu-tour__pointer[hidden] { display: none; }

.chatfu-tour__panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: min(94vw, 420px);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.15rem 1.15rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background: linear-gradient(150deg, #30203b, #201528);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.chatfu-tour__panel :focus-visible {
  outline: 2px solid #ff8fad;
  outline-offset: 2px;
}

/* ---- close ---- */

.chatfu-tour__close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff9fb;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.chatfu-tour__close:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.14);
}

/* ---- portrait ---- */

.chatfu-tour__portrait {
  display: grid;
  place-items: center;
  align-self: center;
  width: 96px;
  height: 96px;
  margin-top: 0.35rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: linear-gradient(150deg, #8d5fbf, #b34d83);
}

.chatfu-tour__portrait[hidden] {
  display: none;
}

.chatfu-tour__portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chatfu-tour__note {
  margin: 0;
  color: #baa9bd;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.chatfu-tour__note[hidden] {
  display: none;
}

/* ---- text ---- */

.chatfu-tour__text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-right: 2rem;
  text-align: left;
}

.chatfu-tour__count {
  margin: 0;
  color: #efafc6;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chatfu-tour__title {
  margin: 0;
  color: #fff9fb;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.chatfu-tour__caption {
  margin: 0;
  color: #cbb9ce;
  font-size: 0.92rem;
  line-height: 1.45;
}

/* ---- progress dots ---- */

.chatfu-tour__dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem;
  margin: 0 -0.25rem;
}

.chatfu-tour__dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.chatfu-tour__dot-mark {
  display: block;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  transition: width 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.chatfu-tour__dot[aria-current="step"] .chatfu-tour__dot-mark {
  width: 20px;
  border-color: #ff9fb9;
  background: #ff9fb9;
}

.chatfu-tour__dot:hover .chatfu-tour__dot-mark {
  border-color: #ffc3d1;
}

/* ---- actions ---- */

.chatfu-tour__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chatfu-tour__button {
  padding: 0.55rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff9fb;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.chatfu-tour__button:hover:not([disabled]) {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
}

.chatfu-tour__button[disabled] {
  opacity: 0.4;
  cursor: default;
}

.chatfu-tour__button--primary {
  border-color: transparent;
  background: linear-gradient(110deg, #ff917d, #ff6d9b 70%, #c775e5);
  color: #281323;
}

.chatfu-tour__button--primary:hover:not([disabled]) {
  border-color: transparent;
  background: linear-gradient(110deg, #ffa08f, #ff84ae 70%, #d18aea);
}

.chatfu-tour__button--mute {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
}

.chatfu-tour__button--mute[hidden] {
  display: none;
}

.chatfu-tour__button--mute[aria-pressed="true"] {
  border-color: rgba(255, 159, 185, 0.5);
  color: #baa9bd;
}

/* ---- body scroll lock while the tour is open ---- */

body.chatfu-tour-open {
  overflow: hidden;
}

/* ---- reduced motion ---- */

.chatfu-tour--reduced-motion .chatfu-tour__panel,
.chatfu-tour--reduced-motion .chatfu-tour__button,
.chatfu-tour--reduced-motion .chatfu-tour__close,
.chatfu-tour--reduced-motion .chatfu-tour__dot-mark {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .chatfu-tour *,
  .chatfu-tour *::before,
  .chatfu-tour *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---- small screens ---- */

@media (max-width: 480px) {
  .chatfu-tour {
    padding: 0.75rem;
  }

  .chatfu-tour__panel {
    width: 100%;
    padding: 1rem;
    border-radius: 18px;
  }

  .chatfu-tour__portrait {
    width: 76px;
    height: 76px;
    border-radius: 18px;
  }

  .chatfu-tour__text {
    padding-right: 1.75rem;
  }

  .chatfu-tour__title {
    font-size: 1.15rem;
  }
}
