/**
 * TUTORIAL & GUEST PROMPT STYLES  (tutorial.css)
 * ──────────────────────────────────────────────────────────
 * Covers:
 *  1. Guest Prompt Modal  (.guest-prompt-*)
 *  2. Tutorial Spotlight Overlay (.tut-*)
 */

/* ════════════════════════════════════════════════════════
   1.  GUEST PROMPT MODAL
   Triggered after user scrolls or stays 8 seconds as guest
════════════════════════════════════════════════════════ */

.guest-prompt-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 12, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.guest-prompt-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

.guest-prompt-card {
  background: #fff;
  border-radius: 24px;
  max-width: 460px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.28), 0 8px 24px rgba(44,94,59,0.18);
  transform: translateY(28px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
  opacity: 0;
}
.guest-prompt-backdrop.visible .guest-prompt-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.guest-prompt-hero {
  position: relative;
  height: 160px;
  background: linear-gradient(135deg, #1a3d25 0%, #2C5E3B 45%, #4a8c5c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.guest-prompt-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.guest-prompt-emoji-row {
  font-size: 3rem;
  letter-spacing: 8px;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.3));
  position: relative;
  z-index: 1;
  animation: floatBounce 3s ease-in-out infinite;
}
@keyframes floatBounce {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.guest-prompt-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 2;
  transition: background 0.2s;
}
.guest-prompt-close:hover { background: rgba(255,255,255,0.28); }

.guest-prompt-body {
  padding: 28px 32px 32px;
  text-align: center;
}
.guest-prompt-body h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 10px;
  line-height: 1.25;
}
.guest-prompt-body p {
  font-size: 0.92rem;
  color: #5a6a5f;
  line-height: 1.65;
  margin: 0 0 24px;
}
.guest-prompt-perks {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.guest-prompt-perks li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: #3a4a3e;
  font-weight: 500;
}
.guest-prompt-perks li .perk-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(44, 94, 59, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.guest-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.guest-prompt-btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #2C5E3B, #3d7a52);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(44,94,59,0.35);
}
.guest-prompt-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(44,94,59,0.45);
}
.guest-prompt-btn-skip {
  font-size: 0.82rem;
  color: #8a9a8e;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}
.guest-prompt-btn-skip:hover { color: #5a6a5f; }


/* ════════════════════════════════════════════════════════
   2.  TUTORIAL OVERLAY ENGINE
════════════════════════════════════════════════════════ */

/* Full-screen dimming backdrop */
.tut-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9500;
  pointer-events: all;
  /* The spotlight hole is cut via clip-path on a pseudo-element */
}

/* Dark overlay - we use an SVG mask approach via box-shadow trick */
.tut-highlight-box {
  position: fixed;
  z-index: 9501;
  border-radius: 10px;
  pointer-events: none;
  transition: all 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  /* The actual dark overlay is done with a huge box-shadow */
  box-shadow:
    0 0 0 4px rgba(255, 220, 80, 0.8),        /* glowing ring */
    0 0 0 6px rgba(255, 220, 80, 0.3),         /* outer glow */
    0 0 0 4000px rgba(5, 20, 10, 0.72);        /* massive dark backdrop */
}

/* Breathing pulse on the highlight */
@keyframes tutPulse {
  0%, 100% { box-shadow:
    0 0 0 4px rgba(255, 220, 80, 0.9),
    0 0 0 8px rgba(255, 220, 80, 0.25),
    0 0 0 4000px rgba(5, 20, 10, 0.72); }
  50% { box-shadow:
    0 0 0 6px rgba(255, 220, 80, 0.7),
    0 0 0 14px rgba(255, 220, 80, 0.12),
    0 0 0 4000px rgba(5, 20, 10, 0.72); }
}
.tut-highlight-box.pulsing {
  animation: tutPulse 2s ease-in-out infinite;
}

/* Tooltip card */
.tut-tooltip {
  position: fixed;
  z-index: 10050;
  width: min(340px, calc(100vw - 32px));
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22), 0 4px 16px rgba(44,94,59,0.12);
  overflow: hidden;
  transition: all 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  transform: scale(0.88) translateY(10px);
}
.tut-tooltip.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Native app: bottom sheet tooltip — never covers highlighted content */
.capacitor-native .tut-tooltip--native-sheet {
  left: 16px !important;
  right: 16px !important;
  bottom: 16px !important;
  top: auto !important;
  width: auto !important;
  max-width: none;
  max-height: 42vh;
  overflow-y: auto;
  z-index: 10050;
}

.capacitor-native .tut-tooltip__title {
  font-size: 1rem;
}

.capacitor-native .tut-tooltip__desc {
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 12px;
}

/* Tooltip accent stripe */
.tut-tooltip__stripe {
  height: 5px;
  background: linear-gradient(90deg, #2C5E3B, #7E9F3D, #F1C40F);
}

.tut-tooltip__body {
  padding: 20px 22px 18px;
}

.tut-tooltip__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.tut-tooltip__icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.tut-tooltip__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.25;
  margin: 0;
  padding-top: 4px;
}
.tut-tooltip__desc {
  font-size: 0.875rem;
  color: #4a5a4e;
  line-height: 1.6;
  margin: 0 0 16px;
}

/* Progress dots */
.tut-tooltip__progress {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 16px;
}
.tut-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d4e0d8;
  transition: all 0.25s ease;
  flex-shrink: 0;
}
.tut-dot.active {
  background: #2C5E3B;
  width: 20px;
  border-radius: 4px;
}
.tut-dot.done {
  background: #7E9F3D;
}

/* Navigation row */
.tut-tooltip__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tut-skip-btn {
  font-size: 0.78rem;
  color: #9aaa9e;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  transition: color 0.2s;
}
.tut-skip-btn:hover { color: #5a6a5e; text-decoration: underline; }

.tut-nav-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tut-back-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid #d0ddd4;
  background: transparent;
  color: #4a5a4e;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
}
.tut-back-btn:hover { background: #f0f5f1; }
.tut-back-btn:disabled { opacity: 0.3; cursor: default; }

.tut-next-btn {
  padding: 8px 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2C5E3B, #3d7a52);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s;
  box-shadow: 0 3px 10px rgba(44,94,59,0.3);
}
.tut-next-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(44,94,59,0.4);
}
.tut-next-btn.finish {
  background: linear-gradient(135deg, #b7860c, #d4a017);
  box-shadow: 0 3px 10px rgba(183,134,12,0.3);
}
.tut-next-btn.finish:hover {
  box-shadow: 0 6px 16px rgba(183,134,12,0.4);
}

/* Step counter badge */
.tut-step-badge {
  font-size: 0.72rem;
  color: #8a9a8e;
  font-weight: 500;
  margin-right: auto;
  padding-left: 2px;
}

/* Welcome / Finale full-screen card (no spotlight) */
.tut-welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(5, 20, 10, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.tut-welcome-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.tut-welcome-card {
  background: #ffffff;
  border-radius: 24px;
  max-width: 420px;
  width: 100%;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,0.28);
  transform: translateY(24px) scale(0.95);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
  opacity: 0;
}
.tut-welcome-overlay.visible .tut-welcome-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.tut-welcome-card__hero {
  padding: 36px 32px 24px;
  background: linear-gradient(135deg, #1a3d25 0%, #2C5E3B 100%);
  position: relative;
  overflow: hidden;
}
.tut-welcome-card__hero::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  top: -60px;
  right: -60px;
}
.tut-welcome-card__emoji {
  font-size: 4.5rem;
  display: block;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.tut-welcome-card__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  position: relative;
  z-index: 1;
}
.tut-welcome-card__subtitle {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.75);
  margin: 8px 0 0;
  position: relative;
  z-index: 1;
}
.tut-welcome-card__body {
  padding: 24px 32px 32px;
}
.tut-welcome-card__body p {
  font-size: 0.92rem;
  color: #4a5a4e;
  line-height: 1.65;
  margin: 0 0 24px;
}
.tut-welcome-card__body .tut-next-btn,
.tut-welcome-card__body .tut-skip-btn {
  width: 100%;
  justify-content: center;
}
.tut-welcome-card__body .tut-skip-btn {
  display: block;
  text-align: center;
  margin-top: 10px;
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .tut-tooltip {
    width: calc(100vw - 24px);
  }
  .guest-prompt-body {
    padding: 22px 22px 28px;
  }
  .guest-prompt-body h2 {
    font-size: 1.25rem;
  }
}
