/* Marvel Champions Animation Library */

:root {
    --animation-speed: 1;
}

/* Card Play Animation - Slide from hand to board */
@keyframes slideInFromBottom {
    0% {
        transform: translateY(200px) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateY(50px) scale(1.1);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.card-play-animation {
    animation: slideInFromBottom 0.5s ease-out;
}

/* Damage/Thwart Number Popup */
@keyframes floatUpFade {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }
    20% {
        transform: translateY(-10px) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(-60px) scale(1);
        opacity: 0;
    }
}

.damage-popup {
    position: absolute;
    font-size: 2.5rem;
    font-weight: bold;
    color: #ff4444;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    animation: floatUpFade 1.5s ease-out;
    pointer-events: none;
    z-index: 1000;
}

.heal-popup {
    position: absolute;
    font-size: 2.5rem;
    font-weight: bold;
    color: #44ff44;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    animation: floatUpFade 1.5s ease-out;
    pointer-events: none;
    z-index: 1000;
}

.thwart-popup {
    position: absolute;
    font-size: 2.5rem;
    font-weight: bold;
    color: #4444ff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    animation: floatUpFade 1.5s ease-out;
    pointer-events: none;
    z-index: 1000;
}

/* Attack Animation */
@keyframes attackShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-10px) rotate(-1deg); }
    20% { transform: translateX(10px) rotate(1deg); }
    30% { transform: translateX(-8px) rotate(-1deg); }
    40% { transform: translateX(8px) rotate(1deg); }
    50% { transform: translateX(-6px) rotate(-0.5deg); }
    60% { transform: translateX(6px) rotate(0.5deg); }
    70% { transform: translateX(-4px) rotate(-0.5deg); }
    80% { transform: translateX(4px) rotate(0.5deg); }
    90% { transform: translateX(-2px); }
}

.attack-animation {
    animation: attackShake 0.5s ease-in-out;
}

/* Phase Transition */
@keyframes phaseTransition {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.phase-transition {
    animation: phaseTransition 0.6s ease-out;
}

/* Card Draw Animation */
@keyframes drawCard {
    0% {
        transform: translateX(-100px) translateY(-50px) rotate(-10deg) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: translateX(0) translateY(0) rotate(0) scale(1);
        opacity: 1;
    }
}

.draw-animation {
    animation: drawCard 0.4s ease-out;
}

/* Exhausted Animation */
@keyframes exhaust {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(90deg);
        filter: grayscale(50%);
    }
}

.exhaust-animation {
    animation: exhaust 0.3s ease-in-out forwards;
}

/* Ready Animation */
@keyframes ready {
    0% {
        transform: rotate(90deg);
        filter: grayscale(50%);
    }
    100% {
        transform: rotate(0deg);
        filter: grayscale(0%);
    }
}

.ready-animation {
    animation: ready 0.3s ease-in-out forwards;
}

/* Victory Animation */
@keyframes victory {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.2) rotate(5deg);
    }
    50% {
        transform: scale(1.1) rotate(-5deg);
    }
    75% {
        transform: scale(1.15) rotate(3deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.victory-animation {
    animation: victory 1s ease-in-out infinite;
}

/* Defeat Animation */
@keyframes defeat {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: grayscale(0%);
    }
    100% {
        transform: scale(0.9) rotate(-5deg);
        opacity: 0.7;
        filter: grayscale(100%);
    }
}

.defeat-animation {
    animation: defeat 1s ease-in-out forwards;
}

/* Glow Pulse for Important Elements */
@keyframes glowPulse {
    0% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 215, 0, 0.5);
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
}

.glow-animation {
    animation: glowPulse 2s ease-in-out infinite;
}

/* Boost Card Reveal */
@keyframes boostReveal {
    0% {
        transform: rotateY(90deg) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: rotateY(0deg) scale(1.2);
    }
    100% {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
}

.boost-reveal-animation {
    animation: boostReveal 0.6s ease-out;
}

/* Encounter Card Reveal */
@keyframes encounterReveal {
    0% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translateY(20px) scale(1.1);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.encounter-reveal-animation {
    animation: encounterReveal 0.5s ease-out;
}

/* Surge Effect */
@keyframes surge {
    0% {
        transform: scale(1);
        filter: hue-rotate(0deg);
    }
    25% {
        transform: scale(1.1);
        filter: hue-rotate(90deg) brightness(1.2);
    }
    50% {
        transform: scale(1);
        filter: hue-rotate(180deg);
    }
    75% {
        transform: scale(1.1);
        filter: hue-rotate(270deg) brightness(1.2);
    }
    100% {
        transform: scale(1);
        filter: hue-rotate(360deg);
    }
}

.surge-animation {
    animation: surge 0.8s ease-in-out;
}

/* Threat Placement */
@keyframes threatPlace {
    0% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(90deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.threat-animation {
    animation: threatPlace 0.4s ease-out;
}

/* Flip Animation for Identity Change */
@keyframes flipIdentity {
    0% {
        transform: perspective(600px) rotateY(0deg);
    }
    50% {
        transform: perspective(600px) rotateY(90deg);
    }
    51% {
        transform: perspective(600px) rotateY(-90deg);
    }
    100% {
        transform: perspective(600px) rotateY(0deg);
    }
}

.flip-animation {
    animation: flipIdentity 0.6s ease-in-out;
}

/* Resource Generation Animation */
@keyframes resourceGenerate {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.resource-animation {
    animation: resourceGenerate 0.3s ease-out;
}

/* Stunned/Confused Status */
@keyframes statusPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.05);
        filter: brightness(1.3);
    }
}

.status-animation {
    animation: statusPulse 1.5s ease-in-out infinite;
}

/* Minion Spawn */
@keyframes minionSpawn {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(-90deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.minion-spawn-animation {
    animation: minionSpawn 0.5s ease-out;
}

/* Scheme Advancement */
@keyframes schemeAdvance {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    50% {
        transform: translateX(5px);
    }
    75% {
        transform: translateX(-3px);
    }
    100% {
        transform: translateX(0);
        filter: brightness(1.2);
    }
}

.scheme-advance-animation {
    animation: schemeAdvance 0.4s ease-in-out;
}

/* Card Hover Effect */
@keyframes cardHover {
    0% {
        transform: translateY(0) scale(1);
    }
    100% {
        transform: translateY(-10px) scale(1.05);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
}

.card-hover {
    transition: all 0.2s ease-out;
}

.card-hover:hover {
    animation: cardHover 0.2s ease-out forwards;
    z-index: 100;
}

/* Button Press Animation */
@keyframes buttonPress {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.button-press {
    animation: buttonPress 0.15s ease-out;
}

/* Loading Spinner */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Notification Slide-in */
@keyframes slideInNotification {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-animation {
    animation: slideInNotification 0.3s ease-out;
}

/* Victory Screen Effects */
@keyframes victoryBurst {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

.victory-burst {
    animation: victoryBurst 1s ease-out;
}

@keyframes confetti {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    animation: confetti 3s ease-in-out;
}

/* Defeat Screen Effects */
@keyframes defeatFade {
    0% {
        filter: grayscale(0%) blur(0px);
    }
    100% {
        filter: grayscale(100%) blur(2px);
    }
}

.defeat-fade {
    animation: defeatFade 1.5s ease-in-out forwards;
}

/* Turn Indicator Pulse */
@keyframes turnIndicator {
    0%, 100% {
        border-color: rgba(255, 215, 0, 0.5);
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    50% {
        border-color: rgba(255, 215, 0, 1);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }
}

.turn-indicator {
    animation: turnIndicator 2s ease-in-out infinite;
}

/* Combo Effect */
@keyframes comboFlash {
    0%, 100% {
        background: transparent;
    }
    50% {
        background: linear-gradient(45deg, rgba(255,215,0,0.3), rgba(255,100,0,0.3));
    }
}

.combo-animation {
    animation: comboFlash 0.3s ease-out;
}

/* Card Discard Animation */
@keyframes discardFade {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.8) rotate(10deg) translateY(50px);
        opacity: 0;
    }
}

.discard-animation {
    animation: discardFade 0.4s ease-in;
}

/* Upgrade Animation */
@keyframes upgradeShine {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.upgrade-animation {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    background-size: 200% 100%;
    animation: upgradeShine 1s ease-out;
}

/* Crisis Effect */
@keyframes crisisAlert {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(255, 0, 0, 0.2);
    }
}

.crisis-animation {
    animation: crisisAlert 0.5s ease-in-out 3;
}

/* Smooth Transitions for Common Elements */
.smooth-transition {
    transition: all 0.3s ease-out;
}

.fast-transition {
    transition: all 0.15s ease-out;
}

.slow-transition {
    transition: all 0.5s ease-out;
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}