/**
 * Анимации — входные эффекты, переходы, микро-анимации.
 */

/* ─── Keyframes ──────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes floatBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ─── Утилиты анимаций ────────────────────────────────────────────────────── */
.animate-fade-in {
    animation: fadeIn var(--duration-base) var(--ease-out);
}

.animate-fade-in-up {
    animation: fadeInUp var(--duration-slow) var(--ease-out);
}

.animate-fade-in-down {
    animation: fadeInDown var(--duration-slow) var(--ease-out);
}

.animate-slide-in-left {
    animation: slideInLeft var(--duration-slow) var(--ease-out);
}

.animate-slide-in-right {
    animation: slideInRight var(--duration-slow) var(--ease-out);
}

.animate-scale-in {
    animation: scaleIn var(--duration-base) var(--ease-spring);
}

/* Задержки для последовательной анимации элементов */
.delay-1 {
    animation-delay: 50ms;
    animation-fill-mode: both;
}

.delay-2 {
    animation-delay: 100ms;
    animation-fill-mode: both;
}

.delay-3 {
    animation-delay: 150ms;
    animation-fill-mode: both;
}

.delay-4 {
    animation-delay: 200ms;
    animation-fill-mode: both;
}

.delay-5 {
    animation-delay: 250ms;
    animation-fill-mode: both;
}

/* ─── Ripple-эффект на кнопках ────────────────────────────────────────────── */
.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    pointer-events: none;
    animation: ripple 0.6s linear forwards;
}

/* ─── Shimmer-эффект загрузки ─────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ─── Плавное переключение темы ───────────────────────────────────────────── */
.theme-transitioning * {
    transition-duration: var(--duration-slow) !important;
}