/* ============================================
   ANIMATIONS LIBRARY - Dashboard Mobile Premium
   ============================================ */

/* ========================================
   KEYFRAMES
   ======================================== */

/* Fade In Up - Entrada de elementos */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Scale - Entrada com escala */
@keyframes fade-in-scale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fade In - Simples */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Slide In Left */
@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right */
@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulse Glow - Brilho pulsante */
@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Pulse Soft - Pulsacao suave */
@keyframes pulse-soft {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

/* Streak Pulse - Badge de streak */
@keyframes streak-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 149, 0, 0);
    }
}

/* Ring Progress - Desenho do gauge */
@keyframes ring-progress {
    from {
        stroke-dashoffset: var(--ring-circumference, 251.33);
    }
    to {
        stroke-dashoffset: var(--ring-offset, 0);
    }
}

/* Gauge Fill - Preenchimento do gauge */
@keyframes gauge-fill {
    from {
        stroke-dasharray: 0 251.33;
    }
}

/* Number Count Up */
@keyframes count-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Bounce Soft */
@keyframes bounce-soft {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Bounce Down - Indicador de scroll */
@keyframes bounce-down {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(3px);
    }
}

/* Check Pop - Icone de check */
@keyframes check-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Shimmer - Loading effect */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Shake - Feedback de erro */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Celebrate - Conquista */
@keyframes celebrate {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.15) rotate(-5deg); }
    50% { transform: scale(1.15) rotate(5deg); }
    75% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Glow Pulse - Para badges */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 10px var(--glow-color, rgba(255, 214, 10, 0.3));
    }
    50% {
        box-shadow: 0 0 20px var(--glow-color, rgba(255, 214, 10, 0.5));
    }
}

/* Progress Bar Fill */
@keyframes progress-fill {
    from {
        width: 0;
    }
}

/* Rotate - Para icone de refresh */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   ANIMATION UTILITIES
   ======================================== */

/* Base Animations */
.animate-fade-in-up {
    animation: fade-in-up 0.5s ease-out both;
}

.animate-fade-in-scale {
    animation: fade-in-scale 0.4s ease-out both;
}

.animate-fade-in {
    animation: fade-in 0.3s ease-out both;
}

.animate-slide-in-left {
    animation: slide-in-left 0.4s ease-out both;
}

.animate-slide-in-right {
    animation: slide-in-right 0.4s ease-out both;
}

/* Continuous Animations */
.animate-pulse-glow {
    animation: pulse-glow 4s ease-in-out infinite;
}

.animate-pulse-soft {
    animation: pulse-soft 2s ease-in-out infinite;
}

.animate-streak-pulse {
    animation: streak-pulse 2s ease-in-out infinite;
}

.animate-bounce-soft {
    animation: bounce-soft 2s ease-in-out infinite;
}

.animate-bounce-down {
    animation: bounce-down 1.5s ease-in-out infinite;
}

.animate-glow-pulse {
    animation: glow-pulse 2s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 1s linear infinite;
}

/* One-time Animations */
.animate-check-pop {
    animation: check-pop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

.animate-celebrate {
    animation: celebrate 0.6s ease-in-out;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* Progress Animations */
.animate-gauge-fill {
    animation: gauge-fill 1.2s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-progress-fill {
    animation: progress-fill 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ========================================
   STAGGER DELAYS
   ======================================== */

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }
.stagger-9 { animation-delay: 0.45s; }
.stagger-10 { animation-delay: 0.5s; }

/* ========================================
   DURATION MODIFIERS
   ======================================== */

.duration-fast { animation-duration: 0.2s; }
.duration-normal { animation-duration: 0.4s; }
.duration-slow { animation-duration: 0.6s; }
.duration-slower { animation-duration: 1s; }

/* ========================================
   LOADING SKELETON
   ======================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 100%
    );
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm, 8px);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
}

.skeleton-circle {
    border-radius: 50%;
}

/* ========================================
   TRANSITION UTILITIES
   ======================================== */

.transition-all {
    transition: all var(--transition-base, 0.3s ease);
}

.transition-transform {
    transition: transform var(--transition-base, 0.3s ease);
}

.transition-opacity {
    transition: opacity var(--transition-base, 0.3s ease);
}

.transition-colors {
    transition: color var(--transition-base, 0.3s ease),
                background-color var(--transition-base, 0.3s ease),
                border-color var(--transition-base, 0.3s ease);
}

/* ========================================
   HOVER EFFECTS
   ======================================== */

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-scale:active {
    transform: scale(0.98);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow-blue);
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
