/* ============================================
   ADMIN TUTORIAL — coach-mark / spotlight tour
   Used by admin.html. Loaded after auth, auto-runs
   the first time a user logs in (per role + version).
   ============================================ */

.wp-tut-host {
  position: fixed;
  inset: 0;
  z-index: 100000;
  pointer-events: none;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wp-tut-host.is-active { pointer-events: auto; }

.wp-tut-blur {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 4, 0.38);
  -webkit-backdrop-filter: blur(4px) saturate(110%);
  backdrop-filter: blur(4px) saturate(110%);
  opacity: 0;
  transition: opacity 280ms cubic-bezier(0.16, 1, 0.3, 1);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.wp-tut-host.is-active .wp-tut-blur { opacity: 1; }

.wp-tut-spot {
  position: fixed;
  border-radius: 14px;
  box-shadow:
    0 0 0 4px rgba(234, 88, 12, 0.18),
    0 0 0 2px #ea580c,
    0 18px 60px rgba(234, 88, 12, 0.35);
  pointer-events: none;
  transition: top 380ms cubic-bezier(0.16, 1, 0.3, 1),
              left 380ms cubic-bezier(0.16, 1, 0.3, 1),
              width 380ms cubic-bezier(0.16, 1, 0.3, 1),
              height 380ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 220ms ease;
  opacity: 0;
}

.wp-tut-host.is-active .wp-tut-spot { opacity: 1; }

/* Tooltip card */
.wp-tut-card {
  position: fixed;
  width: min(380px, calc(100vw - 32px));
  background: #fefcfa;
  color: #1a0f08;
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 24px 60px rgba(20, 10, 4, 0.35),
    0 8px 20px rgba(20, 10, 4, 0.18);
  padding: 22px 22px 18px;
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition: opacity 260ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
              top 380ms cubic-bezier(0.16, 1, 0.3, 1),
              left 380ms cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(234, 88, 12, 0.18);
}

.wp-tut-host.is-active .wp-tut-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.wp-tut-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ea580c;
  background: #fff7ed;
  padding: 5px 10px;
  border-radius: 100px;
  margin-bottom: 10px;
}

.wp-tut-step-dot {
  width: 6px;
  height: 6px;
  background: #ea580c;
  border-radius: 50%;
  display: inline-block;
}

.wp-tut-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 8px;
  color: #1a0f08;
}

.wp-tut-body {
  font-size: 14px;
  line-height: 1.55;
  color: #4d3a2c;
  margin: 0 0 16px;
}

.wp-tut-body strong { color: #1a0f08; }
.wp-tut-body code {
  font-family: ui-monospace, SF Mono, Menlo, monospace;
  font-size: 12.5px;
  background: #fbf5ee;
  padding: 1px 6px;
  border-radius: 5px;
  color: #7c2d0a;
}

.wp-tut-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f3e4d2;
  padding-top: 14px;
  margin-top: 4px;
}

.wp-tut-progress {
  display: flex;
  gap: 4px;
  align-items: center;
}

.wp-tut-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f3e4d2;
  transition: background 200ms ease, width 200ms ease;
}

.wp-tut-pip.active {
  background: #ea580c;
  width: 18px;
  border-radius: 100px;
}

.wp-tut-pip.done {
  background: #fb923c;
}

.wp-tut-btn-row {
  display: flex;
  gap: 8px;
}

.wp-tut-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 180ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 120ms ease,
              border-color 180ms ease;
  letter-spacing: -0.005em;
}

.wp-tut-btn:focus-visible {
  outline: 3px solid #ea580c;
  outline-offset: 2px;
}

.wp-tut-btn-primary {
  background: #ea580c;
  color: #fff;
}

.wp-tut-btn-primary:hover { background: #c2410c; }
.wp-tut-btn-primary:active { transform: scale(0.97); }

.wp-tut-btn-ghost {
  background: transparent;
  color: #968274;
  border-color: transparent;
  padding: 9px 12px;
}

.wp-tut-btn-ghost:hover { color: #1a0f08; background: #fbf5ee; }

.wp-tut-btn-secondary {
  background: #fff;
  color: #4d3a2c;
  border-color: #f3e4d2;
}

.wp-tut-btn-secondary:hover { border-color: #ea580c; color: #ea580c; }

/* Welcome / completion modal — centered, no spotlight */
.wp-tut-modal {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 6, 4, 0.38);
  -webkit-backdrop-filter: blur(6px) saturate(110%);
  backdrop-filter: blur(6px) saturate(110%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.wp-tut-modal.is-active {
  opacity: 1;
  pointer-events: auto;
}

.wp-tut-modal-card {
  background: linear-gradient(180deg, #fefcfa 0%, #fff7ed 100%);
  width: min(460px, calc(100vw - 48px));
  border-radius: 22px;
  padding: 32px 28px 24px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 32px 80px rgba(20, 10, 4, 0.45);
  text-align: center;
  transform: translateY(12px) scale(0.97);
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(234, 88, 12, 0.2);
}

.wp-tut-modal.is-active .wp-tut-modal-card {
  transform: translateY(0) scale(1);
}

.wp-tut-modal-emoji {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 12px;
  display: block;
}

.wp-tut-modal-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.wp-tut-modal-body {
  font-size: 15px;
  line-height: 1.55;
  color: #4d3a2c;
  margin: 0 0 22px;
}

.wp-tut-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Re-launch button injected into Info/Guide view */
.wp-tut-relaunch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.wp-tut-relaunch:hover {
  background: #ea580c;
  color: #fff;
  border-color: #ea580c;
}

.wp-tut-relaunch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 4px;
}

/* ───── Floating "Tutorial" button — always visible for sales role ───── */
.wp-tut-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 99990;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ea580c, #c2410c);
  color: #fff;
  border: 0;
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.005em;
  padding: 12px 18px;
  border-radius: 100px;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 8px 24px rgba(234, 88, 12, 0.35),
    0 2px 8px rgba(20, 10, 4, 0.18);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.wp-tut-fab:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 14px 32px rgba(234, 88, 12, 0.45),
    0 2px 8px rgba(20, 10, 4, 0.25);
}

.wp-tut-fab:active {
  transform: translateY(0) scale(0.97);
}

.wp-tut-fab:focus-visible {
  outline: 3px solid #ea580c;
  outline-offset: 3px;
}

.wp-tut-fab-icon {
  font-size: 16px;
  line-height: 1;
}

.wp-tut-fab-pulse {
  position: absolute;
  inset: 0;
  border-radius: 100px;
  border: 2px solid #ea580c;
  opacity: 0;
  animation: wp-tut-pulse 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  pointer-events: none;
}

@keyframes wp-tut-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}

.wp-tut-fab.is-completed .wp-tut-fab-pulse { display: none; }

/* Chooser — picks which tour to run when FAB is clicked */
.wp-tut-chooser-card {
  width: min(440px, calc(100vw - 48px));
  text-align: left;
}

.wp-tut-chooser-card .wp-tut-modal-emoji {
  font-size: 36px;
  margin-bottom: 6px;
}

.wp-tut-chooser-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 10px;
}

.wp-tut-chooser-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #f3e4d2;
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
              background 180ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 120ms ease;
}

.wp-tut-chooser-item:hover {
  border-color: #ea580c;
  background: #fff7ed;
}

.wp-tut-chooser-item:active { transform: scale(0.99); }

.wp-tut-chooser-item:focus-visible {
  outline: 3px solid #ea580c;
  outline-offset: 2px;
}

.wp-tut-chooser-emoji {
  font-size: 26px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff7ed;
  border-radius: 12px;
}

.wp-tut-chooser-text { flex: 1; }

.wp-tut-chooser-title {
  font-size: 14px;
  font-weight: 800;
  color: #1a0f08;
  margin: 0 0 2px;
  letter-spacing: -0.005em;
}

.wp-tut-chooser-desc {
  font-size: 12px;
  color: #4d3a2c;
  margin: 0;
  line-height: 1.45;
}

.wp-tut-chooser-arrow {
  color: #ea580c;
  font-weight: 800;
  font-size: 18px;
}

/* Reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .wp-tut-blur,
  .wp-tut-spot,
  .wp-tut-card,
  .wp-tut-modal,
  .wp-tut-modal-card {
    transition: opacity 120ms linear !important;
    transform: none !important;
  }
}

/* Mobile / narrow */
@media (max-width: 720px) {
  .wp-tut-card {
    width: calc(100vw - 24px);
    left: 12px !important;
    right: 12px;
  }
}
