/**
 * Skeleton loading states y animación shimmer.
 * Placeholders visuales mientras el contenido carga desde la API.
 */

/* ─── Shimmer Animation ──────────────────────────────────────────────────── */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.04) 25%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

/* ─── Hero Skeleton ──────────────────────────────────────────────────────── */
.hero-skeleton {
    height: 550px;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 0 20px 40px;
}

.hero-skeleton-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    width: 100%;
}

.hero-skeleton-title {
    height: 40px;
    width: 70%;
    border-radius: 8px;
}

.hero-skeleton-meta {
    height: 16px;
    width: 40%;
    border-radius: 6px;
}

.hero-skeleton-genres {
    display: flex;
    gap: 8px;
}

.hero-skeleton-genre {
    height: 26px;
    width: 70px;
    border-radius: 20px;
}

.hero-skeleton-desc {
    height: 50px;
    width: 90%;
    border-radius: 8px;
}

.hero-skeleton-btn {
    height: 48px;
    width: 160px;
    border-radius: 50px;
}

/* ─── Episode Card Skeleton ──────────────────────────────────────────────── */
.ep-skeleton {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ep-skeleton-thumb {
    aspect-ratio: 16/9;
    width: 100%;
    border-radius: var(--radius-md);
}

.ep-skeleton-name {
    height: 14px;
    width: 80%;
    margin-top: 8px;
    border-radius: 6px;
}

/* ─── Anime Card Skeleton ────────────────────────────────────────────────── */
.card-skeleton {
    flex: 0 0 140px;
    min-width: 140px;
}

.card-skeleton-poster {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--radius-lg);
}

.card-skeleton-name {
    height: 14px;
    width: 75%;
    margin-top: 10px;
    border-radius: 6px;
}

/* ─── Section Skeleton ───────────────────────────────────────────────────── */
.section-skeleton-title {
    height: 24px;
    width: 200px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.section-skeleton-row {
    display: flex;
    gap: 12px;
    overflow: hidden;
}

/* ─── Image Lazy Load Fade-in ────────────────────────────────────────────── */
.img-lazy {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.img-lazy.loaded {
    opacity: 1;
}

/* ─── Loading Container ──────────────────────────────────────────────────── */
.page-loading-state {
    min-height: 400px;
}

/* ─── Light Theme ────────────────────────────────────────────────────────── */
[data-theme="light"] .skeleton {
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.04) 25%,
            rgba(0, 0, 0, 0.08) 50%,
            rgba(0, 0, 0, 0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (min-width: 640px) {
    .hero-skeleton {
        height: 500px;
        padding: 0 40px 50px;
    }

    .hero-skeleton-title {
        height: 46px;
    }
}

@media (min-width: 768px) {
    .hero-skeleton {
        height: 65vh;
        padding: 0 50px 60px;
    }
}

@media (min-width: 1024px) {
    .hero-skeleton {
        height: 560px;
        padding: 0 60px 70px;
    }

    .hero-skeleton-title {
        height: 52px;
        width: 60%;
    }

    .hero-skeleton-content {
        max-width: 600px;
    }
}

@media (min-width: 1280px) {
    .hero-skeleton {
        height: 620px;
        padding: 0 80px 80px;
    }
}

@media (max-width: 380px) {
    .hero-skeleton {
        height: 420px;
    }

    .hero-skeleton-title {
        height: 32px;
    }
}