/* ============================================ */
/* ANIMACIONES                                  */
/* Animaciones de carga, transiciones globales  */
/* ============================================ */

/* ── FADE IN ─────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── SLIDE UP ────────────────────────────────── */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── SLIDE IN LEFT ───────────────────────────── */
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ── SCALE IN ────────────────────────────────── */
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ── PULSE ───────────────────────────────────── */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

/* ── SCROLL ANIMATION ────────────────────────── */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ── SKELETON LOADING ────────────────────────── */
@keyframes skeletonShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-card-hover) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    border-radius: var(--radius-sm);
}

.skeleton-text--sm {
    height: 10px;
    width: 60%;
}

.skeleton-text--lg {
    height: 20px;
    width: 80%;
}

.skeleton-title {
    height: 24px;
    width: 50%;
    border-radius: var(--radius-sm);
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-lg);
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-btn {
    height: 44px;
    border-radius: var(--radius-md);
    width: 100%;
}

.skeleton-btn--sm {
    height: 36px;
    width: 120px;
    border-radius: var(--radius-md);
}

/* ── SPIN ────────────────────────────────────── */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* ── BOUNCE ──────────────────────────────────── */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
    40%, 43% { transform: translateY(-10px); }
    70% { transform: translateY(-5px); }
    90% { transform: translateY(-2px); }
}

.bounce {
    animation: bounce 1s ease;
}

/* ── GLOW ────────────────────────────────────── */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--color-primary-glow); }
    50% { box-shadow: 0 0 20px var(--color-primary-glow), 0 0 40px var(--color-primary-glow); }
}

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

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page-transition.active {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
