/* ========================================
   ONBOARDING WALKTHROUGH STYLES - FIXED VERSION
   ======================================== */

.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  pointer-events: none;
}

.onboarding-overlay * {
  pointer-events: auto;
}

/* Semi-transparent backdrop - NO BLUR to keep highlighted content sharp */
.onboarding-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  /* Removed backdrop-filter blur - this was making content unreadable */
  animation: fadeIn 0.3s ease-out;
}

/* Spotlight effect - FIXED to create a clear window with visible border */
.onboarding-spotlight {
  position: absolute;
  border-radius: 8px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 10001;
  
  /* Create a clear window by using a thick border that cuts through the backdrop */
  background: transparent;
  
  /* Visible red border to highlight the element */
  border: 3px solid rgba(190, 48, 42, 1);
  
  /* Create the "cutout" effect using box-shadow with inset */
  box-shadow: 
    /* Inner glow for emphasis */
    inset 0 0 0 2px rgba(255, 255, 255, 0.1),
    /* Outer dark overlay that covers everything else */
    0 0 0 9999px rgba(0, 0, 0, 0.75);
}

/* Pulse animation for spotlight - ENHANCED */
@keyframes spotlightPulse {
  0%, 100% {
    border-color: rgba(190, 48, 42, 1);
    box-shadow: 
      inset 0 0 0 2px rgba(255, 255, 255, 0.1),
      0 0 0 9999px rgba(0, 0, 0, 0.75),
      0 0 0 6px rgba(190, 48, 42, 0.6),
      0 0 30px 10px rgba(190, 48, 42, 0.4);
  }
  50% {
    border-color: rgba(190, 48, 42, 0.8);
    box-shadow: 
      inset 0 0 0 2px rgba(255, 255, 255, 0.2),
      0 0 0 9999px rgba(0, 0, 0, 0.75),
      0 0 0 10px rgba(190, 48, 42, 0.4),
      0 0 40px 15px rgba(190, 48, 42, 0.3);
  }
}

.onboarding-spotlight.pulse {
  animation: spotlightPulse 2s ease-in-out infinite;
}

/* Tooltip card */
.onboarding-tooltip {
  position: absolute;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  max-width: 400px;
  min-width: 320px;
  z-index: 10002;
  animation: tooltipSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-bs-theme="dark"] .onboarding-tooltip {
  background: #2d3236;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

@keyframes tooltipSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Tooltip header */
.onboarding-tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .onboarding-tooltip-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.onboarding-step-counter {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--redlist-primary, #be302a);
  letter-spacing: 0.5px;
}

.onboarding-close-btn {
  background: none;
  border: none;
  color: #6c757d;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  line-height: 1;
}

.onboarding-close-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #000;
}

[data-bs-theme="dark"] .onboarding-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Tooltip body */
.onboarding-tooltip-body {
  padding: 24px 20px;
}

.onboarding-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--redlist-primary, #be302a) 0%, #8e1e1a 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 4px 12px rgba(190, 48, 42, 0.3);
}

.onboarding-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #212529;
}

[data-bs-theme="dark"] .onboarding-title {
  color: #e9ecef;
}

.onboarding-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #6c757d;
  margin: 0;
}

[data-bs-theme="dark"] .onboarding-description {
  color: #adb5bd;
}

/* Tooltip footer */
.onboarding-tooltip-footer {
  padding: 16px 20px 20px;
}

.onboarding-progress {
  height: 4px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  margin-bottom: 16px;
  overflow: hidden;
}

[data-bs-theme="dark"] .onboarding-progress {
  background: rgba(255, 255, 255, 0.1);
}

.onboarding-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--redlist-primary, #be302a) 0%, #e74c46 100%);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboarding-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.onboarding-buttons .btn {
  font-size: 0.875rem;
  padding: 8px 16px;
  font-weight: 600;
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .onboarding-tooltip {
    max-width: 90vw;
    min-width: 280px;
  }
  
  .onboarding-tooltip-body {
    padding: 20px 16px;
  }
  
  .onboarding-icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
  
  .onboarding-title {
    font-size: 1.1rem;
  }
  
  .onboarding-description {
    font-size: 0.875rem;
  }
}

/* Arrow pointer for tooltip - ENHANCED with better shadows */
.onboarding-tooltip::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  z-index: 1;
}

.onboarding-tooltip.arrow-top::before {
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 16px 16px 16px;
  border-color: transparent transparent white transparent;
  filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, 0.2));
}

[data-bs-theme="dark"] .onboarding-tooltip.arrow-top::before {
  border-color: transparent transparent #2d3236 transparent;
}

.onboarding-tooltip.arrow-bottom::before {
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 16px 16px 0 16px;
  border-color: white transparent transparent transparent;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.2));
}

[data-bs-theme="dark"] .onboarding-tooltip.arrow-bottom::before {
  border-color: #2d3236 transparent transparent transparent;
}

.onboarding-tooltip.arrow-left::before {
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 16px 16px 16px 0;
  border-color: transparent white transparent transparent;
  filter: drop-shadow(-3px 0 3px rgba(0, 0, 0, 0.2));
}

[data-bs-theme="dark"] .onboarding-tooltip.arrow-left::before {
  border-color: transparent #2d3236 transparent transparent;
}

.onboarding-tooltip.arrow-right::before {
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 16px 0 16px 16px;
  border-color: transparent transparent transparent white;
  filter: drop-shadow(3px 0 3px rgba(0, 0, 0, 0.2));
}

[data-bs-theme="dark"] .onboarding-tooltip.arrow-right::before {
  border-color: transparent transparent transparent #2d3236;
}

/* Special highlight for interactive elements */
.onboarding-highlight {
  position: relative;
  z-index: 10003;
}
