/* ===================================
   Global Makeup Master - Animations
   =================================== */

/* Keyframes */
@keyframes sparkle {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    50% {
        transform: scale(1.2) rotate(10deg);
        opacity: 0.8;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.7;
    }
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes heartbreak {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.2);
    }

    50% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes celebrate {
    0% {
        transform: scale(0.5) rotate(-5deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.1) rotate(3deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes brushStroke {
    0% {
        clip-path: inset(0 100% 0 0);
    }

    100% {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation Classes */
.animate-fadeInUp {
    animation: fadeInUp 0.5s ease forwards;
}

/* Damage Effect */
.damage-flash {
    animation: shake 0.4s ease;
}

.damage-flash::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-zone-incorrect);
    pointer-events: none;
    animation: fadeOut 0.4s ease forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Makeup Application Effect */
.makeup-apply {
    animation: brushStroke 0.8s ease forwards;
}

/* Confetti */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall 4s linear infinite;
}

.confetti:nth-child(odd) {
    background: var(--color-primary);
    border-radius: 50%;
}

.confetti:nth-child(even) {
    background: var(--color-gold);
    transform: rotate(45deg);
}

/* Zone Highlight Animation (.face-zone is opacity: 0 by default) */
.face-zone.zone-correct {
    transition: none;
    opacity: 1;
    animation: zoneCorrect 0.5s ease;
    background: var(--color-zone-correct) !important;
    box-shadow: 0 0 12px 4px var(--color-zone-correct-glow);
}

.face-zone.zone-incorrect {
    transition: none;
    opacity: 1;
    animation: shake 0.4s ease;
    background: var(--color-zone-incorrect) !important;
    box-shadow: 0 0 12px 4px var(--color-zone-incorrect-glow);
}

@keyframes zoneCorrect {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}
