/* ============================================
   ANIMATIONS CSS
   Scroll-triggered animations and effects
   ============================================ */

/* DEFAULT: All elements visible */
.animate-on-scroll {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* HIDDEN STATE: Only applied by JS to elements below viewport */
.animate-on-scroll.scroll-hidden {
    opacity: 0;
    transform: translateY(60px);
}

/* REVEALED STATE: Animated back to visible */
.animate-on-scroll.scroll-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Delays for grid items */
.animate-on-scroll[style*="--delay: 0.1s"] { transition-delay: 0.05s; }
.animate-on-scroll[style*="--delay: 0.2s"] { transition-delay: 0.1s; }
.animate-on-scroll[style*="--delay: 0.3s"] { transition-delay: 0.15s; }
.animate-on-scroll[style*="--delay: 0.4s"] { transition-delay: 0.2s; }
.animate-on-scroll[style*="--delay: 0.5s"] { transition-delay: 0.25s; }
.animate-on-scroll[style*="--delay: 0.6s"] { transition-delay: 0.3s; }
.animate-on-scroll[style*="--delay: 0.7s"] { transition-delay: 0.35s; }
.animate-on-scroll[style*="--delay: 0.8s"] { transition-delay: 0.4s; }
.animate-on-scroll[style*="--delay: 0.9s"] { transition-delay: 0.45s; }
.animate-on-scroll[style*="--delay: 1.0s"] { transition-delay: 0.5s; }

/* Parallax Scroll Effect */
.parallax {
    transition: transform 0.1s linear;
}

/* Counter Animation */
.stat-number {
    display: inline-block;
}

/* Glow Pulse */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(56, 178, 172, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(56, 178, 172, 0.6), 0 0 60px rgba(56, 178, 172, 0.3);
    }
}

.glow-pulse {
    animation: glowPulse 3s ease-in-out infinite;
}

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

.shimmer {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(2deg); }
    75% { transform: translateY(10px) rotate(-2deg); }
}

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

/* Slide In Animations */
@keyframes slideInLeft {
    0% { opacity: 0; transform: translateX(-50px); }
    100% { opacity: 1; transform: translateX(0); }
}

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

@keyframes slideInUp {
    0% { opacity: 0; transform: translateY(50px); }
    100% { opacity: 1; transform: translateY(0); }
}

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

.slide-in-left { animation: slideInLeft 0.6s ease forwards; }
.slide-in-right { animation: slideInRight 0.6s ease forwards; }
.slide-in-up { animation: slideInUp 0.6s ease forwards; }
.slide-in-down { animation: slideInDown 0.6s ease forwards; }

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

.animated-gradient-text {
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-teal), var(--primary-light), var(--accent-cyan));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradient 5s ease infinite;
}

/* Hover Card 3D */
.card-3d {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
    transform-style: preserve-3d;
}

.card-3d:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) translateZ(20px);
    box-shadow: 20px 20px 60px rgba(0, 0, 0, 0.3), -5px -5px 20px rgba(56, 178, 172, 0.1);
}

/* Morph Animation */
@keyframes morph {
    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%; }
}

.morph {
    animation: morph 8s ease-in-out infinite;
}

/* ============================================
   HERO ENTRANCE ANIMATIONS (CSS only - immediate)
   ============================================ */
.hero-section .hero-title {
    animation: slideInUp 0.8s ease 0.1s both;
}

.hero-section .hero-subtitle {
    animation: slideInUp 0.8s ease 0.2s both;
}

.hero-section .hero-description {
    animation: slideInUp 0.8s ease 0.3s both;
}

.hero-section .hero-cta {
    animation: slideInUp 0.8s ease 0.4s both;
}

.hero-section .hero-stats {
    animation: slideInUp 0.8s ease 0.5s both;
}

.hero-section .hero-visual {
    animation: slideInRight 1s ease 0.2s both;
}

@keyframes floatCardEntrance {
    0% { opacity: 0; transform: translateY(30px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-section .floating-card {
    animation: floatCardEntrance 0.8s ease both;
}

.hero-section .floating-card:nth-child(1) { animation-delay: 0.5s; }
.hero-section .floating-card:nth-child(2) { animation-delay: 0.6s; }
.hero-section .floating-card:nth-child(3) { animation-delay: 0.7s; }
.hero-section .floating-card:nth-child(4) { animation-delay: 0.8s; }

/* Navigation Scroll Effect */
.main-nav.scrolled {
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* All sections always visible */
section {
    opacity: 1;
    visibility: visible;
}

/* Interactive Hover States */
.feature-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(56, 178, 172, 0.2);
}

/* Button Hover Animation */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::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;
}

.btn:hover::before {
    left: 100%;
}

/* Focus States */
.btn:focus,
input:focus,
textarea:focus,
a:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 178, 172, 0.3);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-on-scroll.scroll-hidden {
        opacity: 1;
        transform: none;
    }
}
