/**
 * Homepage Animations & Modern Effects
 * Animated banners, motion transitions, dynamic scrolling, interactive sections
 */

/* ============================================
   SCROLL ANIMATIONS (Intersection Observer)
   ============================================ */

/* Fade in from bottom */
.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Fade in from left */
.fade-in-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-left.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Fade in from right */
.fade-in-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-right.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Scale in */
.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-in.animated {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delay for child elements */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.animated > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.animated > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.animated > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.animated > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.animated > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.animated > *:nth-child(6) { transition-delay: 0.6s; }

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

/* ============================================
   INTERACTIVE SECTIONS
   ============================================ */

/* Hover lift effect for cards */
.interactive-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Parallax effect for background images */
.parallax-bg {
    position: relative;
    overflow: hidden;
}

.parallax-bg::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease-out;
}

.parallax-bg:hover::before {
    transform: scale(1.1);
}

/* Counter animation */
.animated-counter {
    display: inline-block;
}

/* Progress bar animation */
.progress-bar-animated {
    width: 0;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-animated.animated {
    width: var(--progress-width, 100%);
}

/* ============================================
   BANNER ANIMATIONS
   ============================================ */

/* Hero banner text animations */
.hero-content h1,
.hero-content h2 {
    animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-content p {
    animation: fadeInUp 1s ease-out 0.5s both;
}

.hero-content .site-button {
    animation: fadeInUp 1s ease-out 0.7s both;
}

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

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

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

/* ============================================
   SMOOTH SCROLLING
   ============================================ */

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .fade-in-up,
    .fade-in-left,
    .fade-in-right,
    .scale-in,
    .stagger-children > * {
        transition: none;
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    /* Reduce animation intensity on mobile */
    .fade-in-up,
    .fade-in-left,
    .fade-in-right {
        transform: translateY(20px);
    }
    
    .fade-in-left {
        transform: translateX(-20px);
    }
    
    .fade-in-right {
        transform: translateX(20px);
    }
    
    /* Disable parallax on mobile for performance */
    .parallax-bg::before {
        transform: none !important;
    }
    
    /* Optimize hover effects for touch */
    .interactive-card:active {
        transform: translateY(-4px);
    }
}

/* ============================================
   LOADING STATES
   ============================================ */

.section-loading {
    opacity: 0;
    pointer-events: none;
}

.section-loaded {
    opacity: 1;
    pointer-events: all;
    transition: opacity 0.5s ease-in;
}

