/**
 * Product Tour Styles
 * Step-by-step guided walkthrough highlighting UI elements
 */

/* Overlay backdrop */
.product-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-tour-overlay.visible {
  opacity: 1;
}

.product-tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

/* Highlight overlay - separate element positioned over target */
.product-tour-highlight-overlay {
  position: fixed !important;
  pointer-events: none !important;
  z-index: 10001 !important;
  border: 4px solid var(--color-accent-fg, #0969da) !important;
  border-radius: 8px !important;
  box-shadow:
    inset 0 0 20px rgba(9, 105, 218, 0.2),
    0 0 20px rgba(9, 105, 218, 0.4) !important;
  animation: product-tour-pulse 2s ease-in-out infinite !important;
}

/* Legacy class-based highlight (fallback) */
.product-tour-highlight {
  position: relative !important;
  z-index: 10001 !important;
  box-shadow:
    0 0 0 4px var(--color-accent-fg, #0969da),
    0 0 0 8px rgba(9, 105, 218, 0.2) !important;
  border-radius: 6px;
  animation: product-tour-pulse 2s ease-in-out infinite;
}

@keyframes product-tour-pulse {
  0%,
  100% {
    border-color: var(--color-accent-fg, #0969da);
    box-shadow:
      inset 0 0 20px rgba(9, 105, 218, 0.2),
      0 0 20px rgba(9, 105, 218, 0.4);
  }
  50% {
    border-color: var(--color-accent-fg, #0969da);
    box-shadow:
      inset 0 0 30px rgba(9, 105, 218, 0.15),
      0 0 30px rgba(9, 105, 218, 0.5);
  }
}

/* Tooltip */
.product-tour-tooltip {
  position: fixed;
  z-index: 10002;
  width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

[data-theme="dark"] .product-tour-tooltip {
  background: var(--scitex-color-01, #0d1117);
  border-color: var(--scitex-color-03, #2d3139);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.product-tour-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.product-tour-tooltip-content {
  padding: 16px 20px;
}

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

.product-tour-step-indicator {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.product-tour-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: all 0.2s ease;
}

.product-tour-close:hover {
  background: var(--bg-surface);
  border-color: var(--scitex-color-04);
  color: var(--text-primary);
}

.product-tour-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.product-tour-description {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.product-tour-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.product-tour-btn {
  padding: 8px 16px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--bg-muted);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-tour-btn:hover {
  background: var(--bg-surface);
  border-color: var(--scitex-color-04);
}

.product-tour-btn.primary {
  background: var(--color-btn-primary-bg);
  border-color: var(--color-btn-primary-border);
  color: var(--color-btn-primary-text);
}

.product-tour-btn.primary:hover {
  background: var(--color-btn-primary-hover-bg);
}

.product-tour-btn.success {
  background: #1a7f3a;
  border-color: #1a7f3a;
  color: #fff;
}

.product-tour-btn.success:hover {
  background: #126429;
  border-color: #126429;
}

.product-tour-btn.stop {
  background: transparent;
  border-color: #da3633;
  color: #da3633;
  font-size: 13px;
}

.product-tour-btn.stop:hover {
  background: rgba(218, 54, 51, 0.1);
}

/* Tooltip arrow */
.product-tour-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  transform: rotate(45deg);
}

[data-theme="dark"] .product-tour-arrow {
  background: var(--scitex-color-01, #0d1117);
  border-color: var(--scitex-color-03, #2d3139);
}

.product-tour-arrow.arrow-top {
  top: -7px;
  border-right: none;
  border-bottom: none;
}

.product-tour-arrow.arrow-bottom {
  bottom: -7px;
  border-left: none;
  border-top: none;
}

.product-tour-arrow.arrow-left {
  left: -7px;
  border-right: none;
  border-top: none;
}

.product-tour-arrow.arrow-right {
  right: -7px;
  border-left: none;
  border-bottom: none;
}

/* Skip option checkbox */
.product-tour-skip-option {
  margin: 12px 0;
  padding-top: 8px;
  border-top: 1px solid var(--border-default);
}

.product-tour-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.product-tour-checkbox-label:hover {
  color: var(--text-primary);
}

.product-tour-skip-checkbox {
  width: 14px;
  height: 14px;
  accent-color: var(--scitex-color-04);
  cursor: pointer;
}

/* Keymap hint */
.product-tour-keymap-hint {
  margin: 12px 0 0;
  padding-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border-default);
}

.product-tour-keymap-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  margin: 0 2px;
  font-size: 11px;
  font-family: inherit;
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Restart hint */
.product-tour-restart-hint {
  margin: 8px 0 0;
  padding-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border-default);
}

.product-tour-restart-hint i {
  margin-right: 4px;
}

/* Tour button hint - persistent highlight during tour */
.tour-active-hint {
  position: relative;
  z-index: 10003 !important;
  animation: tour-btn-pulse 2s ease-in-out infinite !important;
  box-shadow:
    0 0 0 4px var(--scitex-color-04),
    0 0 0 8px rgba(119, 119, 119, 0.3),
    0 0 20px rgba(119, 119, 119, 0.5) !important;
  border-radius: 8px !important;
}

@keyframes tour-btn-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 4px var(--scitex-color-04),
      0 0 0 8px rgba(119, 119, 119, 0.3),
      0 0 20px rgba(119, 119, 119, 0.5);
  }
  50% {
    box-shadow:
      0 0 0 6px var(--scitex-color-04),
      0 0 0 12px rgba(119, 119, 119, 0.2),
      0 0 30px rgba(119, 119, 119, 0.6);
  }
}

/* Restart hint tooltip - positioned under tour button */
.product-tour-restart-tooltip {
  width: 280px;
}

.product-tour-restart-tooltip .product-tour-description {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 480px) {
  .product-tour-tooltip {
    width: calc(100vw - 32px);
    max-width: 320px;
  }
}
