/* Tour layer: spotlight + tooltip. Positions are set from JS, never hard-coded. */

.lk-tour-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Above anything the simulated product can stack (its modals sit near
     1000), so the tooltip is never covered by a page's own drawer. */
  z-index: 100000;
}

.lk-tour-layer > * {
  pointer-events: auto;
}

.lk-spotlight {
  position: fixed;
  border-radius: 12px;
  border: 2px solid var(--lk-orange);
  box-shadow: 0 0 0 9999px rgba(15, 41, 53, 0.55);
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.22s ease,
    top 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    left 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.lk-spotlight.is-visible {
  opacity: 1;
}

.lk-tooltip {
  position: fixed;
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  color: var(--lk-fg-muted);
  border-radius: 16px;
  box-shadow: var(--lk-shadow-md);
  padding: 16px 18px 14px;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    top 0.24s ease,
    left 0.24s ease;
}

.lk-tooltip.is-visible {
  opacity: 1;
  transform: none;
}

.lk-tooltip__arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
}

.lk-tooltip[data-placement='bottom'] .lk-tooltip__arrow {
  top: -6px;
  margin-left: -6px;
}
.lk-tooltip[data-placement='top'] .lk-tooltip__arrow {
  bottom: -6px;
  margin-left: -6px;
}
.lk-tooltip[data-placement='right'] .lk-tooltip__arrow {
  left: -6px;
  margin-top: -6px;
}
.lk-tooltip[data-placement='left'] .lk-tooltip__arrow {
  right: -6px;
  margin-top: -6px;
}

.lk-tooltip__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.lk-tooltip__progress {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--lk-accent);
}

.lk-tooltip__head-actions {
  display: flex;
  gap: 2px;
}

.lk-tooltip__head-actions .lk-icon-btn {
  width: 30px;
  height: 30px;
  color: var(--lk-fg-subtle);
}

.lk-tooltip__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--lk-fg);
  margin: 0 0 6px;
}

.lk-tooltip__body {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 14px;
}

.lk-tooltip__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--lk-teal-100);
  padding-top: 12px;
}

.lk-tooltip__foot-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lk-tooltip .lk-btn--ghost {
  border-color: var(--lk-ink-500);
  color: var(--lk-fg-muted);
}

/* Narrow viewports: bottom sheet instead of a floating bubble. */
.lk-tooltip--sheet {
  top: auto !important;
  bottom: 0;
  left: 0 !important;
  width: 100%;
  border-radius: 18px 18px 0 0;
  padding: 18px 18px 20px;
  box-shadow: 0 -12px 40px rgba(15, 41, 53, 0.3);
}

.lk-tooltip--sheet .lk-tooltip__foot {
  padding-top: 14px;
}

@media (max-width: 760px) {
  .lk-spotlight {
    box-shadow: 0 0 0 9999px rgba(15, 41, 53, 0.42);
  }
}

/* =========================================================================
   ACTION HINTS — manual exploration
   A fixed-position ring in the tour layer: it marks the next action without
   taking up any space in the page, so no layout can shift.
   ========================================================================= */

.lk-hint {
  position: fixed;
  pointer-events: none;
  opacity: 0;
  /* Only the fade is animated: animating the geometry makes the ring trail
     its target while the page scrolls. */
  transition: opacity 0.3s ease;
  box-shadow:
    0 0 0 2px var(--lk-orange),
    0 0 0 6px rgba(231, 93, 29, 0.28);
  animation: lk-hint-pulse 1.9s ease-in-out infinite;
}

.lk-hint.is-visible {
  opacity: 1;
}

@keyframes lk-hint-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 2px var(--lk-orange),
      0 0 0 5px rgba(231, 93, 29, 0.3);
  }
  50% {
    box-shadow:
      0 0 0 2px var(--lk-orange),
      0 0 0 11px rgba(231, 93, 29, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lk-hint {
    animation: none;
  }
}

/* Block user-initiated scroll while the guided spotlight is active.
   Both containers need overflow: hidden — .lk-stage is the outer scroll box,
   .lk-mock is the inner one used by canonical HTML pages. */
body:has(.lk-spotlight.is-visible) .lk-stage,
body:has(.lk-spotlight.is-visible) .lk-mock {
  overflow: hidden;
}

/* Mobile alert banner — shown on viewports < 1024px, dismissed via ×. */

body.has-mobile-alert .lk-app {
  padding-top: 40px;
}

.lk-mobile-alert {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--lk-orange, #e75d1d);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.lk-mobile-alert.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.lk-mobile-alert__text {
  flex: 1;
  margin: 0;
}

.lk-mobile-alert__close {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 4px;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  line-height: 0;
}

.lk-mobile-alert__close:hover {
  opacity: 1;
}
