/* ==========================================================================
   APPU Kid Onboarding Tour — spotlight overlay + Appu speech bubble.
   Dark by default; light overrides at the bottom. Dim is produced by a large
   box-shadow on the highlight box, so only the target stays bright.
   ========================================================================== */
.appu-tour {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
}
.appu-tour.is-open { display: block; }
/* Full-screen dim for centered (welcome / finish) steps with no spotlight. */
.appu-tour.is-centered { background: rgba(2, 8, 20, 0.74); }

.appu-tour-highlight {
  position: absolute;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(2, 8, 20, 0.74), 0 0 22px rgba(56, 189, 248, 0.35);
  outline: 3px solid #38bdf8;
  outline-offset: 2px;
  pointer-events: none;
  transition: left .35s cubic-bezier(.16,1,.3,1), top .35s cubic-bezier(.16,1,.3,1),
              width .35s cubic-bezier(.16,1,.3,1), height .35s cubic-bezier(.16,1,.3,1),
              opacity .25s ease;
}

.appu-tour-bubble {
  position: absolute;
  width: min(360px, calc(100vw - 32px));
  box-sizing: border-box;
  background: #0b1526;
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 18px;
  padding: 20px 18px 16px;
  color: #e6eefc;
  box-shadow: 0 20px 54px rgba(2, 8, 20, 0.6), 0 0 22px rgba(14, 165, 233, 0.12);
  pointer-events: auto;
  animation: appuTourPop .3s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes appuTourPop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.appu-tour.is-centered .appu-tour-bubble { animation-name: appuTourPopCenter; }
@keyframes appuTourPopCenter { from { opacity: 0; } to { opacity: 1; } }

.appu-tour-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #94a3b8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.appu-tour-close:hover { color: #e6eefc; background: rgba(148, 180, 220, 0.12); }

.appu-tour-appu {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 8px;
  animation: appuTourBob 2.4s ease-in-out infinite;
}
@keyframes appuTourBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.appu-tour-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  color: #e6eefc;
}

.appu-tour-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 14px 0 12px;
}
.appu-tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(148, 180, 220, 0.3);
  transition: width .25s ease, background .25s ease, border-radius .25s ease;
}
.appu-tour-dot.is-active { width: 18px; border-radius: 4px; background: #38bdf8; }

.appu-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.appu-tour-skip {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 6px;
}
.appu-tour-skip:hover { color: #cbd5e1; }
.appu-tour-next {
  border: 0;
  border-radius: 12px;
  padding: 11px 22px;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #04121f;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.3);
}
.appu-tour-next:hover { transform: translateY(-1px); }

/* Replay button in the menu drawer */
.nav-drawer-tour-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.08);
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.nav-drawer-tour-link:hover { border-color: #38bdf8; background: rgba(56, 189, 248, 0.14); }

@media (max-width: 480px) {
  .appu-tour-appu { font-size: 30px; }
  .appu-tour-text { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .appu-tour-highlight { transition: opacity .2s ease; }
  .appu-tour-bubble, .appu-tour-appu { animation: none; }
}

/* ---- Light theme ---- */
[data-theme="light"] .appu-tour.is-centered { background: rgba(15, 27, 46, 0.55); }
[data-theme="light"] .appu-tour-highlight {
  box-shadow: 0 0 0 9999px rgba(15, 27, 46, 0.5), 0 0 22px rgba(14, 165, 233, 0.35);
}
[data-theme="light"] .appu-tour-bubble {
  background: #ffffff;
  border-color: rgba(56, 189, 248, 0.45);
  color: #0f1b2e;
  box-shadow: 0 20px 54px rgba(15, 42, 80, 0.22);
}
[data-theme="light"] .appu-tour-text { color: #0f1b2e; }
[data-theme="light"] .appu-tour-next { color: #ffffff; }
