/* Badge Notification System */
.badge-notification {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  max-width: 400px;
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border: 2px solid #667eea;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3), 0 0 0 1px rgba(102, 126, 234, 0.1);
  animation: slideInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1), bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.3s;
  transform-origin: top right;
}

.badge-notification--legendary {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 20px 60px rgba(245, 158, 11, 0.4), 0 0 40px rgba(245, 158, 11, 0.2);
  animation: slideInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1), bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.3s, legendaryPulse 2s ease-in-out infinite 1s;
}

.badge-notification--epic {
  border-color: #a855f7;
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  box-shadow: 0 20px 60px rgba(168, 85, 247, 0.3), 0 0 30px rgba(168, 85, 247, 0.2);
}

.badge-notification--rare {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes legendaryPulse {
  0%, 100% {
    box-shadow: 0 20px 60px rgba(245, 158, 11, 0.4), 0 0 40px rgba(245, 158, 11, 0.2);
  }
  50% {
    box-shadow: 0 20px 80px rgba(245, 158, 11, 0.6), 0 0 60px rgba(245, 158, 11, 0.4);
  }
}

.badge-notification__header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.badge-notification__icon-container {
  position: relative;
  flex-shrink: 0;
}

.badge-notification__icon {
  font-size: 64px;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.15));
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

.badge-notification__sparkles {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fbbf24;
  border-radius: 50%;
  opacity: 0;
  animation: sparkleAnimation 1.5s ease-out infinite;
}

.sparkle:nth-child(1) {
  top: 10%;
  left: 50%;
  animation-delay: 0s;
}

.sparkle:nth-child(2) {
  top: 30%;
  left: 80%;
  animation-delay: 0.3s;
}

.sparkle:nth-child(3) {
  top: 60%;
  left: 90%;
  animation-delay: 0.6s;
}

.sparkle:nth-child(4) {
  top: 80%;
  left: 50%;
  animation-delay: 0.9s;
}

.sparkle:nth-child(5) {
  top: 60%;
  left: 10%;
  animation-delay: 1.2s;
}

@keyframes sparkleAnimation {
  0% {
    opacity: 0;
    transform: scale(0) translateY(0);
  }
  50% {
    opacity: 1;
    transform: scale(1) translateY(-20px);
  }
  100% {
    opacity: 0;
    transform: scale(0) translateY(-40px);
  }
}

.badge-notification__content {
  flex: 1;
}

.badge-notification__title {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 4px 0;
}

.badge-notification__subtitle {
  font-size: 13px;
  color: #667eea;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.badge-notification__description {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 16px;
}

.badge-notification__rarity {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-notification__rarity--common {
  background: #e5e7eb;
  color: #6b7280;
}

.badge-notification__rarity--rare {
  background: #dbeafe;
  color: #1e40af;
}

.badge-notification__rarity--epic {
  background: #f3e8ff;
  color: #7e22ce;
}

.badge-notification__rarity--legendary {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.badge-notification__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  font-size: 18px;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.badge-notification__close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
  transform: rotate(90deg);
}

.badge-notification__actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.badge-notification__action {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.badge-notification__action--primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.badge-notification__action--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.badge-notification__action--secondary {
  background: white;
  color: #667eea;
  border: 1px solid #667eea;
}

.badge-notification__action--secondary:hover {
  background: #f9fafb;
}

/* Confetti Effect for Legendary Badges */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #f59e0b;
  animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

/* Sound Wave Effect */
.sound-waves {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
}

.sound-wave {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid #667eea;
  border-radius: 50%;
  opacity: 0;
  animation: soundWave 2s ease-out infinite;
}

.sound-wave:nth-child(2) {
  animation-delay: 0.5s;
}

.sound-wave:nth-child(3) {
  animation-delay: 1s;
}

@keyframes soundWave {
  0% {
    transform: scale(0.5);
    opacity: 0.8;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .badge-notification {
    top: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
    padding: 20px;
  }
  
  .badge-notification__icon {
    font-size: 48px;
  }
  
  .badge-notification__title {
    font-size: 16px;
  }
  
  .badge-notification__actions {
    flex-direction: column;
  }
}
