/* ============================================
   AB ISOLATION - Animations Stylesheet
   ============================================ */

/* ============================================
   Keyframes
   ============================================ */

/* Bounce Animation for Scroll Indicator */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) rotate(45deg);
    }
    40% {
        transform: translateY(-10px) rotate(45deg);
    }
    60% {
        transform: translateY(-5px) rotate(45deg);
    }
}

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* Float */
@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Spin */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* ============================================
   Animation Classes
   ============================================ */

/* Fade Up (Scroll Animation) */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Fade In */
.fade-in {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
}

/* Fade Left */
.fade-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Fade Right */
.fade-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Scale In */
.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ============================================
   Stagger Animation Delays
   ============================================ */
.fade-up:nth-child(1),
.fade-left:nth-child(1),
.fade-right:nth-child(1) {
    transition-delay: 0s;
}

.fade-up:nth-child(2),
.fade-left:nth-child(2),
.fade-right:nth-child(2) {
    transition-delay: 0.1s;
}

.fade-up:nth-child(3),
.fade-left:nth-child(3),
.fade-right:nth-child(3) {
    transition-delay: 0.2s;
}

.fade-up:nth-child(4),
.fade-left:nth-child(4),
.fade-right:nth-child(4) {
    transition-delay: 0.3s;
}

.fade-up:nth-child(5),
.fade-left:nth-child(5),
.fade-right:nth-child(5) {
    transition-delay: 0.4s;
}

.fade-up:nth-child(6),
.fade-left:nth-child(6),
.fade-right:nth-child(6) {
    transition-delay: 0.5s;
}

/* ============================================
   Hover Animations
   ============================================ */

/* Button Hover Lift */
.btn {
    transition: all var(--transition-normal);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Card Hover Lift */
.service-card,
.why-card,
.trust-item {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.service-card:hover,
.why-card:hover,
.trust-item:hover {
    transform: translateY(-5px);
}

/* Image Hover Zoom */
.gallery-item img,
.about-image img,
.aides-image img {
    transition: transform var(--transition-normal);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Link Hover Arrow */
.service-link span {
    display: inline-block;
    transition: transform var(--transition-normal);
}

.service-link:hover span {
    transform: translateX(5px);
}

/* ============================================
   Loading Animations
   ============================================ */

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   WhatsApp Button Animation
   ============================================ */
.whatsapp-float {
    animation: pulse 2s ease-in-out infinite;
}

.whatsapp-float:hover {
    animation: none;
}

/* ============================================
   Counter Animation (JS triggered)
   ============================================ */
.counter-animated {
    animation: fadeInUp 0.6s ease forwards;
}

/* ============================================
   Hero Animations
   ============================================ */
.hero-content .fade-up:nth-child(1) {
    animation-delay: 0.2s;
}

.hero-content .fade-up:nth-child(2) {
    animation-delay: 0.4s;
}

.hero-content .fade-up:nth-child(3) {
    animation-delay: 0.6s;
}

.hero-content .fade-up:nth-child(4) {
    animation-delay: 0.8s;
}

/* ============================================
   Scroll Indicator
   ============================================ */
.scroll-arrow {
    animation: bounce 2s infinite;
}

/* ============================================
   Testimonial Slide Animation
   ============================================ */
.testimonials-track {
    transition: transform 0.5s ease;
}

.testimonial-item {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ============================================
   Gallery Slide Animation
   ============================================ */
.gallery-track {
    transition: transform 0.5s ease;
}

/* ============================================
   Mobile Menu Animation
   ============================================ */
.nav {
    transition: right 0.3s ease;
}

.hamburger span {
    transition: all 0.3s ease;
}

/* ============================================
   Header Scroll Animation
   ============================================ */
.header {
    transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

/* ============================================
   Process Timeline Animation
   ============================================ */
.process-step .step-number {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.process-step:hover .step-number {
    transform: scale(1.1);
    background-color: var(--primary-light);
}

/* ============================================
   Form Input Focus Animation
   ============================================ */
input, textarea, select {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

/* ============================================
   Dropdown Menu Animation
   ============================================ */
.dropdown-menu {
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

/* ============================================
   Footer Social Icons Animation
   ============================================ */
.footer-social a {
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.footer-social a:hover {
    transform: translateY(-3px);
}

/* ============================================
   Image Lazy Load Animation
   ============================================ */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ============================================
   Reduce Motion Preference
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .fade-up,
    .fade-in,
    .fade-left,
    .fade-right,
    .scale-in {
        opacity: 1;
        transform: none;
    }
    
    .whatsapp-float {
        animation: none;
    }
}
