/**
 * Animations
 *
 * Keyframes, scroll-triggered animation classes,
 * hero entrance animations, and reduced-motion.
 *
 * @package IBCES
 */

/* ----------------------------------------
   Keyframes
---------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* ----------------------------------------
   Scroll Animation Base State
---------------------------------------- */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.fade-up {
    transform: translateY(40px);
}

.animate-on-scroll.fade-down {
    transform: translateY(-30px);
}

.animate-on-scroll.fade-left {
    transform: translateX(-50px);
}

.animate-on-scroll.fade-right {
    transform: translateX(50px);
}

.animate-on-scroll.scale-in {
    transform: scale(0.9);
}

/* Animated State */
.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* ----------------------------------------
   Animation Delays for Staggered Effects
---------------------------------------- */
.animate-on-scroll.delay-100 { transition-delay: 0.1s; }
.animate-on-scroll.delay-200 { transition-delay: 0.2s; }
.animate-on-scroll.delay-300 { transition-delay: 0.3s; }
.animate-on-scroll.delay-400 { transition-delay: 0.4s; }
.animate-on-scroll.delay-500 { transition-delay: 0.5s; }
.animate-on-scroll.delay-600 { transition-delay: 0.6s; }

/* ----------------------------------------
   Hero Section Animations
---------------------------------------- */
.hero-content h1 {
    animation: fadeInUp 0.8s ease 0.2s forwards;
    opacity: 0;
}

.hero-content p {
    animation: fadeInUp 0.8s ease 0.4s forwards;
    opacity: 0;
}

.hero-buttons {
    animation: fadeInUp 0.8s ease 0.6s forwards;
    opacity: 0;
}

.hero-slider-dots {
    animation: fadeIn 1s ease 1s forwards;
    opacity: 0;
}

/* ----------------------------------------
   Named Animation Classes
---------------------------------------- */
.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease forwards;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease forwards;
}

/* Animation Delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Alternate delay naming (for custom.css compat) */
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }

/* ----------------------------------------
   Reduced Motion Preference
---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll,
    .hero-content h1,
    .hero-content p,
    .hero-buttons,
    .hero-slider-dots {
        animation: none;
        opacity: 1;
        transform: none;
        transition: none;
    }
}
