/**
 * ANIMAÇÕES
 * Keyframes e transições reutilizáveis
 */

/* Fade */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Slide */
@keyframes slideInDown {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Pulse */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes pulse-scale {
    0%, 100% {
    }
    50% {
    }
}

/* Bounce */
@keyframes bounce {
    0%, 100% {
    }
    50% {
    }
}

/* Spin */
@keyframes spin {
    from {
    }
    to {
    }
}

/* Heart beat */
@keyframes heartbeat {
    0%, 100% {
    }
    25% {
    }
    50% {
    }
}

/* Shake */
@keyframes shake {
    0%, 100% {
    }
    10%, 30%, 50%, 70%, 90% {
    }
    20%, 40%, 60%, 80% {
    }
}

/* Shimmer (loading) */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Gradient animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Notification */
@keyframes notificationSlide {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Skeleton loading */
@keyframes skeleton-loading {
    0% {
        background-color: rgba(165, 165, 165, 0.1);
    }
    50% {
        background-color: rgba(165, 165, 165, 0.2);
    }
    100% {
        background-color: rgba(165, 165, 165, 0.1);
    }
}

/* Scale */
@keyframes scaleIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Rotate */
@keyframes rotateIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Classes utilitárias */
.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-fade-out {
    animation: fadeOut 0.3s ease;
}

.animate-slide-down {
    animation: slideInDown 0.3s ease;
}

.animate-slide-up {
    animation: slideInUp 0.3s ease;
}

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

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

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

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-heartbeat {
    animation: heartbeat 1.3s ease-in-out infinite;
}

/* Transições suaves */
.smooth-transition {
    transition: all 0.3s ease;
}

.smooth-transition-fast {
    transition: all 0.15s ease;
}

.smooth-transition-slow {
    transition: all 0.5s ease;
}

/* Respeitar preferências de movimento */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Hover elevado com sombra */
.elevate-on-hover {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.elevate-on-hover:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Efeito de glow */
.glow {
    animation: pulse-scale 2s ease-in-out infinite;
}

/* Efeito de ripple */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
}

.ripple:active::after {
    animation: ripple-animation 0.6s ease-out;
}

@keyframes ripple-animation {
    to {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* Efeito de underline ao hover */
.underline-on-hover {
    position: relative;
    text-decoration: none;
}

.underline-on-hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    transform-origin: left;
    transition: transform 0.3s ease;
}

.underline-on-hover:hover::after {
}

/* ============================================================
 * SEM ANIMAÇÕES DE POSIÇÃO — em qualquer estado (hover/active/focus,
 * keyframes ou transições). Elas causavam "pulos" e scrollbar
 * momentânea ao renderizar/interagir.
 * ============================================================ */

/* 1) Nenhum keyframe roda */
*, *::before, *::after {
    animation: none !important;
}

/* 2) Nenhuma transição de transform (só cor/sombra/opacidade transicionam) */
*, *::before, *::after {
    transition-property: background-color, color, border-color, box-shadow,
        opacity, fill, stroke, filter, outline-color !important;
}

/* 3) Nenhum deslocamento em estados de interação */
*:hover, *:active, *:focus, *:focus-visible, *:focus-within,
*:hover::before, *:hover::after,
*:active::before, *:active::after,
*:focus::before, *:focus::after {
    transform: none !important;
}
