/* ================================
   Page Load Animations
   ================================ */

/* Animation Keyframes */
@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);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Base Animation Classes */
.animate-on-scroll {
    opacity: 1;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll:not(.animated) {
    opacity: 0;
    transform: translateY(30px);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Animation Types */
.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in-down {
    animation: fadeInDown 0.8s ease forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease forwards;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease forwards;
}

.scale-in {
    animation: scaleIn 0.8s ease forwards;
}

.slide-up {
    animation: slideUp 0.8s ease forwards;
}

/* Staggered Animation Delays */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

.delay-600 {
    animation-delay: 0.6s;
}

.delay-700 {
    animation-delay: 0.7s;
}

.delay-800 {
    animation-delay: 0.8s;
}

/* Hero Section Animations */
.hero-content > * {
    opacity: 0;
}

.hero-content .hero-title {
    animation: fadeInDown 1s ease forwards;
    animation-delay: 0.2s;
}

.hero-content .hero-subtitle {
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.4s;
}

.hero-content .hero-buttons {
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.6s;
}

/* Section Animations */
.section-title.animate-on-scroll {
    transform: translateY(30px);
}

.section-title.animate-on-scroll.animated {
    transform: translateY(0);
}

/* Card Grid Animations */
.feature-card.animate-on-scroll,
.service-card.animate-on-scroll,
.product-card.animate-on-scroll,
.testimonial-card.animate-on-scroll {
    transform: translateY(30px);
}

.feature-card.animate-on-scroll.animated,
.service-card.animate-on-scroll.animated,
.product-card.animate-on-scroll.animated,
.testimonial-card.animate-on-scroll.animated {
    transform: translateY(0);
}

/* Stagger children animations */
.stagger-children > *:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-children > *:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-children > *:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-children > *:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger-children > *:nth-child(5) {
    transition-delay: 0.5s;
}

.stagger-children > *:nth-child(6) {
    transition-delay: 0.6s;
}

/* Info Box Animations */
.info-box.animate-on-scroll {
    transform: translateY(30px);
}

.info-box.animate-on-scroll.animated {
    transform: translateY(0);
}

/* CTA Section Animations */
.cta-content.animate-on-scroll {
    transform: scale(0.95);
}

.cta-content.animate-on-scroll.animated {
    transform: scale(1);
}

/* Reduce motion for users who prefer it */
@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 {
        opacity: 1;
        transform: none;
    }
}

/* Loading State */
.page-loading {
    opacity: 0;
}

.page-loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}
