/* ============================================================================
   IMPLANTA ANIMATIONS CSS
   Animações, transições e efeitos visuais
   ============================================================================ */

/* =================== KEYFRAMES =================== */

/* FadeIn - Entrada suave com opacidade e movimento vertical */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FadeIn rápido - Para elementos menores */
@keyframes fadeInFast {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SlideIn da esquerda */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* SlideIn da direita */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* SlideIn de cima */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SlideIn de baixo */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SlideDown - Para alertas e notificações */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ScaleUp - Crescimento com zoom */
@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse - Pulsação suave */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Bounce - Efeito de quique */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Shake - Efeito de tremor (para erros) */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Spin - Rotação (loading) */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shimmer - Efeito de brilho (skeleton loading) */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

/* Progress - Barra de progresso animada */
@keyframes progress {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100%);
    }
}

/* =================== CLASSES DE ANIMAÇÃO =================== */

/* FadeIn */
.animate-fadeIn,
.content-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-fadeIn-fast {
    animation: fadeInFast 0.3s ease-in-out;
}

.animate-fadeIn-slow {
    animation: fadeIn 0.8s ease-in-out;
}

/* SlideIn */
.animate-slideInLeft {
    animation: slideInLeft 0.4s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.4s ease-out;
}

.animate-slideInDown {
    animation: slideInDown 0.4s ease-out;
}

.animate-slideInUp {
    animation: slideInUp 0.4s ease-out;
}

/* ScaleUp */
.animate-scaleUp {
    animation: scaleUp 0.3s ease-out;
}

/* Pulse */
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-pulse-fast {
    animation: pulse 1s ease-in-out infinite;
}

/* Bounce */
.animate-bounce {
    animation: bounce 1s ease infinite;
}

.animate-bounce-once {
    animation: bounce 0.5s ease;
}

/* Shake */
.animate-shake {
    animation: shake 0.5s ease;
}

/* Spin */
.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-spin-slow {
    animation: spin 2s linear infinite;
}

.animate-spin-fast {
    animation: spin 0.5s linear infinite;
}

/* Shimmer (skeleton loading) */
.animate-shimmer {
    background: linear-gradient(
        to right,
        var(--implanta-light-gray) 0%,
        var(--implanta-very-light-gray) 20%,
        var(--implanta-light-gray) 40%,
        var(--implanta-light-gray) 100%
    );
    background-size: 800px 104px;
    animation: shimmer 1.5s linear infinite;
}

/* =================== DELAYS DE ANIMAÇÃO =================== */

.animation-delay-100 { animation-delay: 0.1s; }
.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-400 { animation-delay: 0.4s; }
.animation-delay-500 { animation-delay: 0.5s; }
.animation-delay-1000 { animation-delay: 1s; }

/* =================== DURAÇÕES DE ANIMAÇÃO =================== */

.animation-duration-fast { animation-duration: 0.2s; }
.animation-duration-normal { animation-duration: 0.3s; }
.animation-duration-slow { animation-duration: 0.5s; }
.animation-duration-slower { animation-duration: 0.8s; }

/* =================== EFEITOS DE HOVER COM ANIMAÇÃO =================== */

/* Hover com lift suave */
.hover-lift-animated {
    transition: all 0.3s ease;
}

.hover-lift-animated:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Hover com scale */
.hover-scale-animated {
    transition: transform 0.3s ease;
}

.hover-scale-animated:hover {
    transform: scale(1.05);
}

/* Hover com rotate */
.hover-rotate-animated {
    transition: transform 0.3s ease;
}

.hover-rotate-animated:hover {
    transform: rotate(5deg);
}

/* Hover com glow */
.hover-glow-animated {
    transition: all 0.3s ease;
}

.hover-glow-animated:hover {
    box-shadow: 0 0 20px rgba(20, 175, 204, 0.5);
}

/* =================== LOADING STATES =================== */

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--implanta-light-gray) 25%,
        var(--implanta-very-light-gray) 50%,
        var(--implanta-light-gray) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 2em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-card {
    height: 200px;
    border-radius: 10px;
}

/* Spinner customizado */
.spinner-implanta {
    width: 40px;
    height: 40px;
    border: 4px solid var(--implanta-light-gray);
    border-top-color: var(--implanta-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-implanta-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-implanta-lg {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

/* Dots loading */
.dots-loading {
    display: inline-flex;
    gap: 4px;
}

.dots-loading span {
    width: 8px;
    height: 8px;
    background-color: var(--implanta-primary);
    border-radius: 50%;
    animation: bounce 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; }

/* =================== TRANSIÇÕES ESPECÍFICAS =================== */

/* Transição de altura (para collapse) */
.transition-height {
    transition: height 0.3s ease, max-height 0.3s ease;
}

/* Transição de largura */
.transition-width {
    transition: width 0.3s ease;
}

/* Transição combinada */
.transition-all-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =================== EFEITOS DE ENTRADA (PAGE LOAD) =================== */

/* Entrada sequencial de elementos */
.stagger-in > * {
    animation: fadeIn 0.5s ease-in-out;
}

.stagger-in > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.6s; }

/* =================== REDUCE MOTION (ACESSIBILIDADE) =================== */

/* Respeitar preferência de movimento reduzido do usuário */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =================== PERFORMANCE OPTIMIZATION =================== */

/* Usar GPU para animações */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-auto {
    will-change: auto;
}

