/* ===================================================================
   COMUNIDADE CATÓLICA YESHUÁ - ANIMATIONS STYLESHEET
   Advanced animations and effects
   =================================================================== */

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

/* Fade 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);
    }
}

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

@keyframes scaleInBounce {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(59, 130, 246, 0);
    }
}

@keyframes pulseSoft {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 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 Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(-10px);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

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

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

/* Slide Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Wave Animation */
@keyframes wave {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
    60% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

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

/* Float Animation */
@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(3deg);
    }
}

@keyframes floatMedium {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(-2deg);
    }
}

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

/* Morph Animation */
@keyframes morphBlob {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    50% {
        border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%;
    }
    75% {
        border-radius: 60% 40% 60% 30% / 70% 30% 50% 60%;
    }
}

/* Text Animations */
@keyframes textReveal {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

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

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Glow Effects */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.2),
                    0 0 10px rgba(59, 130, 246, 0.2),
                    0 0 20px rgba(59, 130, 246, 0.2);
    }
    50% {
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.4),
                    0 0 20px rgba(59, 130, 246, 0.4),
                    0 0 40px rgba(59, 130, 246, 0.4);
    }
}

/* Progress Animation */
@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: var(--progress, 100%);
    }
}

/* Particle Float */
@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx, 100px), var(--ty, -100px)) rotate(var(--rotation, 360deg));
        opacity: 0;
    }
}

/* ==================== ANIMATION UTILITIES ==================== */

/* Delay Classes */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }
.delay-900 { animation-delay: 900ms; }
.delay-1000 { animation-delay: 1000ms; }

/* Duration Classes */
.duration-fast { animation-duration: 150ms !important; }
.duration-normal { animation-duration: 300ms !important; }
.duration-slow { animation-duration: 500ms !important; }
.duration-slower { animation-duration: 800ms !important; }
.duration-slowest { animation-duration: 1200ms !important; }

/* Animation Play State */
.animation-paused { animation-play-state: paused; }
.animation-running { animation-play-state: running; }

/* ==================== HOVER EFFECTS ==================== */

/* Magnetic Effect */
.magnetic {
    transition: transform 0.3s ease-out;
}

.magnetic:hover {
    transform: translateY(-5px);
}

/* Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Scale Effect */
.hover-scale {
    transition: transform 0.3s ease;
}

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

/* Glow Effect */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}

/* Shine Effect */
.hover-shine {
    position: relative;
    overflow: hidden;
}

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

.hover-shine:hover::before {
    left: 100%;
}

/* Underline Effect */
.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.hover-underline:hover::after {
    width: 100%;
}

/* Border Animation */
.hover-border {
    position: relative;
}

.hover-border::before,
.hover-border::after {
    content: '';
    position: absolute;
    transition: all 0.3s ease;
}

.hover-border::before {
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
}

.hover-border::after {
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
}

.hover-border:hover::before,
.hover-border:hover::after {
    width: 100%;
}

/* ==================== SCROLL REVEAL ANIMATIONS ==================== */

.reveal {
    opacity: 0;
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
}

.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

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

.reveal-down {
    opacity: 0;
    transform: translateY(-50px);
    transition: all 0.8s ease;
}

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

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

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

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

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

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease;
}

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

.reveal-rotate {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
    transition: all 0.8s ease;
}

.reveal-rotate.active {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* ==================== STAGGER ANIMATIONS ==================== */

.stagger-container > * {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s ease;
}

.stagger-container.active > *:nth-child(1) { transition-delay: 0ms; }
.stagger-container.active > *:nth-child(2) { transition-delay: 100ms; }
.stagger-container.active > *:nth-child(3) { transition-delay: 200ms; }
.stagger-container.active > *:nth-child(4) { transition-delay: 300ms; }
.stagger-container.active > *:nth-child(5) { transition-delay: 400ms; }
.stagger-container.active > *:nth-child(6) { transition-delay: 500ms; }
.stagger-container.active > *:nth-child(7) { transition-delay: 600ms; }
.stagger-container.active > *:nth-child(8) { transition-delay: 700ms; }
.stagger-container.active > *:nth-child(9) { transition-delay: 800ms; }
.stagger-container.active > *:nth-child(10) { transition-delay: 900ms; }

.stagger-container.active > * {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== BUTTON ANIMATIONS ==================== */

/* Button Ripple */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.btn-ripple:active::after {
    animation: ripple 0.6s ease-out;
}

/* Button Bounce */
.btn-bounce:hover {
    animation: bounce 0.5s ease;
}

/* Button Pulse */
.btn-pulse:hover {
    animation: pulseGlow 1s ease infinite;
}

/* Button Shake */
.btn-shake.error {
    animation: shake 0.5s ease;
}

/* ==================== LOADING ANIMATIONS ==================== */

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Dots Loading */
.dots-loading {
    display: flex;
    gap: 8px;
}

.dots-loading span {
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce 0.6s ease-in-out infinite;
}

.dots-loading span:nth-child(1) { animation-delay: 0ms; }
.dots-loading span:nth-child(2) { animation-delay: 100ms; }
.dots-loading span:nth-child(3) { animation-delay: 200ms; }

/* Pulse Loading */
.pulse-loading {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ==================== TEXT ANIMATIONS ==================== */

/* Gradient Text Animation */
.text-gradient-animate {
    background: linear-gradient(
        90deg,
        var(--primary-color),
        var(--secondary-color),
        var(--accent-gold),
        var(--primary-color)
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 5s ease infinite;
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--primary-color);
    animation: typewriter 3s steps(30) 1s forwards, blink 0.75s step-end infinite;
}

/* Text Reveal */
.text-reveal {
    position: relative;
    display: inline-block;
}

.text-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    animation: textReveal 1s ease forwards reverse;
}

/* ==================== PARALLAX EFFECTS ==================== */

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

.parallax-slow {
    will-change: transform;
    transition: transform 0.1s linear;
}

.parallax-medium {
    will-change: transform;
    transition: transform 0.15s linear;
}

.parallax-fast {
    will-change: transform;
    transition: transform 0.2s linear;
}

/* ==================== MOUSE FOLLOW EFFECTS ==================== */

.mouse-glow {
    position: relative;
    overflow: hidden;
}

.mouse-glow::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mouse-glow:hover::before {
    opacity: 1;
}

/* ==================== CARD ANIMATIONS ==================== */

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

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

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

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

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

/* Card Tilt */
.card-tilt {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.card-tilt:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* ==================== ICON ANIMATIONS ==================== */

.icon-bounce:hover {
    animation: bounce 0.5s ease;
}

.icon-spin:hover {
    animation: spin 0.5s ease;
}

.icon-pulse:hover {
    animation: pulse 0.5s ease;
}

.icon-shake:hover {
    animation: shake 0.5s ease;
}

.icon-wave:hover {
    animation: wave 1s ease;
}

/* ==================== NOTIFICATION ANIMATIONS ==================== */

@keyframes notificationSlide {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    10% {
        transform: translateX(0);
        opacity: 1;
    }
    90% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification-animate {
    animation: notificationSlide 4s ease forwards;
}

/* ==================== FORM ANIMATIONS ==================== */

/* Input Focus Animation */
.input-animated {
    position: relative;
}

.input-animated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: all 0.3s ease;
}

.input-animated:focus-within::after {
    left: 0;
    width: 100%;
}

/* Label Float Animation */
.label-float {
    position: relative;
}

.label-float label {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    pointer-events: none;
    color: var(--gray-400);
}

.label-float input:focus + label,
.label-float input:not(:placeholder-shown) + label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    color: var(--primary-color);
    background: white;
    padding: 0 5px;
}

/* Checkbox Animation */
.checkbox-animated {
    position: relative;
    width: 20px;
    height: 20px;
}

.checkbox-animated input {
    display: none;
}

.checkbox-animated .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox-animated input:checked + .checkmark {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
}

.checkbox-animated .checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-animated input:checked + .checkmark::after {
    display: block;
    animation: scaleInBounce 0.3s ease;
}

/* ==================== COUNTER ANIMATIONS ==================== */

.counter-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.counter-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

.counter-number {
    display: inline-block;
    transition: transform 0.1s ease;
}

.counter-number.counting {
    transform: scale(1.1);
}

/* ==================== SPECIAL EFFECTS ==================== */

/* Blur In */
@keyframes blurIn {
    from {
        filter: blur(10px);
        opacity: 0;
    }
    to {
        filter: blur(0);
        opacity: 1;
    }
}

.blur-in {
    animation: blurIn 0.6s ease forwards;
}

/* Flip In */
@keyframes flipInX {
    from {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotateX(-10deg);
    }
    70% {
        transform: perspective(400px) rotateX(10deg);
    }
    to {
        transform: perspective(400px) rotateX(0);
        opacity: 1;
    }
}

.flip-in-x {
    animation: flipInX 0.8s ease forwards;
}

@keyframes flipInY {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotateY(-10deg);
    }
    70% {
        transform: perspective(400px) rotateY(10deg);
    }
    to {
        transform: perspective(400px) rotateY(0);
        opacity: 1;
    }
}

.flip-in-y {
    animation: flipInY 0.8s ease forwards;
}

/* Zoom In Rotate */
@keyframes zoomInRotate {
    from {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.zoom-in-rotate {
    animation: zoomInRotate 0.6s ease forwards;
}

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */

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

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

.will-change-all {
    will-change: transform, opacity;
}

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