/* Micro Animações e Efeitos Especiais */

/* Animações de Entrada */
@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);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animações aplicadas aos elementos */
.hero h1 {
    animation: fadeInUp 1s ease-out;
}

.hero p {
    animation: fadeInUp 1s ease-out 0.2s both;
}

.cta-button {
    animation: scaleIn 0.8s ease-out 0.4s both;
}

.seo-content h2 {
    animation: fadeInLeft 0.8s ease-out both;
}

.seo-content p {
    animation: fadeInRight 0.8s ease-out 0.2s both;
}

.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; }
.footer-section:nth-child(5) { animation-delay: 0.5s; }
.footer-section:nth-child(6) { animation-delay: 0.6s; }

/* Animações Hover */
.cta-button:hover {
    animation: none;
}

nav a:hover {
    animation: scaleIn 0.3s ease-out;
}

.links-grid a:hover {
    animation: scaleIn 0.3s ease-out;
}

/* Animações de Emojis */
@keyframes emojiBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes emojiSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* Aplicar animações aos emojis */
.logo {
    animation: emojiBounce 2s ease-in-out infinite;
}

.cta-button {
    animation: emojiPulse 2s ease-in-out infinite;
}

.emergency-float a {
    animation: emojiBounce 3s ease-in-out infinite;
}

.whatsapp-float a {
    animation: emojiBounce 3s ease-in-out infinite;
}

/* Efeitos de gradiente animado */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hero {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

header {
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}

.cta-button {
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

.emergency-float a {
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

.whatsapp-float a {
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

/* Animações de carregamento */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Efeitos de foco */
.cta-button:focus,
.emergency-float a:focus,
.whatsapp-float a:focus,
nav a:focus {
    outline: 2px solid #ffc107;
    outline-offset: 2px;
}

/* Animações de transição de página */
body {
    animation: fadeInUp 0.5s ease-out;
}

/* Efeitos de hover avançados */
.links-grid a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 193, 7, 0.2), transparent);
    transition: left 0.5s;
}

.links-grid a:hover::before {
    left: 100%;
}

/* Animação de digitação */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #dc3545; }
}

.typing-effect {
    overflow: hidden;
    border-right: 2px solid #dc3545;
    white-space: nowrap;
    animation: typing 2s steps(40, end), blink-caret 0.75s step-end infinite;
}

/* Animações de entrada sequencial */
.seo-content > div > * {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out both;
}

.seo-content > div > *:nth-child(1) { animation-delay: 0.1s; }
.seo-content > div > *:nth-child(2) { animation-delay: 0.2s; }
.seo-content > div > *:nth-child(3) { animation-delay: 0.3s; }
.seo-content > div > *:nth-child(4) { animation-delay: 0.4s; }
.seo-content > div > *:nth-child(5) { animation-delay: 0.5s; }

/* Efeitos de parallax suave */
@keyframes parallax {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

.hero::before {
    animation: parallax 10s ease-in-out infinite alternate;
}

/* Animações de entrada para footer */
.footer-content {
    animation: fadeInUp 1s ease-out;
}

/* Efeitos de hover para botões */
.cta-button:active {
    transform: translateY(-1px);
    transition: all 0.1s ease;
}

.emergency-float a:active {
    transform: translateY(-1px);
    transition: all 0.1s ease;
}

.whatsapp-float a:active {
    transform: translateY(-1px);
    transition: all 0.1s ease;
}

/* Animação de respiração */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.hero h1 {
    animation: breathe 4s ease-in-out infinite, fadeInUp 1s ease-out;
}

/* Animações de entrada para mapa do site */
.mapa-site .categoria {
    animation: fadeInUp 0.8s ease-out both;
}

.mapa-site .categoria:nth-child(1) { animation-delay: 0.1s; }
.mapa-site .categoria:nth-child(2) { animation-delay: 0.2s; }
.mapa-site .categoria:nth-child(3) { animation-delay: 0.3s; }
.mapa-site .categoria:nth-child(4) { animation-delay: 0.4s; }
.mapa-site .categoria:nth-child(5) { animation-delay: 0.5s; }
.mapa-site .categoria:nth-child(6) { animation-delay: 0.6s; }
.mapa-site .categoria:nth-child(7) { animation-delay: 0.7s; }

/* Performance optimizations */
* {
    will-change: auto;
}

.cta-button,
.emergency-float a,
.whatsapp-float a,
.links-grid a {
    will-change: transform;
}

/* Reduzir movimento para usuários que preferem */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
