/* ═══════════════════════════════════════════════════════════
   VEX MUSE - ANIMATIONS LIBRARY
   Additional effects and micro-interactions
   ═══════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────
   ENTRANCE ANIMATIONS
   ─────────────────────────────────────────────────────────── */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ───────────────────────────────────────────────────────────
   FLOATING ANIMATIONS
   ─────────────────────────────────────────────────────────── */

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

.float-slow {
    animation: floatSlow 4s ease-in-out infinite;
}

/* ───────────────────────────────────────────────────────────
   PULSE ANIMATIONS
   ─────────────────────────────────────────────────────────── */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(232, 148, 163, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(232, 148, 163, 0.6);
    }
}

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

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ───────────────────────────────────────────────────────────
   GRADIENT ANIMATIONS
   ─────────────────────────────────────────────────────────── */

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animated {
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

/* ───────────────────────────────────────────────────────────
   LOADING ANIMATIONS
   ─────────────────────────────────────────────────────────── */

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(232, 148, 163, 0.2);
    border-top-color: #e894a3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Dots loader */
@keyframes dotPulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: #e894a3;
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ───────────────────────────────────────────────────────────
   RIPPLE EFFECT (Touch feedback)
   ─────────────────────────────────────────────────────────── */

@keyframes ripple {
    from {
        transform: scale(0);
        opacity: 0.6;
    }
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    width: 100px;
    height: 100px;
    margin-top: -50px;
    margin-left: -50px;
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* ───────────────────────────────────────────────────────────
   IMAGE REVEAL EFFECTS
   ─────────────────────────────────────────────────────────── */

@keyframes imageReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.image-reveal {
    animation: imageReveal 0.8s ease-out;
}

/* ───────────────────────────────────────────────────────────
   TEXT ANIMATIONS
   ─────────────────────────────────────────────────────────── */

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 2s steps(40) 1s forwards;
}

/* Gradient text animation */
@keyframes gradientText {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.text-gradient-animated {
    background: linear-gradient(
        90deg,
        #e894a3,
        #ffc0cb,
        #fff,
        #ffc0cb,
        #e894a3
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 3s ease infinite;
}

/* ───────────────────────────────────────────────────────────
   CARD FLIP ANIMATION
   ─────────────────────────────────────────────────────────── */

.card-flip-container {
    perspective: 1000px;
}

.card-flip {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

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

.card-flip-front,
.card-flip-back {
    backface-visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.card-flip-back {
    transform: rotateY(180deg);
}

/* ───────────────────────────────────────────────────────────
   PARALLAX EFFECT
   ─────────────────────────────────────────────────────────── */

.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* Applied via JS based on scroll position */
.parallax-slow {
    transition: transform 0.3s ease-out;
}

/* ───────────────────────────────────────────────────────────
   GLOW EFFECTS
   ─────────────────────────────────────────────────────────── */

@keyframes glowPink {
    0%, 100% {
        box-shadow: 0 0 20px rgba(232, 148, 163, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(232, 148, 163, 0.8);
    }
}

.glow-pink {
    animation: glowPink 2s ease-in-out infinite;
}

/* ───────────────────────────────────────────────────────────
   STAGGER ANIMATIONS (for lists/grids)
   ─────────────────────────────────────────────────────────── */

.stagger-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }
.stagger-item:nth-child(7) { animation-delay: 0.7s; }
.stagger-item:nth-child(8) { animation-delay: 0.8s; }

/* ───────────────────────────────────────────────────────────
   SHAKE ANIMATION (for errors/alerts)
   ─────────────────────────────────────────────────────────── */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* ───────────────────────────────────────────────────────────
   BOUNCE ANIMATION
   ─────────────────────────────────────────────────────────── */

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-7px);
    }
}

.bounce {
    animation: bounce 1s ease;
}

/* ───────────────────────────────────────────────────────────
   UTILITY CLASSES
   ─────────────────────────────────────────────────────────── */

.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
}

/* Delay utilities */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* Duration utilities */
.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.6s; }
.duration-slow { animation-duration: 1s; }

/* ───────────────────────────────────────────────────────────
   PERFORMANCE OPTIMIZATIONS
   ─────────────────────────────────────────────────────────── */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
