/**
 * Global Smooth Animations - All Pages
 * Comprehensive animation classes for scroll-based animations
 */

/* ============================================
   BASE ANIMATION CLASSES
   ============================================ */

/* Initial state - before animation */
.fade-slide-up,
.fade-scale-up,
.fade-in-text,
.fade-scale-in,
.fade-bounce-in,
.fade-slide-right {
    opacity: 0;
    will-change: transform, opacity;
}

.fade-slide-up {
    transform: translateY(50px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-scale-up {
    transform: scale(0.9);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-text {
    transform: translateY(20px);
    transition: opacity 0.6s ease-out,
                transform 0.6s ease-out;
}

.fade-scale-in {
    transform: scale(0.95);
    transition: opacity 0.8s ease-out,
                transform 0.8s ease-out;
}

.fade-bounce-in {
    transform: scale(0.8);
    transition: opacity 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.fade-slide-right {
    transform: translateX(-30px);
    transition: opacity 0.7s ease-out,
                transform 0.7s ease-out;
}

/* ============================================
   ANIMATED STATE - When visible
   ============================================ */

.fade-slide-up.animate-in,
.fade-scale-up.animate-in,
.fade-in-text.animate-in,
.fade-scale-in.animate-in,
.fade-bounce-in.animate-in,
.fade-slide-right.animate-in {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* ============================================
   SMOOTH TRANSITIONS FOR ALL ELEMENTS
   ============================================ */

/* All interactive elements */
a, button, input, textarea, select, .legal-service-card, 
.legal-testimonial-card, .legal-why-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Links underline animation */
a:not(.legal-cta-button):not(.legal-navbar-link) {
    position: relative;
}

a:not(.legal-cta-button):not(.legal-navbar-link)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--gold-primary);
    transition: width 0.3s ease-out;
}

a:not(.legal-cta-button):not(.legal-navbar-link):hover::after {
    width: 100%;
}

/* ============================================
   HOVER EFFECTS - Smooth Transitions
   ============================================ */

/* Card hover effects */
.legal-service-card,
.legal-testimonial-card,
.legal-why-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.legal-service-card:hover,
.legal-testimonial-card:hover {
    transform: translateY(-10px) scale(1.02);
}

.legal-why-item:hover {
    transform: translateY(-8px);
}

/* Button hover effects */
button:hover,
.legal-cta-button:hover {
    transform: translateY(-2px);
}

button:active,
.legal-cta-button:active {
    transform: translateY(0);
}

/* Image hover effects */
img {
    transition: transform 0.4s ease, filter 0.4s ease;
}

img:hover {
    transform: scale(1.03);
    filter: brightness(1.05);
}

/* Icon hover effects */
svg {
    transition: transform 0.3s ease, color 0.3s ease;
}

.legal-service-icon:hover svg,
.legal-why-icon:hover svg {
    transform: rotate(10deg) scale(1.1);
}

/* ============================================
   FORM ANIMATIONS
   ============================================ */

input, textarea, select {
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(197, 154, 68, 0.2);
}

/* ============================================
   LOADING/PAGE TRANSITION
   ============================================ */

body {
    animation: pageLoad 0.6s ease-out;
}

@keyframes pageLoad {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   ACCESSIBILITY - Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .fade-slide-up,
    .fade-scale-up,
    .fade-in-text,
    .fade-scale-in,
    .fade-bounce-in,
    .fade-slide-right {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* ============================================
   SECTION STAGGER ANIMATIONS
   ============================================ */

section:nth-child(odd) .legal-service-card {
    animation: fadeInStagger 0.6s ease-out backwards;
}

section:nth-child(even) .legal-service-card {
    animation: fadeInStagger 0.6s ease-out backwards;
}

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

/* ============================================
   FIX FOOTER BOTTOM VISIBILITY
   ============================================ */

.legal-footer-bottom {
    margin-top: 2rem !important;
    padding-top: 2rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    text-align: center !important;
}

.legal-footer-copyright {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.95rem !important;
    margin: 0 !important;
    line-height: 1.8 !important;
}

.legal-footer-copyright a:hover {
    color: var(--gold-light) !important;
    text-decoration: underline !important;
}

/* Ensure footer is visible */
.legal-footer {
    display: block !important;
    opacity: 1 !important;
}
