/*
 * K2 : Le Sommet du Management
 * Animations CSS additionnelles
 */

/* Card flip animation for drawing */
@keyframes card-draw {
    0% { transform: rotateY(180deg) scale(0.8); opacity: 0; }
    50% { transform: rotateY(90deg) scale(0.9); opacity: 0.5; }
    100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

#state-question .card-display {
    animation: card-draw 0.6s ease-out;
}

/* Pion movement trail */
@keyframes pion-trail {
    0% { box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
    50% { box-shadow: 0 2px 20px rgba(59,130,246,0.6); }
    100% { box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
}

/* Result entrance */
@keyframes result-enter {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

#state-result .result-container {
    animation: result-enter 0.5s ease-out;
}

/* Result choice cards stagger */
.rc-choice {
    animation: result-enter 0.4s ease-out both;
}
.rc-choice:nth-child(1) { animation-delay: 0.05s; }
.rc-choice:nth-child(2) { animation-delay: 0.15s; }
.rc-choice:nth-child(3) { animation-delay: 0.25s; }
.rc-choice:nth-child(4) { animation-delay: 0.35s; }

/* Impact items bounce in */
@keyframes impact-bounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.impact-item {
    animation: impact-bounce 0.4s ease-out;
}
.impact-item:nth-child(2) { animation-delay: 0.1s; }
.impact-item:nth-child(3) { animation-delay: 0.2s; }

/* Active team pulse */
.team-hud.active-team::before {
    content: '▶';
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: inherit;
    font-size: 0.8rem;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Deck button hover shimmer */
.deck-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.5s;
}
.deck-btn {
    position: relative;
    overflow: hidden;
}
.deck-btn:hover::before {
    left: 100%;
}

/* Shield glow */
.hud-shield i {
    animation: shield-glow 2s ease-in-out infinite;
}

@keyframes shield-glow {
    0%, 100% { text-shadow: 0 0 5px rgba(255,215,0,0.3); }
    50% { text-shadow: 0 0 20px rgba(255,215,0,0.8); }
}

/* Choice button ripple on click */
.choice-btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* Smooth color transitions for correct/wrong */
.choice-btn.correct {
    transition: all 0.5s ease;
}
.choice-btn.wrong {
    transition: all 0.5s ease;
    animation: wrong-shake 0.5s ease;
}

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

/* O2 bar animation on change */
.o2-bar {
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Zone highlight when team enters */
.zone.zone-active {
    animation: zone-pulse 1s ease;
}

@keyframes zone-pulse {
    0% { box-shadow: inset 0 0 0 rgba(255,255,255,0); }
    50% { box-shadow: inset 0 0 20px rgba(255,255,255,0.1); }
    100% { box-shadow: inset 0 0 0 rgba(255,255,255,0); }
}

/* Modal content animations */
.modal-content {
    animation: modal-pop 0.3s ease-out;
}

@keyframes modal-pop {
    0% { transform: scale(0.8) translateY(20px); }
    100% { transform: scale(1) translateY(0); }
}

/* Victory screen specific */
#screen-victory .victory-content {
    animation: result-enter 0.8s ease-out;
}

.trophy {
    animation: trophy-bounce 2s ease-in-out infinite;
}

@keyframes trophy-bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(-3deg); }
    50% { transform: translateY(-15px) rotate(0deg); }
    75% { transform: translateY(-10px) rotate(3deg); }
}
