/* CSS Animations */

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  background-color: var(--primary-color);
  border-radius: 100%;
  margin: 20px auto;
  animation: sk-scaleout 1.0s infinite ease-in-out;
}

@keyframes sk-scaleout {
  0% {
    transform: scale(0);
  }

  100% {
    transform: scale(1.0);
    opacity: 0;
  }
}

/* Enhanced Drawing Animation - Activity Themed */
.drawing-animation {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

/* Outer ring - Fitness (Green) */
.drawing-animation::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160px;
  height: 160px;
  margin-top: -80px;
  margin-left: -80px;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--color-fitness);
  border-right-color: var(--color-recreation);
  animation: drawing-spin 3s linear infinite;
}

/* Inner ring - Mind-Body (Blue) */
.drawing-animation::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  margin-top: -50px;
  margin-left: -50px;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--color-mindbody);
  border-right-color: var(--color-sports);
  animation: drawing-spin-reverse 2s linear infinite;
}

/* Activity icons in loading animation */
.loading-animation {
  position: relative;
}

.loading-animation .activity-icons {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes drawing-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes drawing-spin-reverse {
  0% {
    transform: rotate(360deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

@keyframes iconPulse {

  0%,
  100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.9);
  }

  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

/* Loading dots animation */
.loading-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 1rem;
}

.loading-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary-color);
  animation: loadingDot 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
  animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loadingDot {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Progress steps animation */
.progress-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  color: var(--light-text);
  font-size: 0.9rem;
}

.progress-step-icon {
  animation: stepBounce 0.6s ease infinite;
}

@keyframes stepBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* Typewriter effect */
.typewriter {
  overflow: hidden;
  white-space: normal;
}

.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 1.2em;
  background-color: var(--primary-color);
  margin-left: 2px;
  animation: cursorBlink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes cursorBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* Confetti container styles */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* Success checkmark animation */
@keyframes checkmark {
  0% {
    stroke-dashoffset: 100;
  }

  100% {
    stroke-dashoffset: 0;
  }
}

.success-checkmark {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
}

.success-checkmark circle {
  fill: none;
  stroke: var(--color-fitness);
  stroke-width: 3;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: checkmark 0.8s ease-out forwards;
}

.success-checkmark path {
  fill: none;
  stroke: var(--color-fitness);
  stroke-width: 3;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: checkmark 0.5s ease-out 0.5s forwards;
}

/* Fade in up animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Stagger delay classes */
.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

.delay-4 {
  animation-delay: 0.4s;
}

.delay-5 {
  animation-delay: 0.5s;
}

/* Scale in animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in {
  animation: scaleIn 0.5s ease-out forwards;
}

/* Bounce animation */
@keyframes bounce {

  0%,
  20%,
  53%,
  100% {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: translate3d(0, 0, 0);
  }

  40%,
  43% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translate3d(0, -20px, 0);
  }

  70% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translate3d(0, -10px, 0);
  }

  80% {
    transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: translate3d(0, 0, 0);
  }

  90% {
    transform: translate3d(0, -4px, 0);
  }
}

.bounce {
  animation: bounce 1s ease;
}

/* Shake animation for errors */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

.shake {
  animation: shake 0.6s ease;
}

/* Pulse animation */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Float animation */
@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* Glow effect */
@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5),
      0 0 10px rgba(76, 175, 80, 0.3),
      0 0 15px rgba(76, 175, 80, 0.1);
  }

  50% {
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.8),
      0 0 20px rgba(76, 175, 80, 0.5),
      0 0 30px rgba(76, 175, 80, 0.3);
  }
}

.glow {
  animation: glow 2s ease-in-out infinite;
}

/* Color shift animation for multi-color elements */
@keyframes colorShift {
  0% {
    color: var(--color-fitness);
  }

  25% {
    color: var(--color-recreation);
  }

  50% {
    color: var(--color-mindbody);
  }

  75% {
    color: var(--color-sports);
  }

  100% {
    color: var(--color-fitness);
  }
}

.color-shift {
  animation: colorShift 4s linear infinite;
}