/**
 * GymDiet Master — Personal Record (PR) Celebration Modal
 * Dark Luxe Obsidian (#000000, #05080e), Emerald Neon (#00f076), and Trophy Gold (#fbbf24).
 * Spring physics entrance, radial glow aura, and tabular numerals.
 */

.pr-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.pr-modal-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

.pr-modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, #0d1424 0%, #05080e 100%);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-top-color: rgba(255, 255, 255, 0.4);
  border-radius: 28px;
  padding: 32px 24px 28px;
  box-sizing: border-box;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 50px rgba(251, 191, 36, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: scale(0.85) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.pr-modal-backdrop.is-visible .pr-modal-card {
  transform: scale(1) translateY(0);
}

/* Background Radial Aura */
.pr-modal-aura {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.25) 0%, rgba(0, 240, 118, 0.15) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: pr-aura-pulse 2.5s infinite alternate ease-in-out;
}

@keyframes pr-aura-pulse {
  0% { transform: translateX(-50%) scale(0.9); opacity: 0.7; }
  100% { transform: translateX(-50%) scale(1.15); opacity: 1; }
}

/* Trophy Icon Badge */
.pr-modal-badge {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(0, 240, 118, 0.15) 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: pr-badge-float 3s infinite ease-in-out;
}

@keyframes pr-badge-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.pr-modal-badge svg {
  width: 40px;
  height: 40px;
  color: #fbbf24;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
}

/* Titles */
.pr-modal-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 10px;
}

.pr-modal-exercise {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 18px;
  line-height: 1.25;
  letter-spacing: -0.4px;
}

/* Metric Stats Container */
.pr-metric-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 16px 14px;
  margin-bottom: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.pr-metric-main {
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.1;
  margin-bottom: 6px;
}

.pr-metric-main span {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  margin-left: 2px;
}

.pr-metric-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pr-diff-badge {
  background: rgba(0, 240, 118, 0.18);
  border: 1px solid rgba(0, 240, 118, 0.4);
  color: #00f076;
  font-weight: 800;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 8px;
}

/* Actions */
.pr-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pr-btn-continue {
  width: 100%;
  padding: 14px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #00f076 0%, #17c987 100%);
  border: none;
  color: #000000;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 240, 118, 0.35);
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease;
}

.pr-btn-continue:active {
  transform: scale(0.96);
}

.pr-btn-share {
  width: 100%;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.16s ease;
}

.pr-btn-share:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

.pr-btn-share:active {
  transform: scale(0.97);
}

.pr-btn-share svg {
  width: 18px;
  height: 18px;
  color: #fbbf24;
}

/* Celebratory Confetti Burst */
.pr-confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
  border-radius: 28px;
}

.pr-confetti-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--size, 8px);
  height: var(--size, 8px);
  background: var(--color, #00f076);
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  animation: pr-confetti-burst 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes pr-confetti-burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) translate(0, 0) rotate(0deg) scale(0.4);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -50%) translate(calc(var(--tx) * 0.7), calc(var(--ty) * 0.7)) rotate(calc(var(--rot) * 0.5)) scale(1.1);
  }
  75% {
    opacity: 0.9;
    transform: translate(-50%, -50%) translate(var(--tx), calc(var(--ty) + 24px)) rotate(var(--rot)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--tx), calc(var(--ty) + 60px)) rotate(calc(var(--rot) * 1.2)) scale(0.6);
  }
}

