/* Animações CSS Avançadas e Micro-animações */

/* 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.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Animações Contínuas */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

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

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8), 0 0 30px rgba(102, 126, 234, 0.6);
    }
}

/* Animações de Hover */
@keyframes buttonHover {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes cardLift {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-5px);
    }
}

/* Gradiente Animado */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Aplicação das Animações */

/* Header */
.logo-emoji {
    animation: pulse 2s infinite;
}

/* Hero Section */
.hero-emoji {
    animation: float 3s ease-in-out infinite;
}

.cta-button {
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

/* WhatsApp Button */
.whatsapp-icon {
    animation: bounce 2s infinite;
}

.whatsapp-float a {
    position: relative;
    overflow: hidden;
}

.whatsapp-float a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.whatsapp-float a:hover::before {
    left: 100%;
}

/* SEO Sections */
.seo-section {
    transition: all 0.3s ease;
}

.seo-section:hover {
    animation: cardLift 0.3s ease forwards;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.seo-section:nth-child(odd) {
    animation: fadeInLeft 0.8s ease forwards;
    opacity: 0;
    animation-delay: 0.2s;
}

.seo-section:nth-child(even) {
    animation: fadeInRight 0.8s ease forwards;
    opacity: 0;
    animation-delay: 0.4s;
}

/* CTA Buttons */
.cta-button-secondary {
    position: relative;
    overflow: hidden;
}

.cta-button-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.cta-button-secondary:hover::before {
    width: 300px;
    height: 300px;
}

/* Map Section */
.map-container {
    animation: scaleIn 0.8s ease forwards;
    opacity: 0;
    animation-delay: 0.6s;
}

/* Footer */
.footer-section {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.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; }

/* Gradientes Animados */
header {
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

.seo-section::before {
    background-size: 400% 400%;
    animation: gradientShift 6s ease infinite;
}

/* Micro-interações */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Loading Animation */
.loading {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

/* Scroll-triggered animations */
@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    animation: reveal 0.6s ease forwards;
}

/* Hover Effects */
.services-list li:hover {
    color: #667eea;
    transform: translateX(5px);
    transition: all 0.3s ease;
}

.links-list a:hover {
    color: #f093fb !important;
    transform: translateX(5px);
    transition: all 0.3s ease;
}

/* Button Press Effect */
.cta-button:active,
.cta-button-secondary:active,
.whatsapp-float a:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Focus States for Accessibility */
.cta-button:focus,
.cta-button-secondary:focus,
.whatsapp-float a:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Intersection Observer Animation Triggers */
.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);
}

/* Stagger Animation for Lists */
.stagger-animation li {
    opacity: 0;
    transform: translateX(-20px);
    animation: fadeInLeft 0.5s ease forwards;
}

.stagger-animation li:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation li:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation li:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation li:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation li:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation li:nth-child(6) { animation-delay: 0.6s; }
.stagger-animation li:nth-child(7) { animation-delay: 0.7s; }
.stagger-animation li:nth-child(8) { animation-delay: 0.8s; }

/* Animações da Oficina Elétrica */
@keyframes electrician-move {
    0%, 100% {
        transform: translateX(-50%) translateY(0) rotate(0deg);
    }
    25% {
        transform: translateX(-50%) translateY(-5px) rotate(2deg);
    }
    50% {
        transform: translateX(-50%) translateY(0) rotate(0deg);
    }
    75% {
        transform: translateX(-50%) translateY(-3px) rotate(-1deg);
    }
}

@keyframes tool-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-3px) rotate(5deg);
    }
    50% {
        transform: translateY(-6px) rotate(0deg);
    }
    75% {
        transform: translateY(-3px) rotate(-5deg);
    }
}

@keyframes wire-pulse {
    0%, 100% {
        opacity: 0.7;
        transform: scaleY(1);
        box-shadow: 0 0 5px #fbbf24;
    }
    50% {
        opacity: 1;
        transform: scaleY(1.2);
        box-shadow: 0 0 15px #fbbf24, 0 0 25px #fbbf24;
    }
}

@keyframes spark-flash {
    0%, 100% {
        opacity: 0;
        transform: scale(0.8);
    }
    10%, 90% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

@keyframes outlet-glow {
    0%, 100% {
        color: #e5e7eb;
        text-shadow: none;
    }
    50% {
        color: #fbbf24;
        text-shadow: 0 0 15px #fbbf24;
    }
}

@keyframes switch-toggle {
    0%, 50% {
        transform: rotate(0deg);
        color: #d1d5db;
    }
    51%, 100% {
        transform: rotate(180deg);
        color: #fbbf24;
        text-shadow: 0 0 10px #fbbf24;
    }
}

@keyframes bulb-glow {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
        text-shadow: 0 0 25px #fbbf24, 0 0 50px #fbbf24, 0 0 75px #fbbf24;
    }
}

@keyframes circuit-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spark-fly {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateY(-10px) translateX(5px) scale(1);
    }
    40% {
        opacity: 0.8;
        transform: translateY(-20px) translateX(10px) scale(0.8);
    }
    60% {
        opacity: 0.6;
        transform: translateY(-15px) translateX(15px) scale(0.6);
    }
    80% {
        opacity: 0.3;
        transform: translateY(-5px) translateX(20px) scale(0.3);
    }
}

@keyframes arc-zap {
    0%, 100% {
        opacity: 0;
        transform: scale(0.8) rotate(0deg);
    }
    10%, 90% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    20%, 80% {
        opacity: 1;
        transform: scale(1.2) rotate(90deg);
    }
    30%, 70% {
        opacity: 1;
        transform: scale(0.9) rotate(180deg);
    }
    40%, 60% {
        opacity: 1;
        transform: scale(1.1) rotate(270deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.3) rotate(360deg);
    }
}

@keyframes workbench-item {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-2px) rotate(1deg);
    }
    50% {
        transform: translateY(-4px) rotate(0deg);
    }
    75% {
        transform: translateY(-2px) rotate(-1deg);
    }
}

@keyframes light-flicker {
    0%, 100% {
        opacity: 0.8;
        text-shadow: 0 0 30px #fbbf24, 0 0 60px #fbbf24;
    }
    2%, 8%, 15%, 22%, 30%, 38%, 45%, 52%, 60%, 68%, 75%, 82%, 90% {
        opacity: 1;
        text-shadow: 0 0 40px #fbbf24, 0 0 80px #fbbf24, 0 0 120px #fbbf24;
    }
    4%, 10%, 17%, 25%, 32%, 40%, 47%, 55%, 62%, 70%, 77%, 85%, 92% {
        opacity: 0.9;
        text-shadow: 0 0 35px #fbbf24, 0 0 70px #fbbf24;
    }
}

@keyframes power-blink {
    0%, 50% {
        content: "🔴";
        color: #ef4444;
        text-shadow: 0 0 10px #ef4444;
    }
    51%, 100% {
        content: "🟢";
        color: #22c55e;
        text-shadow: 0 0 10px #22c55e;
    }
}
