/* Speech Recognition + Alternative Images Styles */

.animal.listening {
  animation: pulse-listening 1.5s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

@keyframes pulse-listening {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.8);
  }
}

.animal.correct {
  animation: bounce-correct 0.6s ease-in-out;
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

@keyframes bounce-correct {
  0%, 100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(0.95);
  }
  75% {
    transform: scale(1.05);
  }
}

.animal.incorrect {
  animation: shake-incorrect 0.5s ease-in-out;
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

@keyframes shake-incorrect {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.animal.sparkle {
  animation: sparkle-glow 0.6s ease-in-out;
  position: relative;
  overflow: visible;
}

@keyframes sparkle-glow {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.08);
    filter: brightness(1.3);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
  }
}

.animal img {
  transition: opacity 0.3s ease;
}

/* Microphone button on animal cards */
.mic-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  z-index: 10;
}

.mic-button:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.mic-button:active {
  transform: scale(0.95);
}

.animal.listening .mic-button {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  animation: pulse-mic 1s ease-in-out infinite;
}

@keyframes pulse-mic {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

/* Success/error feedback badges */
.feedback-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 60px;
  z-index: 20;
  pointer-events: none;
  animation: fade-out 1s ease-out forwards;
}

@keyframes fade-out {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Info banner */
.speech-info {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  padding: 15px 20px;
  border-radius: 15px;
  margin: 10px 0 20px 0;
  text-align: center;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.1);
  max-width: 800px;
}

.speech-info p {
  margin: 5px 0;
  color: #1e40af;
  font-size: 0.95rem;
}

.speech-info strong {
  color: #1e3a8a;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .mic-button {
    width: 35px;
    height: 35px;
    font-size: 18px;
    top: 8px;
    right: 8px;
  }
  
  .feedback-badge {
    font-size: 48px;
  }
}
