/* 
 * vistas/dist/css/rpg-animations.css
 * Animaciones y efectos RPG para My Check
 */

/* ==========================================
   ANIMACIONES DE PARTÍCULAS Y EFECTOS
   ========================================== */

@keyframes goldCoinFall {
  0% {
    transform: translateY(-50px) rotate(0deg);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(20px) rotate(360deg);
    opacity: 0;
  }
}

@keyframes xpBarFill {
  from {
    width: 0%;
  }
}

@keyframes levelUpPulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.1);
    filter: brightness(1.3);
  }
}

@keyframes goldGlow {
  0%,
  100% {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  }
  50% {
    text-shadow:
      0 0 20px rgba(255, 215, 0, 0.8),
      0 0 30px rgba(255, 215, 0, 0.6);
  }
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) scale(1.2);
    opacity: 0;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================
   COMPONENTES RPG
   ========================================== */

/* Contenedor de Gold */
.gold-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.15),
    rgba(255, 165, 0, 0.15)
  );
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 20px;
  font-weight: bold;
  color: #ffd700;
  transition: all 0.3s ease;
}

.gold-counter:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.gold-counter.animating {
  animation: goldGlow 0.6s ease-in-out;
}

.gold-icon {
  font-size: 16px;
  filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.6));
}

/* Barra de XP Mejorada */
.xp-bar-container {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  transition: width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.xp-bar-fill.animating {
  animation: xpBarFill 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.xp-bar-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

/* Partículas de Monedas */
.gold-particle {
  position: fixed;
  font-size: 24px;
  pointer-events: none;
  z-index: 9999;
  animation: goldCoinFall 1s ease-out forwards;
}

/* Notificación Flotante RPG */
.rpg-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  background: linear-gradient(
    135deg,
    rgba(30, 30, 30, 0.95),
    rgba(50, 50, 50, 0.95)
  );
  border: 2px solid;
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  animation:
    slideInRight 0.5s ease-out,
    floatUp 0.5s ease-out 2.5s forwards;
  backdrop-filter: blur(10px);
}

.rpg-notification.xp-gain {
  border-color: #667eea;
}

.rpg-notification.gold-gain {
  border-color: #ffd700;
}

.rpg-notification.level-up {
  border-color: #ffc107;
  background: linear-gradient(
    135deg,
    rgba(255, 193, 7, 0.2),
    rgba(255, 152, 0, 0.2)
  );
}

.rpg-notification-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.rpg-notification-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 8px currentColor);
}

.rpg-notification-title {
  font-weight: bold;
  font-size: 16px;
  color: #fff;
}

.rpg-notification-body {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.4;
}

.rpg-notification-rewards {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.rpg-reward-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: bold;
}

.rpg-reward-item.xp {
  color: #667eea;
}

.rpg-reward-item.gold {
  color: #ffd700;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Efecto de Nivel Up */
.level-up-effect {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10001;
  pointer-events: none;
}

.level-up-badge {
  font-size: 120px;
  animation: levelUpPulse 1s ease-in-out 3;
  filter: drop-shadow(0 0 30px rgba(255, 193, 7, 0.8));
}

/* Partículas de Estrellas */
.sparkle-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  background: #ffd700;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  animation: sparkle 0.8s ease-out forwards;
}

/* Badge de Nivel Mejorado */
.level-badge-rpg {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(
    135deg,
    rgba(255, 193, 7, 0.2),
    rgba(255, 152, 0, 0.2)
  );
  border: 1.5px solid rgba(255, 193, 7, 0.4);
  border-radius: 12px;
  font-weight: bold;
  color: #ffc107;
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}

.level-badge-rpg:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
}

.level-badge-rpg.level-up-animation {
  animation: levelUpPulse 0.8s ease-in-out 3;
}

/* Tooltip RPG */
.rpg-tooltip {
  position: absolute;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  z-index: 10002;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(8px);
}

.rpg-tooltip.show {
  opacity: 1;
}

/* Efecto de Glow en Items */
.item-glow-common {
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.item-glow-rare {
  box-shadow: 0 0 15px rgba(0, 150, 255, 0.5);
}

.item-glow-epic {
  box-shadow: 0 0 20px rgba(138, 43, 226, 0.6);
}

.item-glow-legendary {
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
  animation: goldGlow 2s infinite;
}

/* Contador Animado */
.animated-counter {
  display: inline-block;
  transition: all 0.3s ease;
}

.animated-counter.counting {
  color: #4caf50;
  transform: scale(1.2);
  font-weight: bold;
}

/* Chat Toggle Float */
.chat-toggle-float {
  position: fixed !important;
  bottom: 80px !important;
  right: 20px !important;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(30, 30, 30, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2000;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.chat-toggle-float:hover {
  transform: scale(1.1);
  background: rgba(50, 50, 50, 0.9);
}

/* Chat Badge - iOS Style Matches consola-chat.css */
.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff3b30; /* iOS Red */
  color: white;
  border-radius: 10px; /* Pill shape */
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  line-height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff; /* White border for clean separation */
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 2001;
}
