/*
 * Judah Global Support - Animation Styles
 * Advanced animations for scroll reveals, hover effects & transitions
 */

/* ========================================
   AOS (Animate On Scroll) Custom Animations
======================================== */

/* Fade Animations */
[data-aos="fade-up"] {
    opacity: 0;
    transform: translateY(50px);
    transition-property: transform, opacity;
}

[data-aos="fade-up"].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

[data-aos="fade-down"] {
    opacity: 0;
    transform: translateY(-50px);
    transition-property: transform, opacity;
}

[data-aos="fade-down"].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

[data-aos="fade-left"] {
    opacity: 0;
    transform: translateX(-50px);
    transition-property: transform, opacity;
}

[data-aos="fade-left"].aos-animate {
    opacity: 1;
    transform: translateX(0);
}

[data-aos="fade-right"] {
    opacity: 0;
    transform: translateX(50px);
    transition-property: transform, opacity;
}

[data-aos="fade-right"].aos-animate {
    opacity: 1;
    transform: translateX(0);
}

/* Zoom Animations */
[data-aos="zoom-in"] {
    opacity: 0;
    transform: scale(0.6);
    transition-property: transform, opacity;
}

[data-aos="zoom-in"].aos-animate {
    opacity: 1;
    transform: scale(1);
}

[data-aos="zoom-in-up"] {
    opacity: 0;
    transform: scale(0.6) translateY(50px);
    transition-property: transform, opacity;
}

[data-aos="zoom-in-up"].aos-animate {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Flip Animations */
[data-aos="flip-left"] {
    opacity: 0;
    transform: perspective(2500px) rotateY(-100deg);
    transition-property: transform, opacity;
}

[data-aos="flip-left"].aos-animate {
    opacity: 1;
    transform: perspective(2500px) rotateY(0);
}

[data-aos="flip-right"] {
    opacity: 0;
    transform: perspective(2500px) rotateY(100deg);
    transition-property: transform, opacity;
}

[data-aos="flip-right"].aos-animate {
    opacity: 1;
    transform: perspective(2500px) rotateY(0);
}

[data-aos="flip-up"] {
    opacity: 0;
    transform: perspective(2500px) rotateX(-100deg);
    transition-property: transform, opacity;
}

[data-aos="flip-up"].aos-animate {
    opacity: 1;
    transform: perspective(2500px) rotateX(0);
}

/* Slide Animations */
[data-aos="slide-up"] {
    transform: translateY(100%);
    transition-property: transform;
}

[data-aos="slide-up"].aos-animate {
    transform: translateY(0);
}

/* Custom Animations */
[data-aos="reveal-up"] {
    clip-path: inset(100% 0 0 0);
    transition-property: clip-path;
}

[data-aos="reveal-up"].aos-animate {
    clip-path: inset(0 0 0 0);
}

[data-aos="reveal-left"] {
    clip-path: inset(0 100% 0 0);
    transition-property: clip-path;
}

[data-aos="reveal-left"].aos-animate {
    clip-path: inset(0 0 0 0);
}

/* Stagger Delays */
[data-aos-delay="100"] { transition-delay: 100ms; }
[data-aos-delay="200"] { transition-delay: 200ms; }
[data-aos-delay="300"] { transition-delay: 300ms; }
[data-aos-delay="400"] { transition-delay: 400ms; }
[data-aos-delay="500"] { transition-delay: 500ms; }
[data-aos-delay="600"] { transition-delay: 600ms; }
[data-aos-delay="700"] { transition-delay: 700ms; }
[data-aos-delay="800"] { transition-delay: 800ms; }

/* Duration Classes */
[data-aos][data-aos-duration="300"] { transition-duration: 300ms; }
[data-aos][data-aos-duration="400"] { transition-duration: 400ms; }
[data-aos][data-aos-duration="500"] { transition-duration: 500ms; }
[data-aos][data-aos-duration="600"] { transition-duration: 600ms; }
[data-aos][data-aos-duration="700"] { transition-duration: 700ms; }
[data-aos][data-aos-duration="800"] { transition-duration: 800ms; }
[data-aos][data-aos-duration="1000"] { transition-duration: 1000ms; }
[data-aos][data-aos-duration="1200"] { transition-duration: 1200ms; }

/* ========================================
   HERO SECTION ANIMATIONS
======================================== */
.hero-animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Particle Animation */
.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(212, 168, 83, 0.3);
    border-radius: 50%;
    animation: particleFloat 15s infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 14s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 16s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 13s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 15s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 11s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2s; animation-duration: 17s; }
.particle:nth-child(8) { left: 80%; animation-delay: 4s; animation-duration: 14s; }
.particle:nth-child(9) { left: 90%; animation-delay: 1s; animation-duration: 12s; }
.particle:nth-child(10) { left: 15%; animation-delay: 3s; animation-duration: 16s; }

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* Wave Animation */
.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.hero-wave svg {
    position: absolute;
    bottom: 0;
    width: 200%;
    height: 100%;
}

.hero-wave svg path {
    fill: var(--white);
}

.hero-wave .wave-1 {
    animation: wave 8s linear infinite;
    opacity: 0.5;
}

.hero-wave .wave-2 {
    animation: wave 6s linear infinite reverse;
    opacity: 0.3;
}

.hero-wave .wave-3 {
    animation: wave 10s linear infinite;
    opacity: 0.2;
}

@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Gradient Orbs */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: orbFloat 8s ease-in-out infinite;
}

.gradient-orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--deep-saffron), var(--gold));
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.gradient-orb-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--royal-blue), var(--royal-blue-light));
    bottom: -50px;
    left: -50px;
    animation-delay: 2s;
}

.gradient-orb-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--gold), var(--saffron-light));
    top: 40%;
    left: 30%;
    animation-delay: 4s;
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    75% {
        transform: translate(-30px, -20px) scale(1.05);
    }
}

/* ========================================
   TEXT ANIMATIONS
======================================== */
.text-reveal {
    overflow: hidden;
    display: inline-block;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    animation: textReveal 0.8s ease forwards;
}

@keyframes textReveal {
    to {
        transform: translateY(0);
    }
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--gold);
    white-space: nowrap;
    animation:
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--gold) }
}

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

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========================================
   CARD ANIMATIONS
======================================== */
.card-hover-lift {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.4s ease;
}

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

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

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

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

.card-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg) translateX(-100%);
    transition: 0.6s;
}

.card-shine:hover::after {
    transform: rotate(45deg) translateX(100%);
}

/* Border Glow */
.card-border-glow {
    position: relative;
}

.card-border-glow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--deep-saffron), var(--gold), var(--royal-blue), var(--deep-saffron));
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: borderGlow 3s ease infinite;
}

.card-border-glow:hover::before {
    opacity: 1;
}

@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========================================
   ICON ANIMATIONS
======================================== */
.icon-bounce {
    animation: iconBounce 2s ease infinite;
}

@keyframes iconBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.icon-pulse {
    animation: iconPulse 2s ease infinite;
}

@keyframes iconPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

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

@keyframes iconShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.icon-spin {
    animation: iconSpin 3s linear infinite;
}

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

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

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

/* ========================================
   BUTTON ANIMATIONS
======================================== */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.btn-ripple:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* Heartbeat Button */
.btn-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.05); }
    28% { transform: scale(1); }
    42% { transform: scale(1.05); }
    70% { transform: scale(1); }
}

/* CTA Attention Animation */
.cta-attention {
    animation: ctaAttention 2s ease-in-out infinite;
}

@keyframes ctaAttention {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
    }
    50% {
        box-shadow: 0 4px 40px rgba(255, 107, 53, 0.8),
                    0 0 0 10px rgba(255, 107, 53, 0.1);
    }
}

/* ========================================
   SCROLL INDICATOR
======================================== */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--white);
    opacity: 0.8;
    animation: fadeInUp 1s ease 1.5s forwards;
    opacity: 0;
}

.scroll-indicator span {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.scroll-mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--white);
    border-radius: 25px;
    position: relative;
}

.scroll-mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 10px;
    background: var(--gold);
    border-radius: 3px;
    animation: scrollDown 2s ease-in-out infinite;
}

@keyframes scrollDown {
    0%, 100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 0.5;
        transform: translateX(-50%) translateY(15px);
    }
}

/* ========================================
   LOADING ANIMATIONS
======================================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--royal-blue-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--white);
    margin-bottom: 30px;
}

.loader-logo span {
    color: var(--gold);
}

.loader-bar {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.loader-progress {
    height: 100%;
    background: var(--gradient-saffron);
    animation: loaderProgress 1.5s ease-in-out infinite;
}

@keyframes loaderProgress {
    0% {
        width: 0;
        margin-left: 0;
    }
    50% {
        width: 100%;
        margin-left: 0;
    }
    100% {
        width: 0;
        margin-left: 100%;
    }
}

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

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   PARALLAX EFFECTS
======================================== */
.parallax-container {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 140%;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Parallax Elements */
[data-parallax] {
    will-change: transform;
}

/* ========================================
   COUNTER ANIMATION
======================================== */
.counter {
    font-family: var(--font-heading);
    font-variant-numeric: tabular-nums;
}

.counter.animate {
    animation: countUp 2s ease-out forwards;
}

/* ========================================
   IMAGE ANIMATIONS
======================================== */
.img-reveal {
    position: relative;
    overflow: hidden;
}

.img-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--royal-blue-dark);
    z-index: 1;
    transform: translateX(-101%);
}

.img-reveal.revealed::before {
    animation: imgReveal 1s ease forwards;
}

@keyframes imgReveal {
    0% { transform: translateX(-101%); }
    50% { transform: translateX(0); }
    100% { transform: translateX(101%); }
}

.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.6s ease;
}

.img-zoom:hover img {
    transform: scale(1.1);
}

/* ========================================
   NOTIFICATION ANIMATIONS
======================================== */
.notification-slide {
    animation: notificationSlide 0.5s ease forwards;
}

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

.notification-exit {
    animation: notificationExit 0.5s ease forwards;
}

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

/* ========================================
   MENU ANIMATIONS
======================================== */
.menu-slide-in {
    animation: menuSlideIn 0.4s ease forwards;
}

@keyframes menuSlideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.menu-slide-out {
    animation: menuSlideOut 0.4s ease forwards;
}

@keyframes menuSlideOut {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* Menu Item Stagger */
.menu-item-animate {
    opacity: 0;
    transform: translateX(50px);
}

.menu-item-animate.animate {
    animation: menuItemIn 0.4s ease forwards;
}

.menu-item-animate:nth-child(1) { animation-delay: 0.1s; }
.menu-item-animate:nth-child(2) { animation-delay: 0.15s; }
.menu-item-animate:nth-child(3) { animation-delay: 0.2s; }
.menu-item-animate:nth-child(4) { animation-delay: 0.25s; }
.menu-item-animate:nth-child(5) { animation-delay: 0.3s; }
.menu-item-animate:nth-child(6) { animation-delay: 0.35s; }
.menu-item-animate:nth-child(7) { animation-delay: 0.4s; }
.menu-item-animate:nth-child(8) { animation-delay: 0.45s; }

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

/* ========================================
   FORM ANIMATIONS
======================================== */
.form-input-focus {
    position: relative;
}

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

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

.form-success {
    animation: formSuccess 0.5s ease;
}

@keyframes formSuccess {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ========================================
   MODAL ANIMATIONS
======================================== */
.modal-fade-in {
    animation: modalFadeIn 0.3s ease forwards;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-fade-out {
    animation: modalFadeOut 0.3s ease forwards;
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* ========================================
   TOOLTIP ANIMATIONS
======================================== */
.tooltip-fade {
    animation: tooltipFade 0.2s ease forwards;
}

@keyframes tooltipFade {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   MOBILE ANIMATIONS (Performance Optimized)
======================================== */
@media (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    .gradient-orb {
        display: none;
    }

    .particle {
        display: none;
    }

    [data-aos] {
        transition-duration: 400ms !important;
    }

    .card-3d-tilt:hover {
        transform: none;
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .parallax-bg {
        background-attachment: scroll;
    }
}
