/* ========================================
   REWARD ANIMATION STYLES
   Floating XP and Bronze animations
   ======================================== */

/* Floating reward icons that fly to status bar */
.floating-reward {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 1.1rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  filter: drop-shadow(0 0 10px currentColor);
}

.floating-reward-xp {
  color: #f7a00f;
}

.floating-reward-bronze {
  color: #f59e0b;
}

.floating-reward-icon {
  font-size: 1.5rem;
  animation: reward-icon-glow 0.3s ease-out infinite alternate;
}

.floating-reward-value {
  font-family: 'Orbitron', monospace;
}

/* Animation phases */
.floating-reward.phase-rising {
  left: var(--start-x);
  top: var(--start-y);
  transform: translate(-50%, -50%) scale(0);
  animation: reward-rise 0.3s ease-out forwards;
}

.floating-reward.phase-flying {
  animation: reward-fly 0.5s ease-in-out forwards;
}

.floating-reward.phase-done {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
}

@keyframes reward-rise {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -100%) scale(1.3);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -80%) scale(1);
    opacity: 1;
  }
}

@keyframes reward-fly {
  0% {
    left: var(--start-x);
    top: var(--start-y);
    transform: translate(-50%, -80%) scale(1);
    opacity: 1;
  }
  30% {
    transform: translate(-50%, -50%) scale(1.1);
  }
  100% {
    left: var(--end-x);
    top: var(--end-y);
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.8;
  }
}

@keyframes reward-icon-glow {
  0% {
    filter: brightness(1);
  }
  100% {
    filter: brightness(1.3);
  }
}

/* Hit XP flying animation - spawns from player and flies to XP bar */
@keyframes hit-xp-fly {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  15% {
    transform: translate(-50%, -80%) scale(1.2);
    opacity: 1;
  }
  30% {
    transform: translate(-50%, -60%) scale(1);
    opacity: 1;
  }
  100% {
    left: var(--target-x);
    top: var(--target-y);
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
}

/* Pulse effect on status bar elements */
.reward-pulse {
  animation: status-pulse 0.3s ease-out;
}

@keyframes status-pulse {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.1);
    filter: brightness(1.5);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

/* Special pulse for XP bar */
.top-xp-bar-container.reward-pulse {
  animation: xp-bar-pulse 0.3s ease-out;
}

@keyframes xp-bar-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.6);
  }
  50% {
    box-shadow: 0 0 20px 5px rgba(167, 139, 250, 0.8);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(167, 139, 250, 0);
  }
}

/* Special pulse for bronze */
.bronze-currency.reward-pulse {
  animation: bronze-pulse 0.3s ease-out;
}

@keyframes bronze-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6);
  }
  50% {
    box-shadow: 0 0 20px 5px rgba(245, 158, 11, 0.8);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

/* Level up overlay */
.level-up-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  animation: level-up-fade-in 0.3s ease-out;
}

@keyframes level-up-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.level-up-content {
  text-align: center;
  animation: level-up-bounce 0.6s ease-out;
}

@keyframes level-up-bounce {
  0% {
    transform: scale(0) rotate(-10deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(5deg);
  }
  70% {
    transform: scale(0.9) rotate(-2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.level-up-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 
    0 0 20px rgba(251, 191, 36, 0.8),
    0 0 40px rgba(251, 191, 36, 0.6),
    0 4px 8px rgba(0, 0, 0, 0.5);
  animation: level-up-glow 0.5s ease-in-out infinite alternate;
}

@keyframes level-up-glow {
  0% {
    filter: brightness(1);
    text-shadow: 
      0 0 20px rgba(251, 191, 36, 0.8),
      0 0 40px rgba(251, 191, 36, 0.6),
      0 4px 8px rgba(0, 0, 0, 0.5);
  }
  100% {
    filter: brightness(1.2);
    text-shadow: 
      0 0 30px rgba(251, 191, 36, 1),
      0 0 60px rgba(251, 191, 36, 0.8),
      0 4px 8px rgba(0, 0, 0, 0.5);
  }
}

.level-up-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 4rem;
  font-weight: 900;
  color: white;
  text-shadow: 
    0 0 15px rgba(167, 139, 250, 0.8),
    0 4px 8px rgba(0, 0, 0, 0.5);
  margin-top: 0.5rem;
}

/* ========================================
   XP BAR FILL ANIMATION
   Smooth progress bar increase
   ======================================== */

.top-xp-fill {
  transition: width 0.5s ease-out;
}

.top-xp-fill.animating {
  transition: width 1s ease-out;
}

/* Glow effect when XP increases - orange color */
.top-xp-bar-wide.xp-increasing .top-xp-fill {
  box-shadow: 0 0 15px rgba(247, 160, 15, 0.8), 0 0 25px rgba(247, 160, 15, 0.5);
  background: linear-gradient(90deg, #f7a00f 0%, #ffb733 100%);
}

/* Live XP counting animation */
.top-xp-text.counting {
  animation: xp-count-pulse 0.15s ease-out;
  color: #f7a00f;
}

@keyframes xp-count-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ========================================
   BRONZE VALUE ANIMATION
   Number counting up effect
   ======================================== */

.bronze-currency.value-changing .currency-value {
  animation: value-bump 0.3s ease-out;
}

@keyframes value-bump {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
    color: #22c55e;
  }
  100% {
    transform: scale(1);
  }
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
  .floating-reward {
    font-size: 0.9rem;
  }
  
  .floating-reward-icon {
    font-size: 1.2rem;
  }
  
  .level-up-text {
    font-size: 2rem;
  }
  
  .level-up-number {
    font-size: 3rem;
  }
}
