/* ============================================================
   Metablox New User Tutorial System
   Prefixes: tut-* (tutorial overlay), tck-* (tutorial checklist)
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────── */
.tut-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
}
.tut-overlay.tut-active {
  pointer-events: all;
}

/* SVG mask fills the viewport */
.tut-mask-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.25s ease;
}

/* ── Spotlight rect (animated via JS) ────────────────────── */
#tut-spotlight-rect {
  transition: x 0.35s cubic-bezier(0.4,0,0.2,1),
              y 0.35s cubic-bezier(0.4,0,0.2,1),
              width 0.35s cubic-bezier(0.4,0,0.2,1),
              height 0.35s cubic-bezier(0.4,0,0.2,1);
}

/* ── Tooltip card ────────────────────────────────────────── */
.tut-tooltip {
  position: fixed;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.12);
  width: 320px;
  padding: 24px;
  box-sizing: border-box;
  z-index: 9100;
  transition: top 0.35s cubic-bezier(0.4,0,0.2,1),
              left 0.35s cubic-bezier(0.4,0,0.2,1),
              opacity 0.2s ease;
}
.tut-tooltip.tut-entering {
  animation: tutFadeUp 0.3s ease both;
}
@keyframes tutFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Arrow pointing from tooltip toward target */
.tut-tooltip::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border: 10px solid transparent;
}
.tut-tooltip.arrow-top::before {
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: #ffffff;
}
.tut-tooltip.arrow-bottom::before {
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: #ffffff;
}
.tut-tooltip.arrow-left::before {
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: #ffffff;
}
.tut-tooltip.arrow-right::before {
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: #ffffff;
}
.tut-tooltip.arrow-none::before {
  display: none;
}

/* ── Tooltip inner parts ─────────────────────────────────── */
.tut-step-badge {
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f37442;
  margin-bottom: 8px;
}
.tut-emoji {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 10px;
}
.tut-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #111;
  margin-bottom: 8px;
  line-height: 1.3;
}
.tut-body {
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: #555;
  margin-bottom: 18px;
}

/* Progress dots */
.tut-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}
.tut-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e0e0e0;
  transition: background 0.2s, transform 0.2s;
}
.tut-dot.active {
  background: #f37442;
  transform: scale(1.25);
}
.tut-dot.done {
  background: #f37442;
  opacity: 0.45;
}

/* Action row */
.tut-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tut-skip {
  background: none;
  border: none;
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 13px;
  color: #aaa;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.tut-skip:hover {
  color: #666;
}
.tut-btn-group {
  display: flex;
  gap: 8px;
}
.tut-btn {
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.tut-btn:active {
  transform: scale(0.97);
}
.tut-btn-back {
  background: #f3f3f3;
  color: #555;
}
.tut-btn-back:hover {
  background: #e8e8e8;
}
.tut-btn-next {
  background: #f37442;
  color: #fff;
}
.tut-btn-next:hover {
  opacity: 0.88;
}
.tut-btn-finish {
  background: #f37442;
  color: #fff;
  padding: 9px 22px;
}

/* ── Tooltip: center/fullscreen variant (step 0 & last) ──── */
.tut-tooltip.tut-center {
  width: 380px;
  text-align: center;
  border-radius: 20px;
}
.tut-tooltip.tut-center .tut-dots {
  justify-content: center;
}
.tut-tooltip.tut-center .tut-actions {
  flex-direction: column;
  gap: 10px;
}
.tut-tooltip.tut-center .tut-btn-finish {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  border-radius: 10px;
}
.tut-tooltip.tut-center .tut-skip {
  margin-top: 4px;
}

/* ── Welcome splash (step 0) ─────────────────────────────── */
.tut-splash {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9050;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tut-splash-card {
  background: #fff;
  border-radius: 20px;
  width: 480px;
  max-width: calc(100vw - 32px);
  padding: 36px 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: tutFadeUp 0.35s ease both;
  text-align: center;
}
.tut-splash-logo {
  width: 52px;
  height: 52px;
  background-size: 100% 100%;
  margin: 0 auto 16px;
}
.tut-splash-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #111;
  margin-bottom: 8px;
}
.tut-splash-sub {
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 15px;
  color: #666;
  line-height: 1.55;
  margin-bottom: 28px;
}
.tut-splash-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
  text-align: left;
}
.tut-splash-hl {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fdf6f2;
  border-radius: 10px;
  padding: 12px 10px;
}
.tut-splash-hl-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 1px;
}
.tut-splash-hl-text {
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: #333;
  font-weight: 500;
}
.tut-splash-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tut-splash-btn-primary {
  background: #f37442;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  width: 100%;
}
.tut-splash-btn-primary:hover {
  opacity: 0.88;
}
.tut-splash-btn-secondary {
  background: none;
  border: none;
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 13px;
  color: #aaa;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
}
.tut-splash-btn-secondary:hover {
  color: #666;
}

/* ── Completion screen ────────────────────────────────────── */
.tut-done-card {
  background: #fff;
  border-radius: 20px;
  width: 400px;
  max-width: calc(100vw - 32px);
  padding: 32px 28px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: tutFadeUp 0.35s ease both;
  text-align: center;
}
.tut-done-emoji {
  font-size: 48px;
  margin-bottom: 12px;
}
.tut-done-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #111;
  margin-bottom: 8px;
}
.tut-done-sub {
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 22px;
}
.tut-done-btn {
  background: #f37442;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  margin-bottom: 8px;
  transition: opacity 0.15s;
}
.tut-done-btn:hover {
  opacity: 0.88;
}
.tut-done-btn-ghost {
  background: none;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  padding: 11px;
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s;
}
.tut-done-btn-ghost:hover {
  border-color: #f37442;
  color: #f37442;
}

/* ── Checklist floating panel ─────────────────────────────── */
.tck-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  width: 288px;
  z-index: 8000;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
}
.tck-panel.tck-collapsed {
  transform: translateY(calc(100% - 52px));
}
.tck-header {
  background: #f37442;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.tck-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tck-header-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.tck-header-count {
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
}
.tck-toggle-icon {
  color: #fff;
  font-size: 20px;
  transition: transform 0.25s;
}
.tck-collapsed .tck-toggle-icon {
  transform: rotate(180deg);
}
.tck-progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.3);
}
.tck-progress-fill {
  height: 100%;
  background: #fff;
  transition: width 0.4s ease;
}
.tck-body {
  padding: 12px 0 8px;
}
.tck-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.12s;
}
.tck-item:hover {
  background: #fdf6f2;
}
.tck-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  margin-top: 1px;
}
.tck-item.done .tck-checkbox {
  background: #f37442;
  border-color: #f37442;
}
.tck-check-icon {
  color: #fff;
  font-size: 14px;
  display: none;
}
.tck-item.done .tck-check-icon {
  display: block;
}
.tck-item-text {
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 13px;
  color: #333;
  line-height: 1.4;
  transition: color 0.2s, text-decoration 0.2s;
}
.tck-item.done .tck-item-text {
  color: #aaa;
  text-decoration: line-through;
}
.tck-item-desc {
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
}
.tck-dismiss {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid #f3f3f3;
  margin-top: 8px;
  padding: 10px;
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 12px;
  color: #bbb;
  cursor: pointer;
  transition: color 0.15s;
}
.tck-dismiss:hover {
  color: #888;
}

/* ── Help bubble ──────────────────────────────────────────── */
.tut-help-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(243,116,66,0.15);
  color: #f37442;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
  vertical-align: middle;
  transition: background 0.15s;
  font-family: 'Montserrat', sans-serif;
  position: relative;
}
.tut-help-bubble:hover {
  background: rgba(243,116,66,0.3);
}
.tut-help-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 12px;
  border-radius: 8px;
  width: 200px;
  text-align: left;
  z-index: 8500;
  white-space: normal;
  pointer-events: none;
}
.tut-help-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #222;
}
.tut-help-bubble:hover .tut-help-tip,
.tut-help-bubble:focus .tut-help-tip {
  display: block;
}

/* ── Restart tour button (in profile/menu) ───────────────── */
.tut-restart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1.5px solid #f37442;
  border-radius: 8px;
  padding: 8px 14px;
  font-family: 'SFPROTEXT', sans-serif;
  font-size: 13px;
  color: #f37442;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
.tut-restart-btn:hover {
  background: rgba(243,116,66,0.08);
}

/* ── Mobile responsive ────────────────────────────────────── */
@media screen and (max-width: 812px) {
  .tut-tooltip {
    width: calc(100vw - 32px);
    left: 16px !important;
    right: 16px !important;
    transform: none !important;
    bottom: 16px;
    top: auto !important;
  }
  .tut-tooltip::before {
    display: none !important;
  }
  .tut-tooltip.tut-center {
    width: calc(100vw - 32px);
  }

  .tut-splash-card {
    padding: 28px 20px 24px;
  }
  .tut-splash-highlights {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .tut-splash-title {
    font-size: 20px;
  }

  .tck-panel {
    bottom: 80px; /* above mobile nav */
    right: 12px;
    width: 260px;
  }
}
