/*
 * Help Tooltips and Guided Tours Styles
 * Provides styling for contextual help tooltips and multi-step guided tours
 */

/* ==========================================================================
   Help Tooltip Styles
   ========================================================================== */

/* Tooltip trigger element */
.help-tooltip-trigger {
  cursor: help;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.help-tooltip-trigger:focus {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.help-tooltip-icon {
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.help-tooltip-trigger:hover .help-tooltip-icon {
  color: var(--bs-primary) !important;
}

/* Tooltip popup (fallback when Bootstrap not available) */
.help-tooltip-popup {
  position: fixed;
  z-index: 1080;
  max-width: 300px;
  padding: 0.75rem 1rem;
  background-color: var(--bs-dark, #212529);
  color: var(--bs-white, #fff);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
  font-size: 0.875rem;
  line-height: 1.5;
  animation: help-tooltip-fade-in 0.15s ease;
}

@keyframes help-tooltip-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tooltip content */
.help-tooltip-content {
  position: relative;
}

.help-tooltip-text {
  margin-bottom: 0;
}

.help-tooltip-footer {
  border-top: 1px solid rgb(255 255 255 / 20%);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.help-tooltip-link {
  color: var(--bs-info) !important;
  text-decoration: none;
  font-weight: 500;
}

.help-tooltip-link:hover {
  text-decoration: underline !important;
}

.help-tooltip-close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  font-size: 0.75rem;
  opacity: 0.7;
}

.help-tooltip-close:hover {
  opacity: 1;
}

/* Bootstrap Popover customization */
.help-tooltip-popover {
  max-width: 300px;
}

.help-tooltip-popover .popover-body {
  padding: 0.75rem 1rem;
}

/* ==========================================================================
   Guided Tour Styles
   ========================================================================== */

/* Tour overlay - darkens the background */
.tour-overlay {
  position: fixed;
  inset: 0;
  background-color: rgb(0 0 0 / 50%);
  z-index: 1050;
  animation: tour-fade-in 0.2s ease;
}

@keyframes tour-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Highlight around target element */
.tour-highlight {
  border: 2px solid var(--bs-primary, #0d6efd);
  border-radius: 8px;
  background-color: rgb(255 255 255 / 95%);
  box-shadow:
    0 0 0 9999px rgb(0 0 0 / 50%),
    0 4px 20px rgb(0 0 0 / 20%);
  animation: tour-highlight-pulse 2s ease-in-out infinite;
}

@keyframes tour-highlight-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 9999px rgb(0 0 0 / 50%),
      0 4px 20px rgb(0 0 0 / 20%);
  }

  50% {
    box-shadow:
      0 0 0 9999px rgb(0 0 0 / 50%),
      0 4px 30px rgba(var(--bs-primary-rgb), 0.3);
  }
}

/* Tour step card */
.tour-step {
  position: fixed;
  z-index: 1070;
  width: 320px;
  max-width: calc(100vw - 32px);
  animation: tour-step-slide-in 0.25s ease;
}

@keyframes tour-step-slide-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tour-step-content {
  background-color: var(--bs-white, #fff);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow:
    0 10px 40px rgb(0 0 0 / 20%),
    0 2px 10px rgb(0 0 0 / 10%);
}

.tour-step-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.tour-step-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bs-dark, #212529);
  margin: 0;
  flex: 1;
}

.tour-step-counter {
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.tour-step-description {
  font-size: 0.9rem;
  color: var(--bs-secondary, #6c757d);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.tour-step-learn-more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  text-decoration: none;
}

.tour-step-learn-more:hover {
  text-decoration: underline !important;
}

/* Tour step actions */
.tour-step-actions {
  border-top: 1px solid var(--bs-border-color, #dee2e6);
  padding-top: 0.75rem;
}

.tour-skip-btn {
  font-size: 0.8rem;
  padding: 0;
  text-decoration: none;
}

.tour-skip-btn:hover {
  text-decoration: underline !important;
}

.tour-nav-buttons .btn {
  min-width: 80px;
}

/* Progress dots */
.tour-progress-dots {
  padding-top: 0.5rem;
}

.tour-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--bs-secondary-bg, #e9ecef);
  transition: all 0.2s ease;
}

.tour-progress-dot.active {
  background-color: var(--bs-primary, #0d6efd);
  transform: scale(1.25);
}

.tour-progress-dot.completed {
  background-color: var(--bs-success, #198754);
}

/* Tour start button */
.tour-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (width <= 576px) {
  .tour-step {
    width: calc(100vw - 32px);
    left: 16px !important;
    right: 16px;
  }

  .tour-step-content {
    padding: 1rem;
  }

  .help-tooltip-popup {
    max-width: calc(100vw - 32px);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .tour-overlay,
  .tour-step,
  .tour-highlight,
  .help-tooltip-popup {
    animation: none;
  }

  .tour-highlight {
    box-shadow:
      0 0 0 9999px rgb(0 0 0 / 50%),
      0 4px 20px rgb(0 0 0 / 20%);
  }
}
