/* Participant-specific styles for Kahoot Clone */

/* Smooth transitions for state changes */
.step {
  animation: fadeIn 0.3s ease-in;
}

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

/* Answer button hover effects */
.answer-btn {
  transition: all 0.2s ease;
}

.answer-btn:hover:not(:disabled) {
  transform: scale(1.05) translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.answer-btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* Timer pulse animation when low */
#timer {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Loading spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Bounce animation for waiting dots */
.animate-bounce {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Medal bounce animation */
.animate-bounce-slow {
  animation: bounceSlow 2s infinite;
}

@keyframes bounceSlow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Selected answer highlight for multiple correct */
.answer-btn.ring-8 {
  box-shadow: 0 0 0 8px white;
}

/* Gradient background animations */
body {
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Feedback animations */
#feedbackState {
  animation: slideInUp 0.5s ease-out;
}

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

/* Leaderboard entry animations */
#leaderboard > div {
  animation: slideInLeft 0.3s ease-out;
  animation-fill-mode: both;
}

#leaderboard > div:nth-child(1) {
  animation-delay: 0.1s;
}

#leaderboard > div:nth-child(2) {
  animation-delay: 0.2s;
}

#leaderboard > div:nth-child(3) {
  animation-delay: 0.3s;
}

#leaderboard > div:nth-child(4) {
  animation-delay: 0.4s;
}

#leaderboard > div:nth-child(5) {
  animation-delay: 0.5s;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .answer-btn {
    padding: 2rem 1rem;
    font-size: 1.25rem;
  }

  #timer {
    font-size: 4rem;
  }

  #questionText {
    font-size: 1.5rem;
  }
}

/* Focus styles for accessibility */
input:focus,
button:focus {
  outline: 3px solid rgba(139, 92, 246, 0.5);
  outline-offset: 2px;
}

/* Disabled state */
button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Type-in input focus effect */
#typeInInput:focus {
  animation: inputPulse 2s ease-in-out infinite;
}

@keyframes inputPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(250, 204, 21, 0);
  }
}

/* Accuracy bar animation */
#accuracyBar {
  transition: width 1s ease-out;
}

/* Celebration shake animation */
.celebrate {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-10px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(10px);
  }
}

/* Print styles */
@media print {
  body {
    background: white;
  }

  .no-print {
    display: none;
  }
}
