/* ============================================
   MDTEC - Animações Premium 2025
   Micro-interações & Efeitos Especiais
   ============================================ */

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

/* Base para elementos animados */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Variações de direção */
.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   HEADER ANIMATIONS
   ============================================ */
.main-header {
    animation: slideDownHeader 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDownHeader {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Logo Glow Effect */
.logo a {
    position: relative;
}

.logo a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: 10px;
}

.logo a:hover::after {
    opacity: 1;
}

/* Emoji Bounce Premium */
.emoji-service {
    animation: emojiFloat 4s ease-in-out infinite;
    display: inline-block;
}

@keyframes emojiFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
    }
    25% {
        transform: translateY(-5px) rotate(3deg);
        filter: drop-shadow(0 5px 15px rgba(0, 212, 255, 0.7));
    }
    50% {
        transform: translateY(-10px) rotate(0deg);
        filter: drop-shadow(0 10px 20px rgba(0, 212, 255, 0.5));
    }
    75% {
        transform: translateY(-5px) rotate(-3deg);
        filter: drop-shadow(0 5px 15px rgba(0, 212, 255, 0.7));
    }
}

/* ============================================
   HERO ANIMATIONS
   ============================================ */
.hero {
    animation: heroReveal 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes heroReveal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Hero Content Stagger */
.hero-content h1 {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.hero-cta {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

/* Stagger animation for CTA buttons */
.hero-cta .cta-button:nth-child(1) {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
}

.hero-cta .cta-button:nth-child(2) {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.6s both;
}

.hero-cta .cta-button:nth-child(3) {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.7s both;
}

.hero-content p {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.8s both;
}

.hero-content .hero-visual {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Service Icon Floating */
.service-icon {
    animation: serviceIconFloat 5s ease-in-out infinite;
}

@keyframes serviceIconFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
        filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.4));
    }
    25% {
        transform: translateY(-12px) rotate(5deg) scale(1.02);
        filter: drop-shadow(0 15px 30px rgba(0, 212, 255, 0.6));
    }
    50% {
        transform: translateY(-20px) rotate(0deg) scale(1.05);
        filter: drop-shadow(0 20px 40px rgba(0, 212, 255, 0.5));
    }
    75% {
        transform: translateY(-12px) rotate(-5deg) scale(1.02);
        filter: drop-shadow(0 15px 30px rgba(0, 212, 255, 0.6));
    }
}

/* Hero Placeholder Glow */
.hero-placeholder {
    animation: placeholderGlow 6s ease-in-out infinite;
}

@keyframes placeholderGlow {
    0%, 100% {
        box-shadow: 
            0 0 40px rgba(0, 212, 255, 0.2),
            inset 0 0 30px rgba(0, 212, 255, 0.05);
    }
    50% {
        box-shadow: 
            0 0 60px rgba(0, 212, 255, 0.3),
            inset 0 0 40px rgba(0, 212, 255, 0.08);
    }
}

/* ============================================
   CTA BUTTON EFFECTS
   ============================================ */
.hero-cta .cta-button {
    position: relative;
    overflow: hidden;
}

/* Shine Effect */
.hero-cta .cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-cta .cta-button:hover::before {
    left: 100%;
}

/* Pulse Ring */
.hero-cta .cta-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 60px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: ctaPulseRing 2s ease-out infinite;
    pointer-events: none;
}

@keyframes ctaPulseRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* CTA Icon Animation */
.cta-icon {
    animation: rocketShake 3s ease-in-out infinite;
}

@keyframes rocketShake {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    10% {
        transform: translateX(3px) rotate(2deg);
    }
    20% {
        transform: translateX(-2px) rotate(-1deg);
    }
    30% {
        transform: translateX(2px) rotate(1deg);
    }
    40% {
        transform: translateX(-1px) rotate(0deg);
    }
    50% {
        transform: translateX(0);
    }
}

/* ============================================
   CONTENT SECTION ANIMATIONS
   ============================================ */
.content-section {
    animation: cardReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation delays */
.content-section:nth-child(1) { animation-delay: 0.1s; }
.content-section:nth-child(2) { animation-delay: 0.15s; }
.content-section:nth-child(3) { animation-delay: 0.2s; }
.content-section:nth-child(4) { animation-delay: 0.25s; }
.content-section:nth-child(5) { animation-delay: 0.3s; }
.content-section:nth-child(6) { animation-delay: 0.35s; }
.content-section:nth-child(7) { animation-delay: 0.4s; }
.content-section:nth-child(8) { animation-delay: 0.45s; }
.content-section:nth-child(9) { animation-delay: 0.5s; }
.content-section:nth-child(10) { animation-delay: 0.55s; }

/* Hover Effect */
.content-section {
    transition: 
        transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-section:hover {
    transform: translateY(-10px);
}

/* Gradient Border Animation on Hover */
.content-section::before {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-section:hover::before {
    background: linear-gradient(180deg, 
        var(--accent-cyan), 
        var(--accent-teal), 
        var(--energy-orange));
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

/* ============================================
   WHATSAPP BUTTON ANIMATIONS
   ============================================ */
.whatsapp-float {
    animation: floatIn 1s cubic-bezier(0.4, 0, 0.2, 1) 1s both;
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.whatsapp-link {
    animation: whatsappPulse 2.5s ease-in-out infinite;
}

@keyframes whatsappPulse {
    0% {
        box-shadow: 
            0 10px 40px rgba(37, 211, 102, 0.4),
            0 0 0 0 rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 
            0 15px 50px rgba(37, 211, 102, 0.5),
            0 0 0 12px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 
            0 10px 40px rgba(37, 211, 102, 0.4),
            0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* WhatsApp Shine */
.whatsapp-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: whatsappShine 4s ease-in-out infinite;
}

@keyframes whatsappShine {
    0%, 70%, 100% {
        left: -100%;
    }
    85% {
        left: 100%;
    }
}

.whatsapp-link:hover {
    animation: none;
}

.whatsapp-link:hover::before {
    animation: none;
    left: 100%;
    transition: left 0.5s ease;
}

/* WhatsApp Icon Bounce */
.whatsapp-icon-float {
    animation: iconWobble 4s ease-in-out infinite;
}

@keyframes iconWobble {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(-10deg) scale(1.1);
    }
    50% {
        transform: rotate(0deg) scale(1);
    }
    75% {
        transform: rotate(10deg) scale(1.1);
    }
}

/* ============================================
   FOOTER ANIMATIONS
   ============================================ */
.footer-section {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 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; }

/* List Items Stagger */
.hours-list li,
.services-list li,
.links-list li {
    animation: slideInFromLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hours-list li:nth-child(1),
.services-list li:nth-child(1),
.links-list li:nth-child(1) { animation-delay: 0.1s; }

.hours-list li:nth-child(2),
.services-list li:nth-child(2),
.links-list li:nth-child(2) { animation-delay: 0.15s; }

.hours-list li:nth-child(3),
.services-list li:nth-child(3),
.links-list li:nth-child(3) { animation-delay: 0.2s; }

.hours-list li:nth-child(4),
.services-list li:nth-child(4),
.links-list li:nth-child(4) { animation-delay: 0.25s; }

.hours-list li:nth-child(5),
.services-list li:nth-child(5),
.links-list li:nth-child(5) { animation-delay: 0.3s; }

.hours-list li:nth-child(6),
.services-list li:nth-child(6) { animation-delay: 0.35s; }

.hours-list li:nth-child(7) { animation-delay: 0.4s; }

/* Link Hover Effect */
.links-list a {
    position: relative;
    display: inline-block;
}

.links-list a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-teal));
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.links-list a:hover::after {
    width: 100%;
}

/* ============================================
   MAPS SECTION ANIMATION
   ============================================ */
.maps-section {
    animation: scaleIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.map-container {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-container:hover {
    transform: scale(1.01);
}

/* ============================================
   SPECIAL EFFECTS
   ============================================ */

/* Gradient Animation Background */
.animated-gradient-bg {
    background: linear-gradient(-45deg, 
        #0a192f, 
        #112240, 
        #1d3557, 
        #00b4d8);
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Typing Effect */
.typing-effect {
    overflow: hidden;
    border-right: 3px solid var(--accent-cyan);
    white-space: nowrap;
    animation: 
        typing 3.5s steps(40, end),
        blinkCaret 0.8s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkCaret {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent-cyan); }
}

/* Shimmer Loading Effect */
.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Water Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.2);
    transform: translate(-50%, -50%);
    animation: rippleEffect 2s ease-out infinite;
}

@keyframes rippleEffect {
    0% {
        width: 0;
        height: 0;
        opacity: 0.5;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
.hero,
.hero-placeholder,
.content-section,
.whatsapp-float,
.main-header {
    will-change: transform;
}

/* Disable animations for better performance on scroll */
@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;
    }
    
    .hero::after {
        animation: none;
    }
    
    .whatsapp-link {
        animation: none;
    }
    
    .emoji-service,
    .service-icon,
    .cta-icon,
    .whatsapp-icon-float {
        animation: none;
    }
}

/* GPU Acceleration */
.content-section:hover,
.whatsapp-link:hover,
.hero-cta .cta-button:hover {
    will-change: transform, box-shadow;
    backface-visibility: hidden;
    perspective: 1000px;
}
