/**
 * Additional animations for elements
 * 
 * @package Ciencia_Para_Todas
 */

/* Scroll-triggered animations using Intersection Observer */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Float animation for decorative elements */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Rotate animation for sparkles */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Pulse animation for buttons */
@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(45, 185, 181, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(45, 185, 181, 0);
    }
}

/* Fade in up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Apply animations */
.wave-shape-1 {
    animation: slideInLeft 1s ease forwards;
}

.wave-shape-2 {
    animation: slideInRight 1s ease 0.2s forwards;
}

.hero-title {
    animation: scaleIn 0.8s ease 0.4s forwards;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease 0.6s forwards;
}

.hero-cta {
    animation: fadeInUp 0.8s ease 0.8s forwards;
}

.sparkle-0,
.sparkle-1,
.sparkle-2 {
    animation: rotate 4s linear infinite;
}

/* Card hover effects */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px) scale(1.02);
}

/* Button hover effects */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Loading spinner for form submission */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .animate-on-scroll {
        transform: translateY(20px);
    }

    .wave-shape-1,
    .wave-shape-2 {
        animation-duration: 0.6s;
    }
}