/* ================================================
   PONY PERFECTION - PREMIUM ANIMATIONS
   Magical Animations for $50k Agency Experience
   ================================================ */

/* === KEYFRAME ANIMATIONS === */

/* Gentle Bounce Animation for Icons */
@keyframes gentle-bounce {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Gentle Rotation for Hero Image */
@keyframes gentle-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Sparkle Effect Animation */
@keyframes sparkle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Sparkle Rotation */
@keyframes sparkle-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Floating Animation for Hero Elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(2deg);
    }
    50% {
        transform: translateY(-20px) rotate(0deg);
    }
    75% {
        transform: translateY(-10px) rotate(-2deg);
    }
}

/* Shimmer Effect for Text */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: 200px 0;
    }
}

/* Bounce Animation for Scroll Indicator */
@keyframes bounce-gentle {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(-50%, 0, 0);
    }
    40%, 43% {
        transform: translate3d(-50%, -8px, 0);
    }
    70% {
        transform: translate3d(-50%, -4px, 0);
    }
    90% {
        transform: translate3d(-50%, -2px, 0);
    }
}

/* Pulse Animation for CTA Buttons */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left Animation */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right Animation */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Wiggle Animation for Interactive Elements */
@keyframes wiggle {
    0%, 7% {
        transform: rotateZ(0);
    }
    15% {
        transform: rotateZ(-15deg);
    }
    20% {
        transform: rotateZ(10deg);
    }
    25% {
        transform: rotateZ(-10deg);
    }
    30% {
        transform: rotateZ(6deg);
    }
    35% {
        transform: rotateZ(-4deg);
    }
    40%, 100% {
        transform: rotateZ(0);
    }
}

/* Hearts Falling Animation */
@keyframes heartsfall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Gradient Animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
    }
}

/* Rainbow Text Animation */
@keyframes rainbow-text {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* === ANIMATION UTILITY CLASSES === */

/* Pulse Animation Class */
.pulse-animation {
    animation: pulse 2s infinite;
}

/* Hover Animations */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.hover-bounce {
    transition: all 0.3s ease;
}

.hover-bounce:hover {
    animation: gentle-bounce 0.6s ease-in-out;
}

.hover-wiggle {
    transition: all 0.3s ease;
}

.hover-wiggle:hover {
    animation: wiggle 0.6s ease-in-out;
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    animation: glow 1s ease-in-out;
}

/* Loading Animations */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: loading-dots 1.5s steps(4, end) infinite;
}

@keyframes loading-dots {
    0%, 20% {
        color: rgba(0, 0, 0, 0);
        text-shadow:
            .25em 0 0 rgba(0, 0, 0, 0),
            .5em 0 0 rgba(0, 0, 0, 0);
    }
    40% {
        color: black;
        text-shadow:
            .25em 0 0 rgba(0, 0, 0, 0),
            .5em 0 0 rgba(0, 0, 0, 0);
    }
    60% {
        text-shadow:
            .25em 0 0 black,
            .5em 0 0 rgba(0, 0, 0, 0);
    }
    80%, 100% {
        text-shadow:
            .25em 0 0 black,
            .5em 0 0 black;
    }
}

/* Scroll Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Animation for Grid Items */
.stagger-animation .grid-item:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-animation .grid-item:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-animation .grid-item:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-animation .grid-item:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-animation .grid-item:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-animation .grid-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* Magical Particle Effects */
.magical-particles {
    position: relative;
    overflow: hidden;
}

.magical-particles::before,
.magical-particles::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.magical-particles::before {
    top: 20%;
    left: 20%;
    animation-delay: -2s;
}

.magical-particles::after {
    top: 60%;
    right: 20%;
    animation-delay: -4s;
}

/* Text Animation Effects */
.text-gradient-animation {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease infinite;
}

.text-rainbow {
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-text 3s linear infinite;
}

/* Button Animation Effects */
.btn-magic {
    position: relative;
    overflow: hidden;
}

.btn-magic::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-magic:hover::before {
    left: 100%;
}

/* Card Flip Animation */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

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

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--border-radius);
}

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

/* Morphing Background Animation */
.morphing-bg {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: .15em solid orange;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: .15em;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret .75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: orange; }
}

/* Parallax Scroll Effect */
.parallax-element {
    transform: translateZ(0);
    transition: transform 0.1s linear;
}

/* Magnetic Button Effect */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.magnetic-btn:hover {
    transform: scale(1.05);
}

/* Smooth Reveal Animations */
.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-up.in-view {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.in-view {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.in-view {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.in-view {
    opacity: 1;
    transform: scale(1);
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .parallax-element {
        transform: none !important;
    }
}