/* PR Badges CSS - 3D animated achievement badges */

.pr-badges-container {
  padding: 1.5rem;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Stats Summary */
.pr-stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e5e7eb;
}

.pr-stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.pr-stat-item:hover {
  background: #f3f4f6;
  transform: translateY(-2px);
}

.pr-stat-icon {
  font-size: 1.5rem;
}

.pr-stat-content {
  display: flex;
  flex-direction: column;
}

.pr-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
}

.pr-stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* Category Sections */
.badge-category-section {
  margin-bottom: 2rem;
}

.category-header {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.5rem;
}

/* Individual Badge */
.pr-badge {
  width: 150px;
  height: 150px;
  perspective: 1000px;
  cursor: pointer;
  margin: 0 auto;
}

.badge-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.badge-front,
.badge-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.badge-back {
  transform: rotateY(180deg);
}

.badge-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.badge-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  padding: 0 0.5rem;
}

.badge-details {
  text-align: center;
  color: #ffffff;
  padding: 1rem;
}

.detail-label {
  font-size: 0.75rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.detail-date {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Unlock Animation */
@keyframes badgeUnlock {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(360deg);
    opacity: 1;
  }
}

.pr-badge.unlocking .badge-inner {
  animation: badgeUnlock 1s ease-out;
}

/* Glow Effect */
@keyframes badgeGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6),
                0 0 40px rgba(255, 215, 0, 0.4),
                0 0 60px rgba(255, 215, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8),
                0 0 60px rgba(255, 215, 0, 0.6),
                0 0 90px rgba(255, 215, 0, 0.4);
  }
}

.pr-badge.glowing .badge-front {
  animation: badgeGlow 2s ease-in-out;
}

/* Particle Effects */
.badge-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  background: #ffd700;
  border-radius: 50%;
  pointer-events: none;
  animation: particleFly 1s ease-out forwards;
}

@keyframes particleFly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(
      calc(cos(var(--angle)) * var(--velocity)),
      calc(sin(var(--angle)) * var(--velocity))
    ) scale(0);
    opacity: 0;
  }
}

/* Share Button */
.badge-share-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10;
}

.pr-badge:hover .badge-share-btn {
  opacity: 1;
}

.badge-share-btn:hover {
  background: #ffffff;
  transform: scale(1.1);
}

/* Empty State */
.pr-empty-state {
  text-align: center;
  padding: 3rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.pr-empty-state h3 {
  font-size: 1.25rem;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.pr-empty-state p {
  color: #6b7280;
}

/* Error State */
.pr-error-state {
  text-align: center;
  padding: 2rem;
  color: #ef4444;
}

.error-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Toast Notification */
.pr-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1f2937;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.pr-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 767px) {
  .pr-badges-container {
    padding: 1rem;
  }
  
  .pr-stats-summary {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
  }
  
  .pr-stat-item {
    padding: 0.75rem;
  }
  
  .pr-stat-value {
    font-size: 1.25rem;
  }
  
  .badges-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
  }
  
  .pr-badge {
    width: 120px;
    height: 120px;
  }
  
  .badge-icon {
    font-size: 2.5rem;
  }
  
  .badge-title {
    font-size: 0.75rem;
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .pr-badges-container {
    background: #1f2937;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  }
  
  .pr-stat-item {
    background: #111827;
  }
  
  .pr-stat-item:hover {
    background: #1f2937;
  }
  
  .pr-stat-value {
    color: #f9fafb;
  }
  
  .pr-stat-label {
    color: #9ca3af;
  }
  
  .category-header {
    color: #f9fafb;
  }
  
  .pr-stats-summary {
    border-bottom-color: #374151;
  }
  
  .pr-empty-state h3 {
    color: #f9fafb;
  }
  
  .pr-empty-state p {
    color: #9ca3af;
  }
}