/* ============================================
   WELLSPRING CHURCH - ANIMATIONS CSS
   Epic scroll-triggered and mouse animations
   ============================================ */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Float Animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Pulse Glow */
@keyframes pulseGlow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(75, 181, 227, 0.4);
    }
    50% { 
        box-shadow: 0 0 40px rgba(75, 181, 227, 0.6);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Rotate */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Wave Animation */
@keyframes wave {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-5px) translateY(-5px); }
    50% { transform: translateX(0) translateY(-10px); }
    75% { transform: translateX(5px) translateY(-5px); }
}

/* Bounce Soft */
@keyframes bounceSoft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Gradient Shift */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Text Reveal */
@keyframes textReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

/* Slide In */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fade In */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Particle Float */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

/* Water Ripple */
@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   HERO ANIMATIONS
   ============================================ */

.hero-title-line {
    animation: slideInUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-title-line:nth-child(1) { animation-delay: 0.2s; }
.hero-title-line:nth-child(2) { animation-delay: 0.4s; }
.hero-title-line:nth-child(3) { animation-delay: 0.6s; }

.hero-subtitle {
    animation: slideInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.8s forwards;
}

.hero-cta {
    animation: slideInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 1s forwards;
}

/* Hero Particles */
.hero-particles .particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: particleFloat 15s ease-in-out infinite;
}

/* Button Hover Effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.btn-primary:hover::before {
    transform: translateX(100%);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.btn-primary:hover::after {
    width: 300%;
    height: 300%;
}

/* Glow Animation on Hover */
.btn-glow {
    box-shadow: 0 0 30px rgba(75, 181, 227, 0.5);
}

.btn-glow:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(75, 181, 227, 0.6);
}

/* ============================================
   SCROLL-TRIGGERED ANIMATIONS
   ============================================ */

/* Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Delays */
.reveal[data-delay="100"] { transition-delay: 0.1s; }
.reveal[data-delay="200"] { transition-delay: 0.2s; }
.reveal[data-delay="300"] { transition-delay: 0.3s; }
.reveal[data-delay="400"] { transition-delay: 0.4s; }
.reveal[data-delay="500"] { transition-delay: 0.5s; }
.reveal[data-delay="600"] { transition-delay: 0.6s; }

/* ============================================
   PARALLAX EFFECTS
   ============================================ */

.parallax-slow {
    transition: transform 0.1s linear;
}

.parallax-medium {
    transition: transform 0.05s linear;
}

.parallax-fast {
    transition: transform 0.02s linear;
}

/* ============================================
   CARD ANIMATIONS
   ============================================ */

/* Service Cards */
.service-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-12px) scale(1.02);
}

.service-card:hover .service-card-image img {
    transform: scale(1.15);
}

/* Value Cards */
.value-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Tilt Effect - Enhanced for Desktop */
@media (hover: hover) and (min-width: 1024px) {
    .tilt-card {
        transform-style: preserve-3d;
        perspective: 1000px;
    }
    
    .tilt-card:hover {
        transform: rotateX(var(--rotateX, 0)) rotateY(var(--rotateY, 0));
    }
    
    .tilt-card-inner {
        transform: translateZ(20px);
    }
}

/* ============================================
   TEXT ANIMATIONS
   ============================================ */

/* Gradient Text Animation */
.gradient-text {
    background: linear-gradient(
        90deg,
        var(--color-primary),
        var(--color-primary-light),
        var(--color-primary-dark),
        var(--color-primary)
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 6s ease infinite;
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--color-primary);
    animation: 
        typing 3s steps(40) 1s forwards,
        blink 0.5s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Letter Hover Effect */
.hover-letter {
    display: inline-block;
    transition: all 0.3s ease;
}

.hover-letter:hover {
    color: var(--color-primary);
    transform: translateY(-5px) scale(1.1);
}

/* ============================================
   IMAGE ANIMATIONS
   ============================================ */

/* Zoom on Hover */
.image-zoom {
    overflow: hidden;
}

.image-zoom img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-zoom:hover img {
    transform: scale(1.1);
}

/* Image Reveal */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-primary);
    transform: scaleX(1);
    transform-origin: right;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-reveal.revealed::after {
    transform: scaleX(0);
}

/* ============================================
   LOADING STATES
   ============================================ */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-gray-100) 25%,
        var(--color-gray-200) 50%,
        var(--color-gray-100) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* ============================================
   INTERACTIVE ELEMENTS
   ============================================ */

/* Link Underline Animation */
.link-animated {
    position: relative;
    display: inline-block;
}

.link-animated::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.link-animated:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Icon Bounce */
.icon-bounce:hover svg {
    animation: bounceSoft 0.5s ease-in-out;
}

/* Magnetic Button Effect */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   SCROLL PROGRESS
   ============================================ */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ============================================
   MOUSE FOLLOWER ANIMATIONS
   ============================================ */

.mouse-follower {
    position: fixed;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(75, 181, 227, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.1s ease;
}

/* ============================================
   WATER RIPPLE EFFECT
   ============================================ */

.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(75, 181, 227, 0.3);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* ============================================
   FLOATING ELEMENTS
   ============================================ */

.float {
    animation: float 3s ease-in-out infinite;
}

.float-delayed {
    animation: float 3s ease-in-out infinite 0.5s;
}

.float-slow {
    animation: float 5s ease-in-out infinite;
}

/* ============================================
   SECTION TRANSITIONS
   ============================================ */

.section-enter {
    opacity: 0;
    transform: translateY(50px);
}

.section-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   MOBILE TOUCH EFFECTS
   ============================================ */

@media (hover: none) {
    .touch-highlight {
        -webkit-tap-highlight-color: rgba(75, 181, 227, 0.2);
    }
    
    .touch-feedback:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .parallax-slow,
    .parallax-medium,
    .parallax-fast {
        transform: none !important;
    }
    
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}
