/* MindCare Onboarding Tour */

.mc-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  transition: opacity 0.4s ease;
  opacity: 0;
}

.mc-tour-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* SVG-based spotlight mask for smooth cutout */
.mc-tour-overlay svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Spotlight glow ring around the highlighted element */
.mc-tour-spotlight {
  position: absolute;
  z-index: 9999;
  border-radius: 12px;
  box-shadow:
    0 0 0 4px rgba(20, 184, 166, 0.25),
    0 0 24px rgba(20, 184, 166, 0.15);
  transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  opacity: 0;
}

.mc-tour-spotlight.active {
  opacity: 1;
}

/* Breathing pulse animation on spotlight */
@keyframes mcTourPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.25), 0 0 24px rgba(20, 184, 166, 0.15); }
  50%      { box-shadow: 0 0 0 6px rgba(20, 184, 166, 0.35), 0 0 32px rgba(20, 184, 166, 0.2); }
}

.mc-tour-spotlight.active {
  animation: mcTourPulse 2.4s ease-in-out infinite;
}


.mc-tour-tooltip {
  position: absolute;
  z-index: 10000;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.06);
  padding: 26px 28px 22px;
  max-width: 380px;
  min-width: 280px;
  font-family: 'Outfit', sans-serif;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.mc-tour-tooltip.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Tooltip arrow */
.mc-tour-tooltip::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-right: none;
  border-bottom: none;
  transform: rotate(45deg);
  z-index: -1;
}

/* Arrow positions */
.mc-tour-tooltip[data-position="bottom"]::before {
  top: -8px;
  left: 50%;
  margin-left: -7px;
  transform: rotate(45deg);
}

.mc-tour-tooltip[data-position="top"]::before {
  bottom: -8px;
  left: 50%;
  margin-left: -7px;
  transform: rotate(225deg);
}

.mc-tour-tooltip[data-position="left"]::before {
  right: -8px;
  top: 50%;
  margin-top: -7px;
  transform: rotate(135deg);
}

.mc-tour-tooltip[data-position="right"]::before {
  left: -8px;
  top: 50%;
  margin-top: -7px;
  transform: rotate(-45deg);
}

.mc-tour-tooltip[data-position="center"]::before {
  display: none;
}

/* Tooltip icon */
.mc-tour-tooltip-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #14B8A6 0%, #4F46E5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: white;
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* Tooltip title */
.mc-tour-tooltip-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 8px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Tooltip body text */
.mc-tour-tooltip-body {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.65;
  margin-bottom: 18px;
}

.mc-tour-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.mc-tour-progress-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.mc-tour-progress-bar {
  flex: 1;
  height: 4px;
  background: #E2E8F0;
  border-radius: 100px;
  margin-left: 12px;
  overflow: hidden;
}

.mc-tour-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #14B8A6, #4F46E5);
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mc-tour-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-tour-btn {
  padding: 10px 18px;
  border-radius: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mc-tour-btn:focus-visible {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
}

/* Primary button (Next / Finish) */
.mc-tour-btn-primary {
  background: linear-gradient(135deg, #14B8A6 0%, #4F46E5 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(20, 184, 166, 0.3);
  flex: 1;
  justify-content: center;
}

.mc-tour-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

.mc-tour-btn-primary:active {
  transform: translateY(0) scale(0.98);
}

/* Secondary button (Back) */
.mc-tour-btn-secondary {
  background: #F1F5F9;
  color: #475569;
}

.mc-tour-btn-secondary:hover {
  background: #E2E8F0;
  color: #0F172A;
}

/* Skip link */
.mc-tour-btn-skip {
  background: none;
  color: #94A3B8;
  font-size: 0.8rem;
  padding: 8px 12px;
  margin-left: auto;
}

.mc-tour-btn-skip:hover {
  color: #64748B;
  text-decoration: underline;
}


.mc-tour-welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.mc-tour-welcome-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.mc-tour-welcome-card {
  background: #FFFFFF;
  border-radius: 28px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.18),
    0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 44px 40px 36px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  opacity: 0;
}

.mc-tour-welcome-overlay.visible .mc-tour-welcome-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Welcome icon */
.mc-tour-welcome-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, #14B8A6 0%, #4F46E5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  font-size: 1.8rem;
  color: white;
  box-shadow: 0 8px 28px rgba(20, 184, 166, 0.35);
}

.mc-tour-welcome-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.mc-tour-welcome-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 32px;
}

.mc-tour-welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mc-tour-welcome-start {
  width: 100%;
  padding: 14px 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, #14B8A6 0%, #4F46E5 100%);
  color: white;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 6px 24px rgba(20, 184, 166, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mc-tour-welcome-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(20, 184, 166, 0.4);
}

.mc-tour-welcome-start:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.5);
  outline-offset: 2px;
}

.mc-tour-welcome-skip {
  width: 100%;
  padding: 12px 24px;
  border-radius: 14px;
  background: transparent;
  color: #94A3B8;
  border: 1px solid #E2E8F0;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mc-tour-welcome-skip:hover {
  background: #F8FAFC;
  color: #64748B;
  border-color: #CBD5E1;
}

.mc-tour-welcome-skip:focus-visible {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
}


.mc-tour-nav-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(79, 70, 229, 0.06));
  border: 1px solid rgba(20, 184, 166, 0.15);
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 0.82rem;
  color: #0F766E;
  font-weight: 500;
}

.mc-tour-nav-prompt i {
  color: #0F766E;
  font-size: 0.9rem;
}


.mc-tour-replay-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 18px;
  background: rgba(79, 70, 229, 0.06);
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4F46E5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mc-tour-replay-btn:hover {
  background: rgba(79, 70, 229, 0.1);
  border-color: rgba(79, 70, 229, 0.25);
  transform: translateY(-1px);
}

.mc-tour-replay-btn i {
  font-size: 1rem;
}

.mc-tour-replay-btn:focus-visible {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
}


body.theme-charcoal .mc-tour-tooltip,
body.theme-charcoal .mc-tour-welcome-card {
  background: #1E1E1E;
  border-color: #333;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 4px 16px rgba(0, 0, 0, 0.2);
}

body.theme-charcoal .mc-tour-tooltip::before {
  background: #1E1E1E;
  border-color: #333;
}

body.theme-charcoal .mc-tour-tooltip-title,
body.theme-charcoal .mc-tour-welcome-title {
  color: #F1F5F9;
}

body.theme-charcoal .mc-tour-tooltip-body,
body.theme-charcoal .mc-tour-welcome-subtitle {
  color: #94A3B8;
}

body.theme-charcoal .mc-tour-progress-bar {
  background: #333;
}

body.theme-charcoal .mc-tour-btn-secondary {
  background: #2A2A2A;
  color: #94A3B8;
}

body.theme-charcoal .mc-tour-btn-secondary:hover {
  background: #333;
  color: #E2E8F0;
}

body.theme-charcoal .mc-tour-welcome-skip {
  border-color: #333;
  color: #64748B;
}

body.theme-charcoal .mc-tour-welcome-skip:hover {
  background: #2A2A2A;
  color: #94A3B8;
}

body.theme-charcoal .mc-tour-nav-prompt {
  background: rgba(20, 184, 166, 0.08);
  border-color: rgba(20, 184, 166, 0.18);
  color: #5EEAD4;
}

body.theme-charcoal .mc-tour-replay-btn {
  background: rgba(165, 180, 252, 0.08);
  border-color: rgba(165, 180, 252, 0.18);
  color: #A5B4FC;
}

body.theme-charcoal .mc-tour-replay-btn:hover {
  background: rgba(165, 180, 252, 0.14);
}


@media (max-width: 600px) {
  .mc-tour-tooltip {
    max-width: calc(100vw - 32px);
    min-width: auto;
    width: calc(100vw - 32px);
    padding: 22px 20px 18px;
    border-radius: 18px;
    /* On small screens, center the tooltip */
    left: 16px !important;
    right: 16px !important;
  }

  .mc-tour-tooltip::before {
    display: none;
  }

  .mc-tour-welcome-card {
    padding: 32px 24px 28px;
    width: 92%;
    border-radius: 22px;
  }

  .mc-tour-welcome-title {
    font-size: 1.35rem;
  }

  .mc-tour-welcome-subtitle {
    font-size: 0.88rem;
  }

  .mc-tour-welcome-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    border-radius: 18px;
  }

  .mc-tour-controls {
    flex-wrap: wrap;
  }

  .mc-tour-btn {
    padding: 10px 14px;
    font-size: 0.82rem;
  }

  .mc-tour-btn-primary {
    order: -1;
    flex-basis: 100%;
  }
}

@media (max-width: 380px) {
  .mc-tour-tooltip {
    padding: 18px 16px 14px;
  }

  .mc-tour-tooltip-title {
    font-size: 0.95rem;
  }

  .mc-tour-tooltip-body {
    font-size: 0.82rem;
  }
}


@media (prefers-reduced-motion: reduce) {
  .mc-tour-tooltip,
  .mc-tour-spotlight,
  .mc-tour-overlay,
  .mc-tour-welcome-overlay,
  .mc-tour-welcome-card,
  .mc-tour-progress-fill {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}


/* Ensure tour elements are above crisis overlays etc. */
.mc-tour-overlay.active ~ .mc-tour-tooltip,
.mc-tour-overlay.active ~ .mc-tour-spotlight {
  z-index: 10000;
}
