/**
 * Onboarding Tour Styles
 * Includes overlay, spotlight, tooltip, and celebration styles
 */

/* =================================================================
   OVERLAY & SPOTLIGHT
   ================================================================= */

.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  pointer-events: none;
  animation: fadeIn 0.3s ease-in-out;
}

.onboarding-spotlight {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.6),
    0 0 40px 20px rgba(59, 130, 246, 0.3),
    inset 0 0 0 2px rgba(59, 130, 246, 0.4);
  animation: pulse-border 2s infinite;
}

/* Spotlight flash effect when validation fails */
.onboarding-spotlight.spotlight-flash {
  animation: spotlight-flash 0.6s ease-in-out;
}

@keyframes pulse-border {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(59, 130, 246, 0.6),
      0 0 40px 20px rgba(59, 130, 246, 0.3),
      inset 0 0 0 2px rgba(59, 130, 246, 0.4);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(59, 130, 246, 0.8),
      0 0 50px 25px rgba(59, 130, 246, 0.4),
      inset 0 0 0 2px rgba(59, 130, 246, 0.5);
  }
}

@keyframes spotlight-flash {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(59, 130, 246, 0.6),
      0 0 40px 20px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(239, 68, 68, 0.8),
      0 0 40px 20px rgba(239, 68, 68, 0.5);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.onboarding-tooltip {
  position: fixed;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  max-width: 380px;
  min-width: 300px;
  animation: slideIn 0.3s ease-out;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Tooltip centered on screen */
.onboarding-tooltip.tooltip-centered {
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%);
}

/* Tooltip Header */
.tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.tooltip-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #000;
  flex: 1;
}

.tooltip-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  transition: color 0.2s ease;
}

.tooltip-close:hover {
  color: #000;
}

.tooltip-close svg {
  width: 20px;
  height: 20px;
}

/* Tooltip Body */
.tooltip-body {
  padding: 16px 20px;
}

.tooltip-message {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #000;
}

/* Progress Bar */
.tooltip-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-text {
  font-size: 12px;
  font-weight: 500;
  color: #000;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Tooltip Footer */
.tooltip-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  justify-content: flex-end;
  border-top: 1px solid #e5e7eb;
}

.tooltip-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tooltip-skip {
  background: #f3f4f6;
  color: #000;
  padding: 8px 12px;
}

.tooltip-skip:hover {
  background: #e5e7eb;
  color: #000;
}

.tooltip-prev {
  background: #f3f4f6;
  color: #000;
  padding: 8px 12px;
}

.tooltip-prev:hover {
  background: #e5e7eb;
  color: #000;
}

.tooltip-next {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  padding: 8px 16px;
}

.tooltip-next:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.tooltip-next:active {
  transform: translateY(0);
}

/* =================================================================
   CELEBRATION MESSAGE
   ================================================================= */

.onboarding-celebration {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-in-out;
}

.celebration-content {
  background: white;
  border-radius: 16px;
  padding: 40px;
  max-width: 500px;
  text-align: center;
  animation: zoomIn 0.5s ease-out;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.celebration-icon {
  font-size: 80px;
  margin-bottom: 16px;
  animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.celebration-title {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 700;
  color: #000;
}

.celebration-message {
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.6;
  color: #000;
}

.celebration-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.celebration-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.celebration-btn:active {
  transform: translateY(0);
}

/* =================================================================
   RESPONSIVE DESIGN
   ================================================================= */

/* Mobile phones */
@media (max-width: 640px) {
  .onboarding-tooltip {
    max-width: calc(100vw - 32px);
    min-width: auto;
    margin: 16px;
  }

  .tooltip-header {
    padding: 16px;
  }

  .tooltip-title {
    font-size: 16px;
  }

  .tooltip-body {
    padding: 12px 16px;
  }

  .tooltip-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .tooltip-btn {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
    font-size: 12px;
  }

  .celebration-content {
    padding: 24px;
    margin: 16px;
  }

  .celebration-icon {
    font-size: 60px;
  }

  .celebration-title {
    font-size: 24px;
  }

  .celebration-message {
    font-size: 14px;
  }

  .celebration-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* Tablets */
@media (max-width: 1024px) {
  .onboarding-tooltip {
    max-width: 350px;
    min-width: 280px;
  }

  .tooltip-title {
    font-size: 16px;
  }

  .tooltip-message {
    font-size: 13px;
  }
}

/* High-resolution displays */
@media (min-width: 1920px) {
  .onboarding-tooltip {
    max-width: 420px;
  }

  .tooltip-title {
    font-size: 20px;
  }

  .tooltip-message {
    font-size: 15px;
  }
}

/* =================================================================
   ACCESSIBILITY
   ================================================================= */

/* Focus styles for keyboard navigation */
.tooltip-btn:focus-visible,
.tooltip-close:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .onboarding-overlay,
  .onboarding-spotlight,
  .onboarding-tooltip,
  .onboarding-celebration,
  .celebration-content {
    animation: none;
  }

  .tooltip-progress,
  .tooltip-btn,
  .celebration-btn {
    transition: none;
  }

  .onboarding-spotlight {
    box-shadow: 0 0 0 2px #3b82f6;
  }
}

/* Dark mode support - keep text black for onboarding */
@media (prefers-color-scheme: dark) {
  .onboarding-tooltip {
    background: white;
    color: #000;
  }

  .tooltip-header {
    border-bottom-color: #e5e7eb;
  }

  .tooltip-title {
    color: #000;
  }

  .tooltip-close {
    color: #000;
  }

  .tooltip-close:hover {
    color: #000;
  }

  .tooltip-message {
    color: #000;
  }

  .progress-text {
    color: #000;
  }

  .tooltip-footer {
    border-top-color: #e5e7eb;
  }

  .tooltip-skip,
  .tooltip-prev {
    background: #f3f4f6;
    color: #000;
  }

  .tooltip-skip:hover,
  .tooltip-prev:hover {
    background: #e5e7eb;
    color: #000;
  }

  .celebration-content {
    background: white;
    color: #000;
  }

  .celebration-title {
    color: #000;
  }

  .celebration-message {
    color: #000;
  }
}

/* =================================================================
   UTILITY CLASSES
   ================================================================= */

/* Hide elements during onboarding */
.onboarding-hidden {
  pointer-events: none;
  opacity: 0.5;
}

/* For positioning arrow indicators (if needed in future) */
.tooltip-arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: white;
  transform: rotate(45deg);
}

@media (prefers-color-scheme: dark) {
  .tooltip-arrow {
    background: #1f2937;
  }
}
