/* Animações CSS */

/* Micro-animações para emojis no header */
.logo-text span:first-child {
    animation: emojiPulse 2s ease-in-out infinite;
}

@keyframes emojiPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.logo-text span:last-child {
    animation: emojiShake 3s ease-in-out infinite;
}

@keyframes emojiShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Animações para botões */
.btn-ligar::after {
    content: '📞';
    animation: phoneRing 2s ease-in-out infinite;
    margin-left: 0.5rem;
}

@keyframes phoneRing {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.btn-whatsapp::after {
    content: '💬';
    animation: whatsappBounce 1.5s ease-in-out infinite;
    margin-left: 0.5rem;
}

@keyframes whatsappBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-1px); }
}

/* Animação do hero emoji */
.hero-emoji {
    animation: multiFloat 6s ease-in-out infinite;
}

@keyframes multiFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(1deg);
    }
    50% {
        transform: translateY(-25px) rotate(-1deg);
    }
    75% {
        transform: translateY(-15px) rotate(1deg);
    }
}

/* Animações do botão WhatsApp flutuante */
.whatsapp-float a {
    animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 6px 20px rgba(37,211,102,0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 8px 25px rgba(37,211,102,0.5);
    }
}

.whatsapp-float .whatsapp-icon {
    animation: iconFloat 2s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-2px); }
}

/* Animações de entrada para elementos */
@keyframes fadeInUp {
    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);
    }
}

/* Aplicar animações de entrada */
.hero-content {
    animation: fadeInLeft 1s ease-out;
}

.hero-visual {
    animation: fadeInRight 1s ease-out 0.2s both;
}

.footer-section:nth-child(1) {
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.footer-section:nth-child(2) {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.footer-section:nth-child(3) {
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.footer-section:nth-child(4) {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Animações para sitemap */
.sitemap-section {
    animation: fadeInUp 0.8s ease-out both;
}

.sitemap-section:nth-child(1) { animation-delay: 0.1s; }
.sitemap-section:nth-child(2) { animation-delay: 0.2s; }

/* Hover animations */
.sitemap-links a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sitemap-links a:hover {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(5px);
    }
}

/* SEO Content Animations */
.seo-content h1 {
    animation: fadeInUp 0.8s ease-out;
}

.seo-intro {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.service-section {
    animation: fadeInUp 0.6s ease-out both;
}

.service-section:nth-child(1) { animation-delay: 0.3s; }
.service-section:nth-child(2) { animation-delay: 0.5s; }
.service-section:nth-child(3) { animation-delay: 0.7s; }

.service-section h2 {
    position: relative;
    overflow: hidden;
}

.service-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: #1C838F;
    animation: slideInBorder 0.8s ease-out 1s both;
}

@keyframes slideInBorder {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.service-section h3 {
    transition: color 0.3s ease;
}

.service-section h3:hover {
    color: #1C838F;
}

.btn-seo-whatsapp {
    animation: gentlePulse 4s ease-in-out infinite;
}

/* Loading animation para elementos dinâmicos */
@keyframes loading {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.loading {
    animation: loading 1.5s ease-in-out infinite;
}

/* Animação para scroll suave */
html {
    scroll-behavior: smooth;
}

/* Animações para mobile - reduzir movimento */
@media (max-width: 768px) {
    .logo-text span:first-child {
        animation-duration: 3s;
    }

    .logo-text span:last-child {
        animation-duration: 4s;
    }

    .hero-emoji {
        animation-duration: 8s;
    }

    .whatsapp-float a {
        animation-duration: 4s;
    }

    .btn-ligar::after,
    .btn-whatsapp::after {
        animation-duration: 3s;
    }
}

/* Animações reduzidas para preferência de movimento reduzido */
@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;
    }
}

/* Animações especiais para foco */
.btn:focus,
.sitemap-links a:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
    animation: focusPulse 1s ease-out;
}

@keyframes focusPulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}

/* Animação de gradiente animado */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#main-header,
.hero,
.btn-ligar,
.btn-whatsapp,
.btn-hero-whatsapp,
.whatsapp-float a {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

/* Efeito de brilho */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.btn::before,
.whatsapp-float a::before {
    animation: shimmer 3s infinite;
}