/* ==========================================================================
   GUIDED TOUR SYSTEM
   ========================================================================== */

/* Main overlay - covers entire viewport */
.tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  pointer-events: auto;
}

/* Highlight box - positioned over target element */
.tour-highlight {
  position: fixed;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 10002;
}

/* Pulsing ring effect around highlighted element */
.tour-highlight::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-lg);
  animation: tour-pulse 2s ease-in-out infinite;
}

@keyframes tour-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.02);
  }
}

/* Interactive step - more prominent animation */
.tour-highlight.interactive::after {
  border-color: var(--color-success);
  animation: tour-pulse-interactive 1s ease-in-out infinite;
}

@keyframes tour-pulse-interactive {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
    box-shadow: 0 0 20px 5px rgba(40, 167, 69, 0.2);
  }
}

/* ==========================================================================
   TOOLTIP
   ========================================================================== */

.tour-tooltip {
  position: fixed;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 10003;
  overflow: hidden;
  animation: tour-tooltip-appear 0.2s ease-out;
}

@keyframes tour-tooltip-appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tooltip arrow indicators */
.tour-tooltip.position-top::before,
.tour-tooltip.position-bottom::before,
.tour-tooltip.position-left::before,
.tour-tooltip.position-right::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--color-bg-elevated);
  transform: rotate(45deg);
}

.tour-tooltip.position-top::before {
  bottom: -6px;
  left: 50%;
  margin-left: -6px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.tour-tooltip.position-bottom::before {
  top: -6px;
  left: 50%;
  margin-left: -6px;
  box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.1);
}

.tour-tooltip.position-left::before {
  right: -6px;
  top: 50%;
  margin-top: -6px;
  box-shadow: 2px -2px 4px rgba(0, 0, 0, 0.1);
}

.tour-tooltip.position-right::before {
  left: -6px;
  top: 50%;
  margin-top: -6px;
  box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Center position - no arrow, enhanced shadow, wider for content */
.tour-tooltip.position-center {
  width: 380px;
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.tour-tooltip.position-center::before {
  display: none;
}

/* Header */
.tour-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}

.tour-tooltip-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--color-text);
}

.tour-tooltip-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 16px;
}

.tour-tooltip-close:hover {
  background: var(--color-bg-muted);
  color: var(--color-text);
}

/* Content */
.tour-tooltip-content {
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Footer */
.tour-tooltip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
}

.tour-tooltip-progress {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.tour-tooltip-actions {
  display: flex;
  gap: var(--space-2);
}

/* ==========================================================================
   MOBILE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 768px) {
  .tour-tooltip {
    width: calc(100vw - 32px);
    max-width: 360px;
  }

  .tour-highlight::after {
    display: none;
  }

  .tour-highlight {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
  }
}

@media (max-width: 480px) {
  .tour-tooltip {
    bottom: 16px;
    top: auto !important;
    left: 16px !important;
    right: 16px;
    width: auto;
  }

  .tour-tooltip::before {
    display: none;
  }
}

/* ==========================================================================
   TOUR CHOICE MODAL
   ========================================================================== */

.tour-choice-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.tour-choice-btn:last-child {
  margin-bottom: 0;
}

.tour-choice-btn:hover {
  background: var(--hover-row);
  border-color: var(--color-accent);
}

.tour-choice-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: white;
  border-radius: var(--radius-md);
  font-size: 18px;
  flex-shrink: 0;
}

.tour-choice-icon.comprehensive {
  background: var(--color-success);
}

.tour-choice-info {
  flex: 1;
  min-width: 0;
}

.tour-choice-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin-bottom: 2px;
}

.tour-choice-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.tour-choice-arrow {
  color: var(--color-text-muted);
  font-size: 14px;
  flex-shrink: 0;
}

.tour-choice-btn:hover .tour-choice-arrow {
  color: var(--color-accent);
}

/* ==========================================================================
   TRAINING CHECKLIST
   ========================================================================== */

/* Checkmark circle for checklist items */
.tour-check {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 24px;
  flex-shrink: 0;
  color: var(--color-border);
  transition: all 0.2s ease;
}

.tour-check.complete {
  color: var(--color-success);
}

.tour-check i {
  transition: transform 0.2s ease;
}

/* Completed item styling */
.tour-checklist-item.completed {
  background: var(--color-bg-muted);
}

.tour-checklist-item.completed .tour-choice-title {
  color: var(--color-text-muted);
}

.tour-checklist-item.completed .tour-choice-desc {
  color: var(--color-text-muted);
}

.tour-checklist-item.completed:hover {
  background: var(--hover-row);
  border-color: var(--color-border);
}

/* Animate checkmark on completion */
@keyframes tour-checkmark-pop {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.tour-check.complete i {
  animation: tour-checkmark-pop 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .tour-tooltip,
  .tour-overlay,
  .tour-check.complete i {
    animation: none !important;
    transition: none !important;
  }
}
