/**
 * Vitrino Onboarding Missions, Spotlight Tour & Contextual Help Tooltips 2.0
 * سیستم تعاملی ماموریت‌های شروع به کار، تور چند ماژوله، تمرین عملی و هاب انتخاب بخش
 */

:root {
  --mission-primary: #2563eb;
  --mission-primary-glow: rgba(37, 99, 235, 0.28);
  --mission-success: #10b981;
  --mission-accent: #8b5cf6;
  --tour-overlay-bg: rgba(15, 23, 42, 0.42);
}

[data-theme="dark"] {
  --tour-overlay-bg: rgba(15, 23, 42, 0.58);
}

/* ==========================================================================
   1. Navbar Mission Pulse Dot
   ========================================================================== */
.mission-pulse-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: missionPulse 1.8s infinite;
}

@keyframes missionPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* ==========================================================================
   2. Floating Onboarding Missions Widget
   ========================================================================== */
.onboarding-widget-wrapper {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 1050;
  direction: rtl;
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Floating Launch Button */
.onboarding-launcher-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  padding: 10px 18px 10px 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25), 0 0 15px rgba(37, 99, 235, 0.2);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-launcher-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(37, 99, 235, 0.35);
  color: #ffffff;
}

.onboarding-launcher-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
}

.onboarding-launcher-text {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.onboarding-launcher-progress {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 20px;
  color: #38bdf8;
  font-weight: 800;
}

/* Expanded Missions Modal Card */
.onboarding-card {
  position: absolute;
  bottom: 60px;
  left: 0;
  width: 380px;
  max-width: calc(100vw - 40px);
  max-height: 540px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18), 0 0 20px rgba(37, 99, 235, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  visibility: hidden;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .onboarding-card,
body.dark-theme .onboarding-card {
  background: rgba(15, 23, 42, 0.98);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 25px rgba(56, 189, 248, 0.15);
}

.onboarding-card.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

/* Header */
.onboarding-card-header {
  padding: 16px 18px 14px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.onboarding-card-title {
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.onboarding-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.onboarding-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Progress bar inside card */
.onboarding-progress-section {
  padding: 14px 18px 12px;
  background: rgba(241, 245, 249, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .onboarding-progress-section,
body.dark-theme .onboarding-progress-section {
  background: rgba(30, 41, 59, 0.7);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.onboarding-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #475569;
}

[data-theme="dark"] .onboarding-progress-meta,
body.dark-theme .onboarding-progress-meta {
  color: #94a3b8;
}

.onboarding-progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

[data-theme="dark"] .onboarding-progress-track,
body.dark-theme .onboarding-progress-track {
  background: #334155;
}

.onboarding-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #10b981);
  border-radius: 10px;
  transition: width 0.4s ease;
}

/* Missions List */
.onboarding-missions-list {
  padding: 10px 14px;
  overflow-y: auto;
  flex: 1;
}

.onboarding-mission-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  margin-bottom: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.onboarding-mission-item:hover {
  background: rgba(37, 99, 235, 0.05);
  border-color: rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .onboarding-mission-item:hover,
body.dark-theme .onboarding-mission-item:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.25);
}

.onboarding-mission-item.completed {
  opacity: 0.75;
}

.onboarding-mission-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: transparent;
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 2px;
  transition: all 0.2s;
  background: #ffffff;
}

[data-theme="dark"] .onboarding-mission-checkbox,
body.dark-theme .onboarding-mission-checkbox {
  background: #1e293b;
  border-color: #475569;
}

.onboarding-mission-item.completed .onboarding-mission-checkbox {
  background: #10b981;
  border-color: #10b981;
  color: white;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.onboarding-mission-content {
  flex: 1;
}

.onboarding-mission-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
  margin-bottom: 2px;
}

[data-theme="dark"] .onboarding-mission-title,
body.dark-theme .onboarding-mission-title {
  color: #f1f5f9;
}

.onboarding-mission-item.completed .onboarding-mission-title {
  text-decoration: line-through;
  color: #94a3b8;
}

.onboarding-mission-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

[data-theme="dark"] .onboarding-mission-desc,
body.dark-theme .onboarding-mission-desc {
  color: #94a3b8;
}

.onboarding-mission-action {
  font-size: 11px;
  color: #2563eb;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
}

[data-theme="dark"] .onboarding-mission-action,
body.dark-theme .onboarding-mission-action {
  color: #38bdf8;
}

/* Footer with Tour Hub Button */
.onboarding-card-footer {
  padding: 12px 16px;
  background: rgba(248, 250, 252, 0.95);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

[data-theme="dark"] .onboarding-card-footer,
body.dark-theme .onboarding-card-footer {
  background: rgba(15, 23, 42, 0.95);
  border-top-color: rgba(255, 255, 255, 0.06);
}

.btn-start-tour {
  flex: 1;
  padding: 9px 14px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s;
}

.btn-start-tour:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
  color: white;
}

.btn-reset-missions {
  padding: 8px 10px;
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s;
}

[data-theme="dark"] .btn-reset-missions,
body.dark-theme .btn-reset-missions {
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-reset-missions:hover {
  color: #ef4444;
  border-color: #ef4444;
}

/* ==========================================================================
   3. TOUR HUB MODAL (پنجره انتخاب ماژول تور)
   ========================================================================== */
.tour-hub-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1055;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.tour-hub-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.tour-hub-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.96);
  width: 860px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 60px);
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25), 0 0 35px rgba(37, 99, 235, 0.12);
  z-index: 1058;
  direction: rtl;
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .tour-hub-modal,
body.dark-theme .tour-hub-modal {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65), 0 0 40px rgba(56, 189, 248, 0.15);
}

.tour-hub-modal.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
}

.tour-hub-header {
  padding: 22px 26px 18px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(139, 92, 246, 0.05));
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

[data-theme="dark"] .tour-hub-header,
body.dark-theme .tour-hub-header {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(139, 92, 246, 0.1));
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.tour-hub-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 800;
  margin-bottom: 8px;
}

[data-theme="dark"] .tour-hub-badge,
body.dark-theme .tour-hub-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.tour-hub-title {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

[data-theme="dark"] .tour-hub-title,
body.dark-theme .tour-hub-title {
  color: #f8fafc;
}

.tour-hub-subtitle {
  font-size: 12.5px;
  color: #64748b;
  margin-bottom: 0;
  line-height: 1.5;
}

[data-theme="dark"] .tour-hub-subtitle,
body.dark-theme .tour-hub-subtitle {
  color: #94a3b8;
}

.tour-hub-close-btn {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
  flex-shrink: 0;
}

[data-theme="dark"] .tour-hub-close-btn,
body.dark-theme .tour-hub-close-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.tour-hub-close-btn:hover {
  background: #ef4444;
  color: white;
}

.tour-hub-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

/* Fast Comprehensive Tour Banner */
.tour-comprehensive-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(56, 189, 248, 0.08));
  border: 1.5px solid rgba(37, 99, 235, 0.25);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.22s ease;
}

.tour-comprehensive-card:hover {
  transform: translateY(-2px);
  border-color: #2563eb;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .tour-comprehensive-card,
body.dark-theme .tour-comprehensive-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(56, 189, 248, 0.12));
  border-color: rgba(56, 189, 248, 0.3);
}

.tour-comp-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.tour-comp-content {
  flex: 1;
}

.tour-comp-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #1e293b;
}

[data-theme="dark"] .tour-comp-title,
body.dark-theme .tour-comp-title {
  color: #f1f5f9;
}

.tour-comp-desc {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.45;
}

[data-theme="dark"] .tour-comp-desc,
body.dark-theme .tour-comp-desc {
  color: #94a3b8;
}

.tour-comp-btn {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
}

.tour-comprehensive-card:hover .tour-comp-btn {
  background: #1d4ed8;
  transform: translateX(-3px);
}

/* Modules Grid */
.tour-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.tour-module-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .tour-module-card,
body.dark-theme .tour-module-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}

.tour-module-card:hover {
  transform: translateY(-3px);
  border-color: #38bdf8;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 0 15px rgba(56, 189, 248, 0.15);
}

[data-theme="dark"] .tour-module-card:hover,
body.dark-theme .tour-module-card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(56, 189, 248, 0.2);
}

.tour-module-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.tour-module-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.tour-module-badge-status {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.tour-module-badge-status.completed {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.tour-module-badge-status.new {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

[data-theme="dark"] .tour-module-badge-status.new {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.tour-module-title {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
}

[data-theme="dark"] .tour-module-title,
body.dark-theme .tour-module-title {
  color: #f1f5f9;
}

.tour-module-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 12px;
  flex: 1;
}

[data-theme="dark"] .tour-module-desc,
body.dark-theme .tour-module-desc {
  color: #94a3b8;
}

.tour-module-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 10px;
}

[data-theme="dark"] .tour-module-footer,
body.dark-theme .tour-module-footer {
  border-top-color: rgba(255, 255, 255, 0.05);
}

.tour-module-duration {
  font-size: 10.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tour-module-start-link {
  font-size: 11.5px;
  font-weight: 700;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

[data-theme="dark"] .tour-module-start-link {
  color: #38bdf8;
}

.tour-module-card:hover .tour-module-start-link {
  text-decoration: underline;
}

/* Hub Modal Footer */
.tour-hub-footer {
  padding: 12px 24px;
  background: rgba(248, 250, 252, 0.9);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

[data-theme="dark"] .tour-hub-footer,
body.dark-theme .tour-hub-footer {
  background: rgba(15, 23, 42, 0.9);
  border-top-color: rgba(255, 255, 255, 0.06);
}

.tour-hub-footer-stat {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .tour-hub-footer-stat {
  color: #94a3b8;
}

/* ==========================================================================
   4. SPOTLIGHT TOUR OVERLAY & INTERACTIVE STEP POPOVER
   ========================================================================== */

/* The dark translucent overlay - ZERO BLUR! Everything behind is crystal clear! */
.tour-overlay {
  position: fixed;
  inset: 0;
  background: var(--tour-overlay-bg);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 1060;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: auto;
}

.tour-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Spotlight Highlight Frame with ultra-sharp glowing cutout */
.tour-spotlight-frame {
  position: fixed;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px var(--tour-overlay-bg), 0 0 25px rgba(56, 189, 248, 0.5);
  border: 2.5px solid #38bdf8;
  z-index: 1065;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  display: none;
  animation: spotlightPulse 2.4s infinite alternate;
}

/* Ensure when tour is closed, overlay and frame are 100% eradicated */
body:not(.tour-active) #tourSpotlightFrame,
body:not(.tour-active) .tour-spotlight-frame,
body:not(.tour-active) #tourOverlay,
body:not(.tour-active) .tour-overlay,
body:not(.tour-active) #tourStepCard,
body:not(.tour-active) .tour-step-card,
.tour-overlay:not(.active) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body:not(.tour-active) #tourSpotlightFrame,
body:not(.tour-active) .tour-spotlight-frame,
.tour-spotlight-frame:not(.active) {
  display: none !important;
  box-shadow: none !important;
  border: none !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

body:not(.tour-active) #tourStepCard,
body:not(.tour-active) .tour-step-card,
.tour-step-card:not(.active) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@keyframes spotlightPulse {
  0% { border-color: #38bdf8; box-shadow: 0 0 0 9999px var(--tour-overlay-bg), 0 0 15px rgba(56, 189, 248, 0.4); }
  100% { border-color: #60a5fa; box-shadow: 0 0 0 9999px var(--tour-overlay-bg), 0 0 28px rgba(96, 165, 250, 0.7); }
}

.tour-spotlight-frame.active {
  display: block;
}

/* Success status on interactive validation */
.tour-spotlight-frame.task-success {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 9999px var(--tour-overlay-bg), 0 0 30px rgba(16, 185, 129, 0.75) !important;
  animation: none;
}

/* Elevate the active interactive element so user can type/click directly */
.tour-interactive-target {
  position: relative !important;
  z-index: 1066 !important;
  pointer-events: auto !important;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.35) !important;
  transition: box-shadow 0.25s ease !important;
}

select.tour-interactive-target,
.form-select.tour-interactive-target {
  cursor: pointer !important;
  background-color: #ffffff !important;
}

[data-theme="dark"] select.tour-interactive-target,
body.dark-theme select.tour-interactive-target {
  background-color: #1e293b !important;
}

.tour-interactive-target.task-success {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.5) !important;
  border-color: #10b981 !important;
}

/* Tour Step Popover Card */
.tour-step-card {
  position: fixed;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 30px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 20px;
  padding: 18px 20px 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 25px rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(37, 99, 235, 0.2);
  z-index: 1070;
  direction: rtl;
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
  display: none;
  animation: tourCardPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] .tour-step-card,
body.dark-theme .tour-step-card {
  background: #0f172a;
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65), 0 0 35px rgba(56, 189, 248, 0.2);
}

.tour-step-card.active {
  display: block;
}

@keyframes tourCardPop {
  0% { transform: scale(0.92) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes tourCardShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.tour-step-card.tour-card-shake {
  animation: tourCardShake 0.4s ease-in-out !important;
}

.tour-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.tour-module-badge {
  font-size: 11px;
  font-weight: 800;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

[data-theme="dark"] .tour-module-badge,
body.dark-theme .tour-module-badge {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.tour-step-counter {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

[data-theme="dark"] .tour-step-counter {
  color: #94a3b8;
}

.tour-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tour-icon-btn {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s;
}

[data-theme="dark"] .tour-icon-btn,
body.dark-theme .tour-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.tour-icon-btn:hover {
  background: rgba(37, 99, 235, 0.15);
  color: #2563eb;
}

.tour-close-icon {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.tour-close-icon:hover {
  color: #ef4444;
}

.tour-step-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .tour-step-title,
body.dark-theme .tour-step-title {
  color: #f8fafc;
}

.tour-step-body {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 12px;
}

[data-theme="dark"] .tour-step-body,
body.dark-theme .tour-step-body {
  color: #cbd5e1;
}

/* Interactive Hands-on Action Box */
.tour-interactive-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(16, 185, 129, 0.06));
  border: 1.5px solid rgba(37, 99, 235, 0.2);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

[data-theme="dark"] .tour-interactive-box,
body.dark-theme .tour-interactive-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(16, 185, 129, 0.1));
  border-color: rgba(56, 189, 248, 0.25);
}

.tour-interactive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.tour-interactive-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #2563eb;
}

[data-theme="dark"] .tour-interactive-tag {
  color: #38bdf8;
}

.btn-autofill-sample {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
}

.btn-autofill-sample:hover {
  background: #047857;
  transform: translateY(-1px);
}

.btn-skip-task {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

[data-theme="dark"] .btn-skip-task {
  border-color: rgba(255, 255, 255, 0.15);
  color: #94a3b8;
}

.btn-skip-task:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #ef4444;
  border-color: #ef4444;
}

.tour-interactive-prompt {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
  line-height: 1.45;
}

[data-theme="dark"] .tour-interactive-prompt {
  color: #f1f5f9;
}

.tour-interactive-status {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
}

[data-theme="dark"] .tour-interactive-status {
  color: #94a3b8;
}

.tour-interactive-status.success {
  color: #10b981 !important;
  font-weight: 800;
}

/* Stepper Dots Indicator */
.tour-stepper-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}

.tour-stepper-dot {
  width: 7px;
  height: 7px;
  border-radius: 10px;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.25s ease;
}

[data-theme="dark"] .tour-stepper-dot {
  background: #334155;
}

.tour-stepper-dot.active {
  width: 22px;
  background: #2563eb;
}

[data-theme="dark"] .tour-stepper-dot.active {
  background: #38bdf8;
}

.tour-stepper-dot.passed {
  background: #10b981;
}

/* Card Footer */
.tour-step-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 12px;
}

[data-theme="dark"] .tour-step-footer {
  border-top-color: rgba(255, 255, 255, 0.05);
}

.tour-step-btns {
  display: flex;
  gap: 8px;
}

.btn-tour-next {
  padding: 7px 16px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.btn-tour-next:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-tour-prev {
  padding: 7px 14px;
  background: #f1f5f9;
  color: #475569;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

[data-theme="dark"] .btn-tour-prev,
body.dark-theme .btn-tour-prev {
  background: #1e293b;
  color: #cbd5e1;
}

.btn-tour-prev:hover {
  background: #e2e8f0;
}

[data-theme="dark"] .btn-tour-prev:hover {
  background: #334155;
}

.btn-tour-skip {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 11.5px;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-tour-skip:hover {
  color: #ef4444;
}

/* Confetti canvas */
.tour-confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1085;
}

/* ==========================================================================
   5. Universal Contextual Help Tooltip Icons
   ========================================================================== */
.help-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  font-size: 11.5px;
  font-weight: 700;
  margin-right: 6px;
  margin-left: 4px;
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1.5px solid rgba(37, 99, 235, 0.25);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

[data-theme="dark"] .help-tooltip-icon,
body.dark-theme .help-tooltip-icon {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.2);
}

.help-tooltip-icon:hover {
  transform: scale(1.2) rotate(8deg);
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
}

[data-theme="dark"] .help-tooltip-icon:hover,
body.dark-theme .help-tooltip-icon:hover {
  background: #38bdf8;
  color: #0f172a;
  box-shadow: 0 3px 10px rgba(56, 189, 248, 0.4);
}

/* Custom Bootstrap Tooltip Overrides */
.tooltip.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before, 
.tooltip.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: #0f172a !important;
}

.tooltip-inner {
  max-width: 280px !important;
  padding: 10px 14px !important;
  font-size: 12px !important;
  font-family: 'Vazirmatn', sans-serif !important;
  line-height: 1.6 !important;
  text-align: right !important;
  direction: rtl !important;
  border-radius: 12px !important;
  background-color: #0f172a !important;
  color: #f8fafc !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35) !important;
}

/* ==========================================================================
   6. Mobile Responsive Optimization
   ========================================================================== */
@media (max-width: 768px) {
  .onboarding-widget-wrapper {
    bottom: 16px !important;
    left: 14px !important;
  }
  .onboarding-launcher-btn {
    padding: 6px !important;
    border-radius: 50% !important;
    gap: 0 !important;
    width: 44px !important;
    height: 44px !important;
    justify-content: center !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28) !important;
  }
  .onboarding-launcher-text,
  .onboarding-launcher-progress {
    display: none !important;
  }
  .onboarding-launcher-badge {
    width: 32px !important;
    height: 32px !important;
    font-size: 16px !important;
    box-shadow: none !important;
  }
  .onboarding-card {
    width: calc(100vw - 28px) !important;
    max-width: 360px !important;
    left: 0 !important;
    bottom: 58px !important;
  }

  .tour-hub-modal {
    width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 40px) !important;
    border-radius: 18px !important;
  }
  .tour-hub-header {
    padding: 16px 18px 14px !important;
  }
  .tour-hub-body {
    padding: 14px !important;
  }
  .tour-modules-grid {
    grid-template-columns: 1fr !important;
  }
  .tour-comprehensive-card {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .tour-comp-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Tour Card on Mobile */
  .tour-step-card {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    left: 12px !important;
    padding: 14px 16px 12px !important;
    border-radius: 16px !important;
  }
}
