/**
 * Animations for Proem Abogados y Asesores
 * Professional, subtle animations using CSS transforms
 */

/* Keyframe Animations */
@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 pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Animation Classes */
.animate-fadeIn {
    animation: fadeIn 0.6s ease both;
}

.animate-fadeInUp {
    animation: fadeInUp 0.8s ease both;
}

.animate-fadeInDown {
    animation: fadeInDown 0.8s ease both;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.8s ease both;
}

.animate-fadeInRight {
    animation: fadeInRight 0.8s ease both;
}

.animate-scaleIn {
    animation: scaleIn 0.6s ease both;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Delay Classes */
.animation-delay-100 {
    animation-delay: 0.1s;
}

.animation-delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-300 {
    animation-delay: 0.3s;
}

.animation-delay-400 {
    animation-delay: 0.4s;
}

.animation-delay-500 {
    animation-delay: 0.5s;
}

/* Hero Animations */
.hero-section .hero-title {
    animation: fadeInUp 0.8s ease both;
}

.hero-section .hero-subtitle {
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-section .hero-description {
    animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-section .hero-buttons {
    animation: fadeInUp 0.8s ease 0.6s both;
}

/* Service Card Hover Effects */
.service-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.service-card:hover {
    animation: none;
}

.service-card:hover .service-icon {
    animation: pulse 1s ease infinite;
}

/* Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Loading Animation */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #541D36; /* var(--color-primary) */
    border-top-color: transparent;
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

/* Shimmer Effect for Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Scroll Reveal Animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Navigation Link Hover */
.main-navigation a {
    position: relative;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #541D36; /* var(--color-primary) */
    transition: width 0.3s ease;
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item a::after {
    width: 100%;
}

/* Social Icons Hover */
.social-links a {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
    background-color: #541D36; /* var(--color-primary) */
}

/* Form Elements */
.form-group input,
.form-group textarea,
.form-group select {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    animation: scaleIn 0.3s ease;
}

/* CTA Section Animation */
.cta-section {
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 70%
    );
    animation: float 15s ease-in-out infinite;
}

/* Experience Badge Animation */
.experience-badge {
    animation: scaleIn 0.8s ease 0.5s both, float 4s ease-in-out 1.5s infinite;
}

/* Performance Optimizations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* GPU Acceleration for smooth animations */
.animate-fadeInUp,
.animate-fadeInDown,
.animate-fadeInLeft,
.animate-fadeInRight,
.service-card,
.btn {
    transform: translateZ(0);
    backface-visibility: hidden;
}