/*
 * A Fantástica Aventura do Circo - Animations
 * Escola Maria Cacko Ballet Infantil
 */

/* ===== Keyframes ===== */

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-20px) translateX(-50%);
    }
    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

/* Mascot Bounce Animation */
@keyframes mascotBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Mascot Wave Animation */
@keyframes mascotWave {
    0% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    50% {
        transform: rotate(10deg);
    }
    75% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* Mascot Spin Animation */
@keyframes mascotSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide Up Animation */
@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide In Left Animation */
@keyframes slideInLeft {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide In Right Animation */
@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(189, 120, 200, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(189, 120, 200, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(189, 120, 200, 0);
    }
}

/* Float Animation */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Enhanced Float Animation with Rotation */
@keyframes floatWithRotate {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(2deg);
    }
    50% {
        transform: translateY(-15px) rotate(0deg);
    }
    75% {
        transform: translateY(-8px) rotate(-2deg);
    }
    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

/* ===== Mascot Animations ===== */

/* Base animated mascot class */
.animated-mascot {
    animation: float 3s ease-in-out infinite;
    transform-origin: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Mascot bounce animation */
.mascot-bounce {
    animation: mascotBounce 1s ease-in-out;
}

/* Mascot wave animation */
.mascot-wave {
    animation: mascotWave 1s ease-in-out;
    transform-origin: bottom center;
}

/* Mascot spin animation */
.mascot-spin {
    animation: mascotSpin 1s ease-in-out;
}

/* Mascot particles */
.mascot-particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.8;
    transition: all 1s ease-out;
    z-index: -1;
    pointer-events: none;
}

/* Mascot Animation Keyframes */
@keyframes mascotBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes mascotWave {
    0% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    50% {
        transform: rotate(10deg);
    }
    75% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes mascotSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Wobble Animation */
@keyframes wobble {
    0%, 100% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-10px) rotate(-5deg);
    }
    30% {
        transform: translateX(8px) rotate(3deg);
    }
    45% {
        transform: translateX(-6px) rotate(-3deg);
    }
    60% {
        transform: translateX(4px) rotate(2deg);
    }
    75% {
        transform: translateX(-2px) rotate(-1deg);
    }
}

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

/* Twinkle Animation */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 1;
    }
}

/* Pop Animation */
@keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        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);
    }
}

/* Bounce In Animation */
@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* ===== Animation Classes ===== */

/* Apply animations to elements */
.fade-in {
    animation: fadeIn 1s ease forwards;
}

.slide-up {
    animation: slideUp 1s ease forwards;
}

.slide-in-left {
    animation: slideInLeft 1s ease forwards;
}

.slide-in-right {
    animation: slideInRight 1s ease forwards;
}

.pulse {
    animation: pulse 2s infinite;
}

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

.float-rotate {
    animation: floatWithRotate 6s ease-in-out infinite;
}

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

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

.spin {
    animation: spin 10s linear infinite;
}

.pop {
    animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.shake {
    animation: shake 0.5s ease-in-out;
}

.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Animation Delays */
.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;
}

.delay-700 {
    animation-delay: 0.7s;
}

.delay-1000 {
    animation-delay: 1s;
}

/* ===== Specific Element Animations ===== */

/* Hero Section */
.mascot {
    animation: float 4s ease-in-out infinite;
}

.hero-title {
    opacity: 0;
    animation: fadeIn 1s ease forwards 0.3s;
}

.hero-subtitle {
    opacity: 0;
    animation: fadeIn 1s ease forwards 0.6s;
}

.hero-content .btn-primary {
    opacity: 0;
    animation: fadeIn 1s ease forwards 0.9s;
}

/* Stars in background */
.stars-overlay {
    animation: twinkle 4s ease-in-out infinite;
}

/* CTA Button Pulse */
.cta-section .btn-primary {
    animation: pulse 2s infinite;
}

/* Ticket Cards Hover Animation */
.ticket-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ticket-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(91, 42, 138, 0.2);
}

/* Timeline Animation */
.timeline-item {
    opacity: 0;
}

.timeline-item.animate {
    animation: fadeIn 1s ease forwards;
}

/* Mascot Footer Animation */
.mascot-footer .mascot-image {
    animation: float 4s ease-in-out infinite;
}

/* Social Icons Hover Animation */
.social-icon {
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-5px) rotate(10deg);
}

/* Scroll-triggered animations */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: all 1s ease;
}

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

.reveal-right {
    opacity: 0;
    transform: translateX(100px);
    transition: all 1s ease;
}

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

/* Staggered animations for timeline items */
.timeline-item:nth-child(1).active {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(2).active {
    animation-delay: 0.3s;
}

.timeline-item:nth-child(3).active {
    animation-delay: 0.5s;
}

.timeline-item:nth-child(4).active {
    animation-delay: 0.7s;
}

.timeline-item:nth-child(5).active {
    animation-delay: 0.9s;
}
