/* Microanimações Sutis */

/* Animações de Entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animações de Hover Sutis */
@keyframes gentleHover {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-2px);
    }
}

@keyframes gentleScale {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.02);
    }
}

@keyframes gentleRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(5deg);
    }
}

/* Pulsing Effects */
@keyframes subtlePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(37, 211, 102, 0);
    }
}

@keyframes breathing {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.01);
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Typing Effect */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Scroll Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Aplicação das Animações */

/* Header Animations */
.header {
    animation: slideInFromLeft 0.6s ease-out;
}

.logo h1 {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.logo span {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.nav ul {
    animation: fadeInRight 0.8s ease-out 0.6s both;
}

/* Hero Animations */
.hero h1 {
    animation: fadeInUp 1s ease-out;
}

.hero p {
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-ctas {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-features {
    animation: fadeInUp 1s ease-out 0.6s both;
}

/* Service Animations */
.services h2 {
    animation: fadeInUp 0.8s ease-out;
}

.service-content {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.cta-service {
    animation: scaleIn 0.6s ease-out 0.4s both;
}

/* WhatsApp Float Animation */
.whatsapp-float a {
    animation: subtlePulse 3s infinite;
}

/* Feature Icons Animation */
.feature i {
    transition: transform 0.3s ease;
}

.feature:hover i {
    animation: gentleRotate 0.6s ease-in-out;
}

/* Button Hover Effects */
.cta-primary:hover {
    animation: gentleHover 0.3s ease;
}

.cta-secondary:hover {
    animation: gentleHover 0.3s ease;
}

.cta-tertiary:hover {
    animation: gentleScale 0.3s ease;
}

.cta-service:hover {
    animation: gentleHover 0.3s ease;
}

/* Social Links Animation */
.social-links a:hover {
    animation: gentleScale 0.3s ease;
}

/* Service List Items */
.service-text li {
    animation: fadeInUp 0.6s ease-out both;
}

.service-text li:nth-child(1) { animation-delay: 0.1s; }
.service-text li:nth-child(2) { animation-delay: 0.2s; }
.service-text li:nth-child(3) { animation-delay: 0.3s; }
.service-text li:nth-child(4) { animation-delay: 0.4s; }
.service-text li:nth-child(5) { animation-delay: 0.5s; }
.service-text li:nth-child(6) { animation-delay: 0.6s; }
.service-text li:nth-child(7) { animation-delay: 0.7s; }
.service-text li:nth-child(8) { animation-delay: 0.8s; }

/* Footer Animations */
.footer-section {
    animation: fadeInUp 0.8s ease-out both;
}

.footer-section:nth-child(1) { animation-delay: 0.1s; }
.footer-section:nth-child(2) { animation-delay: 0.2s; }
.footer-section:nth-child(3) { animation-delay: 0.3s; }
.footer-section:nth-child(4) { animation-delay: 0.4s; }

/* Loading States */
.loading {
    animation: fadeIn 0.3s ease-out;
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    background-size: 200px 100%;
    animation: shimmer 2s infinite;
}

/* Intersection Observer Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Animations */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.animate > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.animate > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.animate > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.animate > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.animate > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.animate > *:nth-child(6) { transition-delay: 0.6s; }

/* Micro-interações */
.interactive-element {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.interactive-element:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Focus Animations */
.focus-ring {
    transition: box-shadow 0.2s ease;
}

.focus-ring:focus {
    animation: focusPulse 0.6s ease;
}

@keyframes focusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(30, 64, 175, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(30, 64, 175, 0);
    }
}

/* Success/Error States */
.success-animation {
    animation: scaleIn 0.4s ease, fadeIn 0.4s ease;
}

.error-animation {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Breathing Animation for Important Elements */
.breathe {
    animation: breathing 3s ease-in-out infinite;
}

/* Subtle Background Animation */
.animated-bg {
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Text Highlight Animation */
.text-highlight {
    background: linear-gradient(120deg, transparent 0%, transparent 50%, rgba(255, 255, 255, 0.3) 50%);
    background-size: 200% 100%;
    background-position: 100% 0;
    animation: textShimmer 3s ease-in-out infinite;
}

@keyframes textShimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* Sitemap Link Animations */
.sitemap-category {
    animation: fadeInUp 0.8s ease-out both;
}

.sitemap-category:nth-child(1) { animation-delay: 0.1s; }
.sitemap-category:nth-child(2) { animation-delay: 0.2s; }
.sitemap-category:nth-child(3) { animation-delay: 0.3s; }
.sitemap-category:nth-child(4) { animation-delay: 0.4s; }
.sitemap-category:nth-child(5) { animation-delay: 0.5s; }
.sitemap-category:nth-child(6) { animation-delay: 0.6s; }

.sitemap-links a {
    animation: fadeInScale 0.6s ease-out both;
    animation-delay: calc(var(--item-index, 0) * 0.05s);
}

.stat {
    animation: fadeInUp 0.8s ease-out both;
}

.stat:nth-child(1) { animation-delay: 0.1s; }
.stat:nth-child(2) { animation-delay: 0.2s; }
.stat:nth-child(3) { animation-delay: 0.3s; }
.stat:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Performance Optimizations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .whatsapp-float a {
        animation: none !important;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .hero h1,
    .hero p,
    .hero-ctas,
    .hero-features {
        animation-duration: 0.6s;
        animation-delay: 0.1s;
    }

    .services h2 {
        animation-duration: 0.5s;
    }

    .service-content {
        animation-duration: 0.5s;
        animation-delay: 0.1s;
    }
}
