/**
 * Tournament Tinder-Style Animations
 */

/* Slide out animation */
.yuv-duel-arena.yuv-slide-out {
  animation: slideOutLeft 0.6s ease-in forwards;
}

@keyframes slideOutLeft {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}

/* Slide in animation */
.yuv-duel-arena.yuv-slide-in {
  animation: slideInRight 0.6s ease-out forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Winner animation - scale up and glow */
.yuv-contender.yuv-winner-animation {
  animation: winnerPulse 1.2s ease-out forwards;
  z-index: 10;
}

@keyframes winnerPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(76, 175, 80, 0);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(76, 175, 80, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(76, 175, 80, 0);
  }
}

/* Loser animation - fade out */
.yuv-contender.yuv-loser-animation {
  animation: loserFade 1.2s ease-out forwards;
}

@keyframes loserFade {
  0% {
    opacity: 1;
    filter: brightness(1);
  }
  100% {
    opacity: 0.3;
    filter: brightness(0.5) grayscale(1);
  }
}

/* Progress Bar - inside arena frame */
.yuv-duel-arena .yuv-progress-container {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  height: 6px;
  margin: 15px 30px 20px 30px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.yuv-progress-fill {
  background: linear-gradient(90deg, #ff6b6b, #ffa500);
  height: 100%;
  transition: width 0.5s ease;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.yuv-progress-text {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  margin-top: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Navigation Dots */
.yuv-match-navigation {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 30px 0;
  padding: 20px;
}

.yuv-nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  cursor: default;
}

.yuv-nav-dot.completed {
  background: #4caf50;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.yuv-nav-dot.active {
  background: #ffc107;
  box-shadow: 0 0 15px rgba(255, 193, 7, 0.7);
  transform: scale(1.3);
}

/* Bracket final view animation */
#bracket-results {
  animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Toast success message enhancement */
.yuv-vote-toast {
  animation: toastBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes toastBounce {
  0% {
    transform: translateY(-100px) scale(0.5);
    opacity: 0;
  }
  50% {
    transform: translateY(10px) scale(1.05);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ========================================================================
   STAGE COMPLETE SCREEN
   ======================================================================== */

.yuv-stage-complete {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  min-height: 500px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 20px;
  animation: fadeInScale 0.6s ease-out;
}

.yuv-complete-icon {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  margin-bottom: 30px;
  color: white;
  box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
  animation: checkBounce 0.8s ease-out 0.3s both;
}

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

.yuv-stage-complete h2 {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 15px 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.yuv-stage-complete p {
  font-size: 18px;
  color: #a1a1a1;
  margin: 0 0 40px 0;
}

.yuv-btn-primary {
  display: inline-block;
  padding: 16px 40px;
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(255, 107, 53, 0.4);
}

.yuv-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(255, 107, 53, 0.6);
  color: white;
  text-decoration: none;
}

/* Mobile optimizations */
/* ==========================================================================
   MATCHES STRIP (Footer)
   ========================================================================== */

.yuv-matches-strip {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 2px solid rgba(255, 255, 255, 0.1);
  scrollbar-width: thin;
  scrollbar-color: #4355a4 rgba(255, 255, 255, 0.1);
}

.yuv-matches-strip::-webkit-scrollbar {
  height: 6px;
}

.yuv-matches-strip::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.yuv-matches-strip::-webkit-scrollbar-thumb {
  background: #4355a4;
  border-radius: 3px;
}

.yuv-strip-card {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.yuv-strip-card:hover {
  border-color: #4355a4;
  transform: scale(1.05);
}

.yuv-strip-card.current {
  border-color: #fe6555;
  border-width: 3px;
  box-shadow: 0 0 20px rgba(254, 101, 85, 0.5);
}

.yuv-strip-card.voted {
  border-color: #28a745;
  background: rgba(40, 167, 69, 0.1);
}

.yuv-strip-img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.yuv-strip-vs {
  font-size: 10px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
}

.yuv-check {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: #28a745;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.5);
}

/* ==========================================================================
   RESULT OVERLAY (After Vote)
   ========================================================================== */

.yuv-result-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 5;
}

.yuv-result-overlay.show {
  opacity: 1;
}

.yuv-result-overlay .yuv-percent {
  font-size: 64px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  animation: popIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ==========================================================================
   MINIMAL HEADER (No Progress Bar)
   ========================================================================== */

.yuv-arena-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 40px;
  background: rgba(67, 85, 164, 0.2);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(254, 101, 85, 0.3);
}

.yuv-match-title {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   VS BADGE (Centered)
   ========================================================================== */

.yuv-vs-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid #fe6555;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  color: #fe6555;
  box-shadow: 0 8px 30px rgba(254, 101, 85, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .yuv-progress-container {
    max-width: 90%;
  }

  .yuv-nav-dot {
    width: 10px;
    height: 10px;
  }

  .yuv-match-navigation {
    gap: 8px;
  }

  .yuv-battle-arena {
    flex-direction: column;
  }

  .yuv-contender {
    min-height: 400px;
  }

  .yuv-vs-badge {
    top: 400px;
    transform: translate(-50%, -50%) scale(0.8);
  }

  .yuv-matches-strip {
    padding: 15px;
    gap: 10px;
  }

  .yuv-strip-card {
    width: 100px;
    height: 70px;
  }

  .yuv-strip-img {
    width: 30px;
    height: 30px;
  }

  .yuv-result-overlay .yuv-percent {
    font-size: 48px;
  }
}
