/**
 * Guia Bicuiras - Animations Library
 * Inspirado em Animate.css + GSAP + Framer Motion
 * Animações suaves e performáticas para UX moderna
 */

/* ========================================
   KEYFRAMES - ANIMAÇÕES BASE
======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale3d(0.8, 0.8, 0.8);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

@keyframes slideInUp {
    from {
        transform: translate3d(0, 100%, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes bounceIn {
    from,
    20%,
    40%,
    60%,
    80%,
    to {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

@keyframes pulse {
    0% {
        transform: scale3d(1, 1, 1);
    }
    50% {
        transform: scale3d(1.05, 1.05, 1.05);
    }
    100% {
        transform: scale3d(1, 1, 1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes scrollWheel {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
    80% {
        transform: translateY(12px);
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

/* ========================================
   CLASSES DE ANIMAÇÃO
======================================== */

/* Elementos que precisam ser animados ao entrar na viewport */
[data-animate] {
    opacity: 0;
    will-change: transform, opacity;
}

/* Quando o elemento entra na viewport */
[data-animate].animated {
    animation-duration: 0.8s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
}

/* Variações de animação */
[data-animate="fadeIn"].animated {
    animation-name: fadeIn;
}

[data-animate="fadeInUp"].animated {
    animation-name: fadeInUp;
}

[data-animate="fadeInDown"].animated {
    animation-name: fadeInDown;
}

[data-animate="fadeInLeft"].animated {
    animation-name: fadeInLeft;
}

[data-animate="fadeInRight"].animated {
    animation-name: fadeInRight;
}

[data-animate="zoomIn"].animated {
    animation-name: zoomIn;
}

[data-animate="slideInUp"].animated {
    animation-name: slideInUp;
}

[data-animate="bounceIn"].animated {
    animation-name: bounceIn;
}

/* Delays personalizados */
[data-delay="0.1s"].animated { animation-delay: 0.1s; }
[data-delay="0.2s"].animated { animation-delay: 0.2s; }
[data-delay="0.3s"].animated { animation-delay: 0.3s; }
[data-delay="0.4s"].animated { animation-delay: 0.4s; }
[data-delay="0.5s"].animated { animation-delay: 0.5s; }
[data-delay="0.6s"].animated { animation-delay: 0.6s; }
[data-delay="0.7s"].animated { animation-delay: 0.7s; }
[data-delay="0.8s"].animated { animation-delay: 0.8s; }
[data-delay="0.9s"].animated { animation-delay: 0.9s; }
[data-delay="1s"].animated { animation-delay: 1s; }

/* ========================================
   MICRO-INTERAÇÕES
======================================== */

/* Efeito hover para botões */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.btn-hover-effect::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-hover-effect:hover::before {
    width: 300px;
    height: 300px;
}

.btn-hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-hover-effect:active {
    transform: translateY(0);
}

/* Efeito ripple */
.btn-ripple {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

/* Underline animado para links */
.link-underline-effect {
    position: relative;
    text-decoration: none;
    display: inline-block;
}

.link-underline-effect::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.link-underline-effect:hover::after {
    width: 100%;
}

/* Cards com hover suave */
.card-hover-lift {
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.card-hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Pulse animation para badges */
.pulse-animation {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Float animation */
.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* ========================================
   LOADING & SKELETON
======================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   SCROLL PROGRESS BAR
======================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #2DB8C7, #1E88E5);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ========================================
   PARALLAX & TRANSFORM EFFECTS
======================================== */

.parallax-element {
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Efeito de reveal suave */
.reveal-container {
    overflow: hidden;
}

.reveal-content {
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal-container.revealed .reveal-content {
    transform: translateY(0);
}

/* ========================================
   RESPONSIVE ANIMATIONS
======================================== */

/* Reduzir animações em dispositivos móveis para performance */
@media (max-width: 768px) {
    [data-animate].animated {
        animation-duration: 0.5s;
    }
    
    .btn-hover-effect:hover {
        transform: translateY(-1px);
    }
    
    .card-hover-lift:hover {
        transform: translateY(-4px);
    }
}

/* Respeitar preferência de animação reduzida */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   SCROLL ANIMATIONS - VISIBILITY
======================================== */

.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   STAGGER ANIMATIONS - Para listas
======================================== */

.stagger-item {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-item.animated {
    animation: fadeInUp 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.4s; }

