/* =============================================
   ROSIE Guided Onboarding Tour
   ============================================= */

/* Backdrop overlay */
.rosie-tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

.rosie-tour-backdrop.fade-in {
  animation: rosieFadeIn 0.3s ease forwards;
}

.rosie-tour-backdrop.fade-out {
  animation: rosieFadeOut 0.25s ease forwards;
}

/* Four overlay panels that form a frame around the cutout */
.rosie-tour-overlay-top,
.rosie-tour-overlay-bottom,
.rosie-tour-overlay-left,
.rosie-tour-overlay-right {
  position: fixed;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10001;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

/* Full-screen overlay when no element is highlighted */
.rosie-tour-overlay-full {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10001;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

/* Cutout highlight ring */
.rosie-tour-highlight {
  position: fixed;
  z-index: 10002;
  border-radius: 8px;
  box-shadow: 0 0 0 3px var(--bs-primary), 0 0 0 6px rgba(var(--bs-primary-rgb), 0.25);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pulse animation on highlighted element */
.rosie-tour-highlight::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 12px;
  border: 2px solid var(--bs-primary);
  opacity: 0;
  animation: rosiePulse 2s ease-in-out infinite;
}

/* Tooltip card */
.rosie-tour-tooltip {
  position: fixed;
  z-index: 10003;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: auto;
}

.rosie-tour-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Tooltip header */
.rosie-tour-tooltip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 0;
}

.rosie-tour-tooltip-header img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rosie-tour-tooltip-header .rosie-tour-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: #212529;
}

.rosie-tour-tooltip-header .rosie-tour-step-label {
  font-size: 0.68rem;
  color: #6c757d;
  margin-left: auto;
  white-space: nowrap;
}

/* Tooltip body */
.rosie-tour-tooltip-body {
  padding: 10px 16px 14px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #495057;
}

/* Tooltip footer */
.rosie-tour-tooltip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.rosie-tour-tooltip-footer .rosie-tour-skip {
  font-size: 0.72rem;
  color: #6c757d;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  transition: color 0.15s;
}

.rosie-tour-tooltip-footer .rosie-tour-skip:hover {
  color: #212529;
}

.rosie-tour-tooltip-nav {
  display: flex;
  gap: 8px;
}

.rosie-tour-tooltip-nav .btn {
  font-size: 0.78rem;
  padding: 5px 14px;
  border-radius: 6px;
}

/* Progress dots */
.rosie-tour-progress {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  padding: 0 16px 12px;
}

.rosie-tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #dee2e6;
  transition: all 0.25s ease;
}

.rosie-tour-dot.active {
  background: var(--bs-primary);
  width: 18px;
  border-radius: 3px;
}

.rosie-tour-dot.completed {
  background: var(--bs-primary);
}

/* Full-screen intro/outro card (centered, no element highlight) */
.rosie-tour-center-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 10003;
  width: 420px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
  text-align: center;
  padding: 32px 28px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.rosie-tour-center-card.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.rosie-tour-center-card img.rosie-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.rosie-tour-center-card h4 {
  font-weight: 700;
  margin-bottom: 8px;
  color: #212529;
}

.rosie-tour-center-card p {
  font-size: 0.88rem;
  color: #495057;
  line-height: 1.6;
  margin-bottom: 0;
}

.rosie-tour-center-card .rosie-tour-center-actions {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Pause banner — non-blocking floating bar for free-roam steps */
.rosie-tour-pause-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 10003;
  width: auto;
  max-width: 640px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.rosie-tour-pause-banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.rosie-tour-pause-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
}

.rosie-tour-pause-inner img.rosie-pause-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rosie-tour-pause-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #495057;
  flex: 1;
  min-width: 0;
}

.rosie-tour-pause-text strong {
  color: #212529;
}

.rosie-tour-pause-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.rosie-tour-pause-actions .rosie-tour-skip {
  font-size: 0.72rem;
  color: #6c757d;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

.rosie-tour-pause-actions .rosie-tour-skip:hover {
  color: #212529;
}

.rosie-tour-pause-actions .btn {
  font-size: 0.78rem;
  padding: 6px 16px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Animations */
@keyframes rosieFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rosieFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes rosiePulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.02); }
}

/* Mobile adjustments */
@media (max-width: 576px) {
  .rosie-tour-tooltip {
    width: calc(100vw - 24px);
    left: 12px !important;
    right: 12px !important;
  }

  .rosie-tour-center-card {
    width: calc(100vw - 24px);
    padding: 24px 20px;
  }

  .rosie-tour-pause-banner {
    width: calc(100vw - 24px);
    max-width: none;
    bottom: 12px;
  }

  .rosie-tour-pause-inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .rosie-tour-pause-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
