/* ========================================
   ANIMATIONS - JULIO MASSOQUIRO
   Premium Motion Design
   ======================================== */

/* ========================================
   VARIÁVEIS DE ANIMAÇÃO
   ======================================== */
:root {
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out-sine: cubic-bezier(0.37, 0, 0.63, 1);
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   ANIMAÇÕES DE ENTRADA
   ======================================== */

/* Fade In Simples */
.fade-in {
    animation: fadeIn 0.8s var(--ease-out-expo) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade In Up - Elegante */
.fade-in-up {
    animation: fadeInUp 0.8s var(--ease-out-expo) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
.fade-in-down {
    animation: fadeInDown 0.8s var(--ease-out-expo) forwards;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
.fade-in-left {
    animation: fadeInLeft 0.8s var(--ease-out-expo) forwards;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
.fade-in-right {
    animation: fadeInRight 0.8s var(--ease-out-expo) forwards;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
.scale-in {
    animation: scaleIn 0.6s var(--ease-out-expo) forwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Up - Entrada Suave */
.slide-up {
    animation: slideUp 1s var(--ease-out-expo) forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reveal - Efeito de Revelação */
.reveal {
    animation: reveal 1.2s var(--ease-out-expo) forwards;
}

@keyframes reveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

/* ========================================
   ANIMAÇÕES DE HOVER
   ======================================== */

/* Hover Lift */
.hover-lift {
    transition: all 0.4s var(--ease-smooth);
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(13, 79, 79, 0.15);
}

/* Hover Scale */
.hover-scale {
    transition: transform 0.3s var(--ease-smooth);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Hover Glow */
.hover-glow {
    transition: all 0.4s var(--ease-smooth);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(201, 169, 89, 0.4);
}

/* Hover Shine */
.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    transform: rotate(30deg);
    transition: left 0.7s ease;
    pointer-events: none;
}

.hover-shine:hover::after {
    left: 100%;
}

/* ========================================
   ANIMAÇÕES CONTÍNUAS
   ======================================== */

/* Float - Flutuação Suave */
.float {
    animation: float 4s var(--ease-in-out-sine) infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

/* Pulse - Pulsação */
.pulse {
    animation: pulse 2.5s var(--ease-in-out-sine) infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.03);
        opacity: 0.9;
    }
}

/* Pulse Soft - Pulsação Suave */
.pulse-soft {
    animation: pulseSoft 3s var(--ease-in-out-sine) infinite;
}

@keyframes pulseSoft {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(13, 79, 79, 0.1);
    }
    50% {
        box-shadow: 0 4px 30px rgba(13, 79, 79, 0.2);
    }
}

/* Glow - Brilho Alternado */
.glow {
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(201, 169, 89, 0.2);
    }
    to {
        box-shadow: 0 0 25px rgba(201, 169, 89, 0.4);
    }
}

/* Bounce - Quique Suave */
.bounce-soft {
    animation: bounceSoft 2s infinite;
}

@keyframes bounceSoft {
    0%, 20%, 53%, 80%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -8px, 0);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -4px, 0);
    }
}

/* Rotate Slow - Rotação Lenta */
.rotate-slow {
    animation: rotateSlow 12s linear infinite;
}

@keyframes rotateSlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Wave - Ondulação */
.wave {
    animation: wave 2.5s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* ========================================
   ANIMAÇÕES ESPECIAIS
   ======================================== */

/* Shimmer - Brilho Deslizante */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -150%;
    }
    100% {
        left: 150%;
    }
}

/* Gradient Shift - Gradiente Animado */
.gradient-shift {
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Morphing Background */
.morph-bg {
    animation: morphBg 8s ease-in-out infinite;
}

@keyframes morphBg {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* Text Glow */
.text-glow {
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from {
        text-shadow: 0 0 5px rgba(201, 169, 89, 0.2),
                     0 0 10px rgba(201, 169, 89, 0.1);
    }
    to {
        text-shadow: 0 0 10px rgba(201, 169, 89, 0.4),
                     0 0 20px rgba(201, 169, 89, 0.2);
    }
}

/* Border Glow */
.border-glow {
    animation: borderGlow 2s ease-in-out infinite alternate;
}

@keyframes borderGlow {
    from {
        border-color: rgba(201, 169, 89, 0.3);
        box-shadow: 0 0 10px rgba(201, 169, 89, 0.1);
    }
    to {
        border-color: rgba(201, 169, 89, 0.6);
        box-shadow: 0 0 20px rgba(201, 169, 89, 0.3);
    }
}

/* ========================================
   ANIMAÇÕES ESCALONADAS
   ======================================== */

/* Stagger Fade In para Listas */
.stagger-fade-in > * {
    opacity: 0;
    animation: fadeInUp 0.6s var(--ease-out-expo) forwards;
}

.stagger-fade-in > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-fade-in > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-fade-in > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-fade-in > *:nth-child(8) { animation-delay: 0.8s; }

/* Stagger Sections */
.stagger-section {
    opacity: 0;
    transform: translateY(40px);
    animation: staggerSection 1s var(--ease-out-expo) forwards;
}

.stagger-section:nth-child(1) { animation-delay: 0.1s; }
.stagger-section:nth-child(2) { animation-delay: 0.2s; }
.stagger-section:nth-child(3) { animation-delay: 0.3s; }
.stagger-section:nth-child(4) { animation-delay: 0.4s; }
.stagger-section:nth-child(5) { animation-delay: 0.5s; }
.stagger-section:nth-child(6) { animation-delay: 0.6s; }

@keyframes staggerSection {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */

/* Animate on Scroll Base */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease-out-expo);
}

.animate-on-scroll.animate,
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animate Scale on Scroll */
.animate-scale-on-scroll {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.8s var(--ease-out-expo);
}

.animate-scale-on-scroll.animate,
.animate-scale-on-scroll.visible {
    opacity: 1;
    transform: scale(1);
}

/* Animate Left on Scroll */
.animate-left-on-scroll {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s var(--ease-out-expo);
}

.animate-left-on-scroll.animate,
.animate-left-on-scroll.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Animate Right on Scroll */
.animate-right-on-scroll {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s var(--ease-out-expo);
}

.animate-right-on-scroll.animate,
.animate-right-on-scroll.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ========================================
   MICRO-INTERAÇÕES
   ======================================== */

/* Button Press */
.press-effect {
    transition: transform 0.1s ease;
}

.press-effect:active {
    transform: scale(0.97);
}

/* Link Underline Animation */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-secondary);
    transition: width 0.4s var(--ease-out-expo);
}

.link-underline:hover::after {
    width: 100%;
}

/* Icon Spin on Hover */
.icon-spin-hover:hover i,
.icon-spin-hover:hover .icon {
    animation: spin 0.5s ease;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Card Tilt Effect */
.tilt-effect {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.tilt-effect:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(2deg);
}

/* ========================================
   LOADING ANIMATIONS
   ======================================== */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0ebe3 25%,
        #faf8f5 50%,
        #f0ebe3 75%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(13, 79, 79, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Dots Loading */
.dots-loading {
    display: inline-flex;
    gap: 4px;
}

.dots-loading span {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: dotsLoading 1.4s infinite ease-in-out both;
}

.dots-loading span:nth-child(1) { animation-delay: -0.32s; }
.dots-loading span:nth-child(2) { animation-delay: -0.16s; }
.dots-loading span:nth-child(3) { animation-delay: 0s; }

@keyframes dotsLoading {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* ========================================
   PERFORMANCE & ACCESSIBILITY
   ======================================== */

/* Will-change para performance */
.animated {
    will-change: transform, opacity;
}

.animated-transform {
    will-change: transform;
}

.animated-opacity {
    will-change: opacity;
}

/* Remove will-change após animação */
.animated-complete {
    will-change: auto;
}

/* Respeitar preferências 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;
    }

    .float,
    .pulse,
    .pulse-soft,
    .glow,
    .bounce-soft,
    .rotate-slow,
    .wave,
    .shimmer,
    .gradient-shift {
        animation: none !important;
    }

    .animate-on-scroll,
    .animate-scale-on-scroll,
    .animate-left-on-scroll,
    .animate-right-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ========================================
   MAPA SEMPRE VISÍVEL
   ======================================== */
.maps-section,
.maps-section.animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}

#maps-container,
#maps-container.animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}

/* ========================================
   UTILITÁRIOS DE DELAY
   ======================================== */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* Duração customizada */
.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.6s; }
.duration-slow { animation-duration: 1s; }
.duration-slower { animation-duration: 1.5s; }
