/**
 * CONSTRUBÃO - Animações CSS
 * Keyframes, transições e efeitos visuais
 */

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

/* Slide Up - Entrada de baixo para cima */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Down - Entrada de cima para baixo */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Left - Entrada da direita */
@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide Right - Entrada da esquerda */
@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In - Aparecer suavemente */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade Out - Desaparecer suavemente */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Scale In - Zoom in */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Float - Flutuação suave */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Pulse - Pulsação */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Pulse Glow - Brilho pulsante */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
}

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

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

/* Rotate - Girar */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Heartbeat - Batida de coração */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.1);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(1);
    }
}

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

/* Slide Animations */
.animate-slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

.animate-slide-down {
    animation: slideDown 0.6s ease-out forwards;
}

.animate-slide-left {
    animation: slideLeft 0.6s ease-out forwards;
}

.animate-slide-right {
    animation: slideRight 0.6s ease-out forwards;
}

/* Fade Animations */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* Scale Animation */
.animate-scale-in {
    animation: scaleIn 0.4s ease-out forwards;
}

/* Float Animation */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

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

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

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

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

/* Rotate Animation */
.animate-rotate {
    animation: rotate 1s linear infinite;
}

/* Heartbeat Animation */
.animate-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* ============================================
   ANIMATION DELAYS
   ============================================ */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

.delay-600 {
    animation-delay: 600ms;
}

.delay-700 {
    animation-delay: 700ms;
}

.delay-800 {
    animation-delay: 800ms;
}

.delay-900 {
    animation-delay: 900ms;
}

.delay-1000 {
    animation-delay: 1000ms;
}

/* ============================================
   ANIMATION DURATIONS
   ============================================ */
.duration-200 {
    animation-duration: 200ms;
}

.duration-300 {
    animation-duration: 300ms;
}

.duration-500 {
    animation-duration: 500ms;
}

.duration-700 {
    animation-duration: 700ms;
}

.duration-1000 {
    animation-duration: 1000ms;
}

/* ============================================
   SCROLL ANIMATIONS (com Intersection Observer)
   ============================================ */

/* Estado inicial - elementos escondidos */
[data-animate] {
    opacity: 0;
}

[data-animate="slide-up"] {
    transform: translateY(30px);
}

[data-animate="slide-down"] {
    transform: translateY(-30px);
}

[data-animate="slide-left"] {
    transform: translateX(30px);
}

[data-animate="slide-right"] {
    transform: translateX(-30px);
}

[data-animate="scale"] {
    transform: scale(0.9);
}

[data-animate="fade"] {
    /* apenas opacity já definida */
}

/* Estado animado - quando entra na viewport */
[data-animate].animated {
    opacity: 1;
    transform: translate(0) scale(1);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Delays para animações em sequência */
[data-animate-delay="1"].animated {
    transition-delay: 0.1s;
}

[data-animate-delay="2"].animated {
    transition-delay: 0.2s;
}

[data-animate-delay="3"].animated {
    transition-delay: 0.3s;
}

[data-animate-delay="4"].animated {
    transition-delay: 0.4s;
}

[data-animate-delay="5"].animated {
    transition-delay: 0.5s;
}

/* ============================================
   HOVER TRANSITIONS
   ============================================ */

/* Scale on Hover */
.hover-scale {
    transition: transform var(--transition-normal);
}

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

/* Lift on Hover */
.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* Glow on Hover */
.hover-glow {
    transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 186, 0, 0.3);
}

/* Brightness on Hover */
.hover-bright {
    transition: filter var(--transition-normal);
}

.hover-bright:hover {
    filter: brightness(1.1);
}

/* Rotate on Hover */
.hover-rotate {
    transition: transform var(--transition-normal);
}

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

/* ============================================
   IMAGE ANIMATIONS
   ============================================ */

/* Zoom on Hover (para containers com overflow hidden) */
.img-zoom {
    transition: transform var(--transition-normal);
}

.img-zoom:hover {
    transform: scale(1.1);
}

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

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-gray-200) 25%,
        var(--color-gray-100) 50%,
        var(--color-gray-200) 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;
    }
}

/* ============================================
   DIAGONAL STRIPES (Decorativo)
   ============================================ */
.diagonal-stripes {
    background: repeating-linear-gradient(
        -45deg,
        var(--color-primary),
        var(--color-primary) 10px,
        var(--color-secondary) 10px,
        var(--color-secondary) 20px
    );
}

/* ============================================
   REDUCED MOTION
   Respeita preferências 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;
    }

    [data-animate] {
        opacity: 1;
        transform: none;
    }
}
