/* ==========================================================================
   JUICE.CSS - Efeitos Visuais, Game Feel e Animações do Mascote
   ========================================================================== */

/* ---------- Mascote Colherzinha Animada ---------- */
.mascote-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 10px 0 20px;
  position: relative;
}

.mascote-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mascote-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 90%;
  animation: colher-aceno 3.2s ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(16, 185, 129, 0.15));
  cursor: pointer;
  user-select: none;
}

/* Animação apontando para baixo (para campos de digitação) */
.mascote-aponta-baixo {
  animation: aponta-baixo 1.4s ease-in-out infinite;
  transform-origin: 50% 80%;
  filter: drop-shadow(0 8px 14px rgba(249, 115, 22, 0.18));
}

@keyframes aponta-baixo {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(8px) scale(1.02);
  }
}

/* Animação do cumprimento (aceno suave como uma mãozinha dizendo oi) */
@keyframes colher-aceno {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  15% {
    transform: rotate(14deg) translateY(-4px);
  }
  30% {
    transform: rotate(-10deg) translateY(-2px);
  }
  45% {
    transform: rotate(10deg) translateY(-4px);
  }
  60% {
    transform: rotate(-4deg) translateY(0);
  }
  75% {
    transform: rotate(0deg) translateY(0);
  }
}

/* Pulinho alegre ao acertar ou avançar */
.mascote-bounce {
  animation: colher-pulinho 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes colher-pulinho {
  0% { transform: scale(1) translateY(0); }
  35% { transform: scale(1.15, 0.85) translateY(4px); }
  60% { transform: scale(0.9, 1.15) translateY(-22px) rotate(8deg); }
  85% { transform: scale(1.05, 0.95) translateY(0) rotate(-3deg); }
  100% { transform: scale(1) translateY(0) rotate(0); }
}

/* Giro alegre 360 ao trocar receita */
.mascote-spin {
  animation: colher-giro 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes colher-giro {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.25) translateY(-14px); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Balão de Fala do Mascote */
.speech-bubble {
  background: #FFFFFF;
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  position: relative;
  box-shadow: var(--shadow-sm);
  max-width: 320px;
  text-align: center;
  margin-top: 10px;
  animation: bubble-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.speech-bubble::before {
  content: '';
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 9px 9px 9px;
  border-style: solid;
  border-color: transparent transparent var(--primary-light) transparent;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 7px 7px 7px;
  border-style: solid;
  border-color: transparent transparent #FFFFFF transparent;
}

.speech-bubble p {
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ---------- Giro 3D do Card da Receita ---------- */
.card-flip-wrap {
  perspective: 1000px;
  width: 100%;
}

.card-flip-inner {
  position: relative;
  width: 100%;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.card-flip-inner.is-flipped {
  transform: rotateY(180deg);
}

/* Efeito de Tremidinha de Sucesso ou Erro */
.shake-ok {
  animation: shake-ok 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake-ok {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* Partículas e Confetes */
.confetti-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 4px;
}

/* Brilho Shimmer nos Botões de Ação */
.shine-effect {
  position: relative;
  overflow: hidden;
}

.shine-effect::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    60deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 80%
  );
  transform: rotate(25deg);
  animation: shine-sweep 3.5s infinite;
}

@keyframes shine-sweep {
  0% { left: -60%; }
  30% { left: 140%; }
  100% { left: 140%; }
}
