/* ===================================
   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 shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(232, 180, 184, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(232, 180, 184, 0.8);
    }
}

@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);
    }
}

@keyframes colorShift {

    0%,
    100% {
        filter: hue-rotate(0deg);
    }

    50% {
        filter: hue-rotate(30deg);
    }
}

/* Animation Classes */
.animate-sparkle {
    animation: sparkle 2s infinite;
}

.animate-pulse {
    animation: pulse 1.5s infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s ease;
}

.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: rgba(255, 0, 0, 0.3);
    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;
}

/* Success Sparkle */
.success-sparkle {
    position: relative;
}

.success-sparkle::before,
.success-sparkle::after {
    content: '✨';
    position: absolute;
    font-size: 1.5rem;
    animation: float 1s ease infinite;
}

.success-sparkle::before {
    top: -10px;
    left: -10px;
}

.success-sparkle::after {
    bottom: -10px;
    right: -10px;
    animation-delay: 0.5s;
}

/* Confetti */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall 4s linear infinite;
}

.confetti:nth-child(odd) {
    background: var(--primary-rose);
    border-radius: 50%;
}

.confetti:nth-child(even) {
    background: var(--primary-gold);
    transform: rotate(45deg);
}

/* Button Hover Effects */
.btn-shimmer {
    position: relative;
    overflow: hidden;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transition: 0.5s;
}

.btn-shimmer:hover::after {
    left: 100%;
}

/* Tool Selection Animation */
.tool-btn.selecting {
    animation: glow 0.5s ease;
}

/* Zone Highlight Animation */
.zone-correct {
    animation: pulse 0.5s ease, colorShift 0.5s ease;
    background: rgba(76, 175, 80, 0.4) !important;
}

.zone-incorrect {
    animation: shake 0.4s ease;
    background: rgba(255, 82, 82, 0.4) !important;
}

/* Screen Transition */
.screen-enter {
    animation: fadeInUp 0.5s ease forwards;
}

.screen-exit {
    animation: fadeOut 0.3s ease forwards;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(232, 180, 184, 0.3);
    border-top-color: var(--primary-rose);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Tooltip Animation */
.tooltip {
    animation: fadeInUp 0.3s ease;
}

/* Progress Bar Animation */
.progress-fill {
    transition: width 0.5s ease;
    background: linear-gradient(90deg,
            var(--primary-rose),
            var(--primary-gold),
            var(--primary-rose));
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}