/* ============================================
   TOTY'S MAGIC BOX - ANIMATIONS
   Keyframes and Animation Classes
   ============================================ */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Pulse Ring */
@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Float Animation for Particles */
@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Float Gentle Animation */
@keyframes floatGentle {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    25% {
        transform: translateY(-20px) translateX(10px);
    }

    50% {
        transform: translateY(-10px) translateX(-5px);
    }

    75% {
        transform: translateY(-25px) translateX(15px);
    }
}

/* Scroll Arrow Animation */
@keyframes scrollArrow {
    0% {
        transform: rotate(45deg) translateY(0);
        opacity: 1;
    }

    50% {
        transform: rotate(45deg) translateY(10px);
        opacity: 0.5;
    }

    100% {
        transform: rotate(45deg) translateY(0);
        opacity: 1;
    }
}

/* Bounce Up Animation */
@keyframes bounceUp {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Marquee Animation */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* Gradient Shift Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down Animation */
@keyframes fadeInDown {
    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.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Reveal Horizontal Animation */
@keyframes revealHorizontal {
    from {
        clip-path: inset(0 100% 0 0);
    }

    to {
        clip-path: inset(0 0 0 0);
    }
}

/* Reveal Vertical Animation */
@keyframes revealVertical {
    from {
        clip-path: inset(100% 0 0 0);
    }

    to {
        clip-path: inset(0 0 0 0);
    }
}

/* Glow Pulse Animation */
@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(240, 45, 114, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(240, 45, 114, 0.6);
    }
}

/* Star Twinkle Animation */
@keyframes twinkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* Heart Beat Animation */
@keyframes heartBeat {

    0%,
    100% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.15);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.15);
    }

    70% {
        transform: scale(1);
    }
}

/* Shake Animation */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Ripple Animation */
@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* ============================================
   ANIMATION UTILITY CLASSES
   ============================================ */

/* Reveal Animations (initialized by GSAP but have fallback) */
.reveal-fade {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.reveal-fade.revealed {
    opacity: 1;
}

.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Delay Utilities */
.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.delay-400 {
    transition-delay: 0.4s;
}

.delay-500 {
    transition-delay: 0.5s;
}

.delay-600 {
    transition-delay: 0.6s;
}

.delay-700 {
    transition-delay: 0.7s;
}

.delay-800 {
    transition-delay: 0.8s;
}

/* Duration Utilities */
.duration-fast {
    transition-duration: 0.2s;
}

.duration-normal {
    transition-duration: 0.5s;
}

.duration-slow {
    transition-duration: 0.8s;
}

.duration-slower {
    transition-duration: 1.2s;
}

/* Continuous Animations */
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-float {
    animation: floatGentle 6s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 10s linear infinite;
}

.animate-twinkle {
    animation: twinkle 2s ease-in-out infinite;
}

.animate-heartbeat {
    animation: heartBeat 1.5s ease-in-out infinite;
}

.animate-shimmer {
    position: relative;
    overflow: hidden;
}

.animate-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: shimmer 2s infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Hover Animation Classes */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(240, 45, 114, 0.2);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(240, 45, 114, 0.4);
}

.hover-rotate {
    transition: transform 0.5s ease;
}

.hover-rotate:hover {
    transform: rotate(360deg);
}

/* ============================================
   LOADING STATES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(240, 45, 114, 0.1);
    border-top-color: var(--rosa-principal);
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .testimonials-track {
        animation: none;
    }

    .particle {
        display: none;
    }
}

/* ============================================
   WILL-CHANGE OPTIMIZATIONS
   ============================================ */

.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-all {
    will-change: transform, opacity;
}

/* ============================================
   AOS OVERRIDES & SMOOTH TRANSITIONS
   ============================================ */

/* Ensure all sections have smooth transitions */
.section {
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Smooth section links */
html {
    scroll-behavior: smooth;
}

/* AOS Animation optimizations */
[data-aos] {
    pointer-events: auto !important;
}

/* Service cards smooth hover */
.service-card {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gallery items smooth appear */
.gallery-item {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Timeline smooth animations */
.timeline-step {
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-step-number {
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55),
        opacity 0.5s ease;
}

.timeline-step-content {
    transition: transform 0.6s ease, opacity 0.6s ease;
}

/* Section headers smooth */
.section-header {
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* About section smooth */
.about-image-wrapper,
.about-content {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.8s ease;
}