.badge-notification-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.badge-notification-modal .backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  animation: backdropFadeIn 0.3s ease;
}

.badge-notification-modal .modal-content {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 24px;
  padding: 48px 32px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  overflow: hidden;
}

#confettiCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.badge-reveal {
  position: relative;
  z-index: 1;
  margin-bottom: 32px;
}

.badge-reveal .badge-icon-large {
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  display: block;
  animation: badgeBounce 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 8px 16px rgba(255, 107, 53, 0.3));
}

.badge-reveal h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
  animation: textFadeIn 0.6s ease 0.3s both;
}

.badge-reveal h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ff6b35;
  margin-bottom: 8px;
  animation: textFadeIn 0.6s ease 0.4s both;
}

.badge-reveal p {
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
  animation: textFadeIn 0.6s ease 0.5s both;
}

.rewards-box {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  animation: textFadeIn 0.6s ease 0.6s both;
}

.rewards-box h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.rewards-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rewards-box ul li {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 1rem;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.rewards-box ul li:last-child {
  border-bottom: none;
}

.rewards-box ul li span {
  font-weight: 600;
  color: #ff6b35;
}

.modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  animation: textFadeIn 0.6s ease 0.7s both;
}

.modal-actions button {
  padding: 12px 24px;
  border: none;
  border-radius: 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 120px;
}

.modal-actions button:first-child {
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.modal-actions button:first-child:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.modal-actions button:nth-child(2) {
  background: #fff;
  color: #ff6b35;
  border: 2px solid #ff6b35;
}

.modal-actions button:nth-child(2):hover {
  background: #ff6b35;
  color: #fff;
  transform: translateY(-2px);
}

.modal-actions button:last-child {
  background: #f0f0f0;
  color: #666;
}

.modal-actions button:last-child:hover {
  background: #e0e0e0;
  transform: translateY(-2px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes backdropFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(100px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes badgeBounce {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  75% {
    transform: scale(0.9) rotate(-5deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes textFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 107, 53, 0.6);
  }
}

.badge-icon-large.legendary {
  animation:
    badgeBounce 1s cubic-bezier(0.34, 1.56, 0.64, 1),
    pulseGlow 2s infinite 1s;
}

@media (max-width: 768px) {
  .badge-notification-modal .modal-content {
    padding: 32px 24px;
    max-width: 100%;
    width: 95%;
    border-radius: 16px;
  }

  .badge-reveal .badge-icon-large {
    width: 96px;
    height: 96px;
    margin-bottom: 20px;
  }

  .badge-reveal h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
  }

  .badge-reveal h3 {
    font-size: 1.2rem;
  }

  .badge-reveal p {
    font-size: 0.9rem;
  }

  .rewards-box {
    padding: 16px;
    margin-bottom: 20px;
  }

  .rewards-box h4 {
    font-size: 1rem;
    margin-bottom: 12px;
  }

  .rewards-box ul li {
    padding: 8px 0;
    font-size: 0.9rem;
  }

  .modal-actions {
    flex-direction: column;
    gap: 8px;
  }

  .modal-actions button {
    width: 100%;
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .badge-notification-modal .modal-content {
    padding: 24px 16px;
  }

  .badge-reveal .badge-icon-large {
    width: 80px;
    height: 80px;
  }

  .badge-reveal h2 {
    font-size: 1.3rem;
  }

  .badge-reveal h3 {
    font-size: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge-notification-modal,
  .badge-notification-modal .backdrop,
  .badge-notification-modal .modal-content,
  .badge-reveal .badge-icon-large,
  .badge-reveal h2,
  .badge-reveal h3,
  .badge-reveal p,
  .rewards-box,
  .modal-actions {
    animation: none !important;
    transition: none !important;
  }

  .badge-icon-large.legendary {
    animation: none !important;
  }
}
