/* User Tour Overlay and Tooltip Styles */

/* Overlay - Darkens the background */
#tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-tour);
  pointer-events: auto; /* Blocks interaction with underlying elements */
  /* We use a large box-shadow on the spotlight element to create the darkness, 
     so the overlay itself can be transparent or semi-transparent if needed. 
     However, for a simple implementation without complex clipping, 
     we'll use a combination of a dark overlay and a 'spotlight' element sitting above it.
  */
  background: rgba(15, 23, 42, 0.62);
  display: none;
}

/* Spotlight - Highlights the target element */
#tour-spotlight {
  position: fixed;
  z-index: var(--z-tour-highlight);
  border-radius: 8px;
  border: 2px solid rgba(59, 130, 246, 0.9);
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.78),
    0 0 0 4px rgba(59, 130, 246, 0.45),
    0 0 24px rgba(59, 130, 246, 0.5);
  pointer-events: none; /* Allows clicking through to the highlighted element if needed, but usually we block interactions during tour unless specified */
  transition: all 0.4s ease-in-out;
  display: none;
}

/* Tooltip - Explainer card */
#tour-tooltip {
  position: absolute;
  z-index: var(--z-tour-highlight);
  width: 320px;
  max-width: 90vw;
  background-color: var(--surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: none;
  color: var(--text-primary, #1e293b);
  visibility: hidden;
}

#tour-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

/* Tooltip Arrow (optional, can be complex to position perfectly dynamically) */
#tour-tooltip::after {
  /* content: ''; */
  position: absolute;
  /* ... arrow styling depending on placement ... */
}

.tour-header {
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.tour-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-strong, #0f172a);
  margin: 0;
}

.tour-close {
  background: none;
  border: none;
  color: var(--text-tertiary, #94a3b8);
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
  transition: color 0.2s;
}

.tour-close:hover {
  color: var(--text-primary, #1e293b);
}

.tour-content {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary, #475569);
  margin-bottom: 1.5rem;
}

.tour-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tour-progress {
  font-size: 0.8rem;
  color: var(--text-tertiary, #94a3b8);
}

.tour-buttons {
  display: flex;
  gap: 0.75rem;
}

.tour-btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tour-btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-secondary, #475569);
}

.tour-btn-secondary:hover {
  background: var(--bg-subtle, #f1f5f9);
  color: var(--text-primary, #1e293b);
}

.tour-btn-primary {
  background: var(--primary, #3b82f6);
  border: 1px solid var(--primary, #3b82f6);
  color: white;
}

.tour-btn-primary:hover {
  background: var(--primary-strong, #2563eb);
  border-color: var(--primary-strong, #2563eb);
}

/* Center positioning helper class */
.tour-center-helper {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1px;
  height: 1px;
  visibility: hidden;
}

/* Ensure notifications appear above the tour */
.flashed, 
.notification {
  z-index: var(--z-tour-highlight) !important;
}

/* Adjustments for dark mode compatibility */
[data-theme="dark"] #tour-tooltip {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
