/* ChairPoints Celebration Animation */

/* Sparkle particle animation */
@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(180deg);
  }
}

@keyframes float-up {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-50px);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.9);
  }
}

@keyframes coin-flip {
  0% {
    transform: rotateY(0deg) scale(1);
  }
  50% {
    transform: rotateY(180deg) scale(1.2);
  }
  100% {
    transform: rotateY(360deg) scale(1);
  }
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(600px) rotate(720deg);
    opacity: 0;
  }
}

/* ChairPoints celebration overlay */
.chairpoints-celebration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  display: none;
}

.chairpoints-celebration.active {
  display: block;
}

/* Sparkle particles */
.sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border-radius: 50%;
  animation: sparkle 1.5s ease-in-out infinite;
  opacity: 0;
}

/* Gold coin animation */
.gold-coin {
  position: absolute;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: coin-flip 1s ease-in-out, float-up 2s ease-out forwards;
}

.gold-coin .chairpoints-chip-large {
  width: 70px;
  height: 70px;
  font-size: 2rem;
  box-shadow: 0 4px 20px rgba(15, 111, 117, 0.5);
}

/* Confetti pieces */
.confetti {
  position: absolute;
  width: 10px;
  height: 20px;
  animation: confetti-fall 3s linear forwards;
}

.confetti:nth-child(odd) {
  background-color: #FFD700;
}

.confetti:nth-child(even) {
  background-color: #FFA500;
}

.confetti:nth-child(3n) {
  background-color: #28a745;
}

.confetti:nth-child(4n) {
  background-color: #007bff;
}

/* Celebration message */
.celebration-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: white;
  padding: 30px 50px;
  border-radius: 20px;
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 10px 40px rgba(255, 215, 0, 0.6);
  animation: pulse-glow 1s ease-in-out infinite;
  z-index: 10000;
  pointer-events: auto;
  opacity: 0;
  animation: fade-in-scale 0.5s ease-out forwards;
}

@keyframes fade-in-scale {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.celebration-message .points-earned {
  display: block;
  font-size: 3rem;
  margin: 10px 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.celebration-message .close-btn {
  margin-top: 20px;
  background: white;
  color: #FFA500;
  border: none;
  padding: 10px 30px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.celebration-message .close-btn:hover {
  transform: scale(1.1);
}

/* Number count-up animation */
.chairpoints-countup {
  display: inline-block;
  animation: pulse-scale 0.5s ease-out;
}

@keyframes pulse-scale {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}

/* Highlight effect for ChairPoints value */
.chairpoints-highlight {
  animation: highlight-flash 2s ease-out;
}

@keyframes highlight-flash {
  0%, 100% {
    background-color: transparent;
  }
  50% {
    background-color: rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 5px 10px;
  }
}
