/* In-App Tutorial Styles */

/* Overlay - semi-transparent background */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  transition: opacity 0.3s ease;
}

.tutorial-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Spotlight - highlights the target element */
.tutorial-spotlight {
  position: absolute;
  border: 3px solid #E86B4A; /* fitcloud-coral */
  border-radius: 0.5rem;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7),
              0 0 20px rgba(232, 107, 74, 0.5);
  z-index: 9999;
  transition: all 0.3s ease;
  pointer-events: none;
  animation: spotlight-pulse 2s ease-in-out infinite;
}

@keyframes spotlight-pulse {
  0%, 100% {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7),
                0 0 20px rgba(232, 107, 74, 0.5);
  }
  50% {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7),
                0 0 30px rgba(232, 107, 74, 0.8);
  }
}

.tutorial-spotlight.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Tooltip - contains tutorial content */
.tutorial-tooltip {
  position: absolute;
  max-width: 28rem;
  width: calc(100vw - 2rem);
  background: white;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  transition: all 0.3s ease;
  animation: tooltip-fade-in 0.3s ease-out;
}

@keyframes tooltip-fade-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tutorial-tooltip.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

/* Tooltip header */
.tutorial-tooltip-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgb(229 231 235);
  background: linear-gradient(135deg, #E86B4A 0%, #D25A3A 100%);
  border-radius: 1rem 1rem 0 0;
  color: white;
}

.tutorial-tooltip-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}

.tutorial-tooltip-header p {
  font-size: 0.875rem;
  margin-top: 0.25rem;
  opacity: 0.9;
}

/* Progress indicator */
.tutorial-progress {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid rgb(229 231 235);
  background: rgb(249 250 251);
}

.tutorial-progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: rgb(107 114 128);
  margin-bottom: 0.5rem;
}

.tutorial-progress-bar {
  width: 100%;
  height: 0.5rem;
  background: rgb(229 231 235);
  border-radius: 9999px;
  overflow: hidden;
}

.tutorial-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #E86B4A 0%, #D25A3A 100%);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* Tooltip body */
.tutorial-tooltip-body {
  padding: 1.5rem;
  max-height: 400px;
  overflow-y: auto;
}

/* Custom scrollbar for tooltip body */
.tutorial-tooltip-body::-webkit-scrollbar {
  width: 6px;
}

.tutorial-tooltip-body::-webkit-scrollbar-track {
  background: transparent;
}

.tutorial-tooltip-body::-webkit-scrollbar-thumb {
  background: rgb(209 213 219);
  border-radius: 3px;
}

.tutorial-tooltip-body::-webkit-scrollbar-thumb:hover {
  background: rgb(156 163 175);
}

.tutorial-step-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: rgb(17 24 39);
  margin: 0;
}

.tutorial-step-header p {
  font-size: 0.875rem;
  color: rgb(107 114 128);
  margin: 0.25rem 0 0 0;
}

.tutorial-step-body {
  margin-top: 1rem;
}

.tutorial-step-body p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: rgb(55 65 81);
  margin: 0;
}

/* Tooltip tip section */
.tutorial-tip {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(232, 107, 74, 0.08);
  border-radius: 0.5rem;
  border: 1px solid rgba(232, 107, 74, 0.2);
}

.tutorial-tip p {
  font-size: 0.875rem;
  color: #C45A3A;
  margin: 0;
}

/* Tooltip footer with action buttons */
.tutorial-tooltip-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgb(229 231 235);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  background: rgb(249 250 251);
  border-radius: 0 0 1rem 1rem;
}

.tutorial-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tutorial-btn-primary {
  background: linear-gradient(135deg, #E86B4A 0%, #D25A3A 100%);
  color: white;
  flex: 1;
}

.tutorial-btn-primary:hover {
  box-shadow: 0 4px 12px rgba(232, 107, 74, 0.4);
  transform: translateY(-1px);
}

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

.tutorial-btn-secondary {
  background: white;
  color: rgb(107 114 128);
  border: 1px solid rgb(229 231 235);
}

.tutorial-btn-secondary:hover {
  background: rgb(243 244 246);
  border-color: rgb(209 213 219);
}

.tutorial-btn-text {
  background: transparent;
  color: rgb(107 114 128);
  padding: 0.5rem;
}

.tutorial-btn-text:hover {
  color: rgb(55 65 81);
}

/* Keyboard shortcuts hint */
.tutorial-keyboard-hint {
  font-size: 0.75rem;
  color: rgb(156 163 175);
  text-align: center;
  margin-top: 0.5rem;
  padding: 0 1.5rem 1rem;
}

.tutorial-keyboard-hint kbd {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(55 65 81);
  background: white;
  border: 1px solid rgb(209 213 219);
  border-radius: 0.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Help icon button to restart tutorial */
.tutorial-help-btn {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #E86B4A 0%, #D25A3A 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(232, 107, 74, 0.3);
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  z-index: 40;
}

.tutorial-help-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 15px 30px rgba(232, 107, 74, 0.4);
}

.tutorial-help-btn:active {
  transform: translateY(0) scale(1);
}

.tutorial-help-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Tooltip on hover for help button */
.tutorial-help-btn-tooltip {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgb(31 41 55);
  color: white;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.tutorial-help-btn:hover .tutorial-help-btn-tooltip {
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .tutorial-tooltip {
    max-width: calc(100vw - 2rem);
    left: 1rem !important;
    right: 1rem !important;
    transform: none !important;
  }

  .tutorial-tooltip-header {
    padding: 1rem;
  }

  .tutorial-tooltip-body {
    padding: 1rem;
    max-height: 300px;
  }

  .tutorial-tooltip-footer {
    padding: 0.75rem 1rem;
    flex-direction: column;
  }

  .tutorial-btn {
    width: 100%;
  }

  .tutorial-keyboard-hint {
    display: none;
  }
}

/* Animation for completion state */
@keyframes celebration {
  0%, 100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.1) rotate(5deg);
  }
  75% {
    transform: scale(1.1) rotate(-5deg);
  }
}

.tutorial-completion-animation {
  animation: celebration 0.6s ease-in-out;
}
