/* Achievement Badge System Styling */
.achievement-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 20px 0;
}

/* Star Badge Styles */
.badge-outer {
  width: 120px;
  height: 120px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 15px;
  cursor: pointer;
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  background: linear-gradient(135deg, #8b5fb3 0%, #3a2259 100%);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.badge-inner {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: linear-gradient(145deg, #2d1a45 0%, #3a2259 100%);
  clip-path: polygon(
    50% 5%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
}

.badge-outer:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(139, 95, 179, 0.3);
}

.badge-icon {
  color: #c8a2e8;
  font-size: 28px;
  margin-bottom: 5px;
}

.badge-name {
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  padding: 0 5px;
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Locked badge styling */
.badge-locked .badge-inner {
  background: #aaa;
  opacity: 0.5;
}

.badge-locked .badge-outer {
  background: #888;
  opacity: 0.5;
}

.badge-locked .badge-icon {
  color: #555;
}

/* Badge animation when clicked */
.badge-clicked {
  animation: badgePulse 0.3s ease;
}

@keyframes badgePulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Badge tooltip */
.badge-tooltip {
  position: absolute;
  background: white;
  border-radius: 8px;
  padding: 10px 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  width: 200px;
  z-index: 100;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.badge-outer:hover .badge-tooltip {
  visibility: visible;
  opacity: 1;
}

.tooltip-title {
  font-weight: 600;
  color: #2d1a45;
  margin-bottom: 5px;
}

.tooltip-description {
  font-size: 0.85rem;
  color: #666;
}

/* Badge unlock notification */
.badge-unlock-notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: white;
  border-radius: 10px;
  padding: 15px;
  display: flex;
  align-items: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  animation: slideIn 0.5s ease forwards;
}

/* Add glimmer animation to newly unlocked badges */
.badge-new {
  position: relative;
  overflow: hidden;
}

.badge-new::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(45deg);
  animation: glimmer 2s ease-in-out infinite;
}

@keyframes glimmer {
  0% {
    transform: scale(0.5) rotate(45deg) translateX(-100%);
  }
  100% {
    transform: scale(0.5) rotate(45deg) translateX(100%);
  }
}
