/* ============================================
   Global Animations for All Sections
   ============================================ */

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

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In From Bottom */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Zoom In Animation */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rotate In Animation */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* Bounce In Animation */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

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

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

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

/* Base animation class - hidden by default */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.8s ease-out;
}

/* When element is in view */
.animate-on-scroll.animated {
    opacity: 1;
}

/* Fade In */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Slide In Left */
.animate-slide-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

/* Slide In Right */
.animate-slide-right {
    animation: slideInRight 0.8s ease-out forwards;
}

/* Slide In Up */
.animate-slide-up {
    animation: slideInUp 0.8s ease-out forwards;
}

/* Zoom In */
.animate-zoom-in {
    animation: zoomIn 0.8s ease-out forwards;
}

/* Rotate In */
.animate-rotate-in {
    animation: rotateIn 0.8s ease-out forwards;
}

/* Bounce In */
.animate-bounce-in {
    animation: bounceIn 1s ease-out forwards;
}

/* Stagger Animation Delays */
.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

.animate-delay-5 {
    animation-delay: 0.5s;
}

.animate-delay-6 {
    animation-delay: 0.6s;
}

/* ============================================
   Section Specific Animations
   ============================================ */

/* Hero Section */
.hero-section .animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
}

.hero-section .animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Service Cards - Only animate if explicitly marked */
.service-item.animate-on-scroll,
.case-item.animate-on-scroll,
.lawyer-item.animate-on-scroll,
.blog-item.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.service-item.animate-on-scroll.animated,
.case-item.animate-on-scroll.animated,
.lawyer-item.animate-on-scroll.animated,
.blog-item.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Feature Items - Only animate if explicitly marked */
.feature-item.animate-on-scroll,
.app-features .feature-item.animate-on-scroll {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease-out;
}

.feature-item.animate-on-scroll.animated,
.app-features .feature-item.animate-on-scroll.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Testimonials - Only animate if explicitly marked */
.testimonial-item.animate-on-scroll {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s ease-out;
}

.testimonial-item.animate-on-scroll.animated {
    opacity: 1;
    transform: scale(1);
}

/* Statistics/Counter - Only animate if explicitly marked */
.counter-item.animate-on-scroll,
.stat-item.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.counter-item.animate-on-scroll.animated,
.stat-item.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Buttons */
.btn-animate {
    transition: all 0.3s ease;
}

.btn-animate:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Images - Only animate if explicitly marked */
.img-animate.animate-on-scroll {
    transition: all 0.6s ease-out;
    opacity: 0;
}

.img-animate.animate-on-scroll.animated {
    animation: zoomIn 0.8s ease-out forwards;
    opacity: 1;
}

/* Text Elements - Only animate if explicitly marked */
.text-animate.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.text-animate.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

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

.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: all 0.3s ease;
}

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

.hover-rotate {
    transition: all 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

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

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

.loading-shimmer {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 1000px 100%;
}

/* ============================================
   Responsive Animations
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   RTL Support
   ============================================ */

[dir="rtl"] .animate-slide-left {
    animation: slideInRight 0.8s ease-out forwards;
}

[dir="rtl"] .animate-slide-right {
    animation: slideInLeft 0.8s ease-out forwards;
}

