/* ==========================================================================
   ใบงานดนตรี - Visual Effects (fx.css)
   Lightweight anime animations & floating particles
   ========================================================================== */

@keyframes floatMascot {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-6px) rotate(2deg);
  }
}

@keyframes popCard {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sparkleSpin {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(90deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(180deg);
    opacity: 0;
  }
}

@keyframes successPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(44, 140, 116, 0.4);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(44, 140, 116, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(44, 140, 116, 0);
  }
}

.header-mascot {
  animation: floatMascot 4s ease-in-out infinite;
}

.card.pop-card,
.modal-overlay .card {
  animation: popCard 0.25s ease-out;
}

/* Success celebratory banner */
.celebrate-success {
  animation: successPulse 1.2s ease-out;
  border-color: var(--ok) !important;
}

/* Sparkle particles created on submit */
.fx-sparkle {
  position: absolute;
  pointer-events: none;
  width: 24px;
  height: 24px;
  background-image: url('assets/icon_sparkle.svg');
  background-size: contain;
  background-repeat: no-repeat;
  animation: sparkleSpin 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  z-index: 999;
}

/* Reduced Motion Preference - Completely disable all movements */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    transform: none !important;
  }
}
