/* ═══════════════════════════════════════════════════════════════
 *  Animangahub — Instant Navigation Skeleton Overlay
 *  Additive layer: paints a watch-page skeleton the instant a user
 *  clicks a watch-bound link, so the 5s server work never shows as a
 *  white screen. Removed automatically when the real page loads.
 *  Touches nothing in the streaming core (providers/HLS/proxy).
 * ═══════════════════════════════════════════════════════════════ */

.nav-skeleton-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg-color, #0b0b0f);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Painted synchronously; fade only affects removal */
    opacity: 1;
    animation: navSkelFadeIn 120ms ease-out;
}

.nav-skeleton-overlay.is-hiding {
    opacity: 0;
    transition: opacity 140ms ease-in;
    pointer-events: none;
}

@keyframes navSkelFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.nav-skeleton-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 16px 48px;
}

/* Shimmer primitive */
.nav-skel {
    position: relative;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
}

.nav-skel::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.09) 50%,
        transparent 100%
    );
    animation: navSkelShimmer 1.3s infinite;
}

@keyframes navSkelShimmer {
    100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .nav-skel::after { animation: none; }
    .nav-skeleton-overlay { animation: none; }
}

/* Layout: player column + sidebar */
.nav-skel-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    margin-top: 12px;
}

.nav-skel-breadcrumb {
    height: 14px;
    width: 260px;
    max-width: 60%;
    margin-bottom: 16px;
    border-radius: 6px;
}

/* Video skeleton — 16:9 */
.nav-skel-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
}

.nav-skel-video::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 54px;
    height: 54px;
    margin: -27px 0 0 -27px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--accent-color, #e63946);
    border-radius: 50%;
    animation: navSkelSpin 0.8s linear infinite;
    z-index: 2;
}

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

.nav-skel-bar {
    height: 40px;
    margin-top: 14px;
    border-radius: 999px;
}

.nav-skel-title {
    height: 28px;
    width: 60%;
    margin-top: 18px;
    border-radius: 8px;
}

.nav-skel-subtitle {
    height: 16px;
    width: 40%;
    margin-top: 12px;
    border-radius: 6px;
}

/* Episode list skeleton */
.nav-skel-eplist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 8px;
    margin-top: 20px;
}

.nav-skel-ep {
    height: 40px;
    border-radius: 8px;
}

/* Info / meta skeleton lines */
.nav-skel-lines {
    margin-top: 24px;
}

.nav-skel-line {
    height: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
}

.nav-skel-line.w-90 { width: 90%; }
.nav-skel-line.w-70 { width: 70%; }
.nav-skel-line.w-50 { width: 50%; }

/* Sidebar: poster + info */
.nav-skel-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
}

.nav-skel-related {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.nav-skel-related-item {
    display: flex;
    gap: 10px;
}

.nav-skel-related-thumb {
    width: 64px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 8px;
}

.nav-skel-related-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 6px;
}

@media (max-width: 900px) {
    .nav-skel-grid {
        grid-template-columns: 1fr;
    }
    .nav-skel-sidebar {
        display: none;
    }
}
