/* Skeleton Loading Styles */
.skeleton {
    background-color: #e0e0e0;
    background-image: linear-gradient(90deg,
            #e0e0e0 0px,
            #f0f0f0 40px,
            #e0e0e0 80px);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    border-radius: 4px;
    display: inline-block;
    color: transparent !important;
    user-select: none;
    cursor: default;
}

/* Dark mode / Dark sections support */
.bg-dark .skeleton,
.bg-dark-alt .skeleton,
.collection-section .skeleton,
.collection-section .nav-btn.skeleton {
    background-color: #333;
    background-image: linear-gradient(90deg,
            #333 0px,
            #444 40px,
            #333 80px);
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Typography Skeletons */
.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    width: 100%;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-title {
    height: 2rem;
    width: 80%;
    margin-bottom: 1rem;
}

.skeleton-h1 {
    height: 3rem;
    width: 70%;
    margin-bottom: 1.5rem;
}

/* Image Skeletons */
.skeleton-image {
    width: 100%;
    height: 100%;
    min-height: 200px;
    display: block;
}

/* Specific Component Skeletons */
.jersey-preview-large.skeleton-loading .spotlight-player,
.jersey-preview-large.skeleton-loading .main-jersey-img {
    opacity: 0;
}

.jersey-preview-large.skeleton-loading {
    background-color: #eee;
    background-image: linear-gradient(90deg,
            #eee 0px,
            #f5f5f5 40px,
            #eee 80px);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    border-radius: 12px;
}

/* Specific Dark Mode for Large Preview */
.collection-section .jersey-preview-large.skeleton-loading,
.bg-dark .jersey-preview-large.skeleton-loading {
    background-color: #222;
    background-image: linear-gradient(90deg,
            #222 0px,
            #333 40px,
            #222 80px);
    border: 1px solid #333;
}

/* Button Skeletons */
.nav-btn.skeleton {
    width: 100px;
    height: 40px;
    border: none;
    pointer-events: none;
}

/* Loading State Helper */
.is-loading>* {
    visibility: hidden;
}

.is-loading::after {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background-color: #e0e0e0;
    background-image: linear-gradient(90deg,
            #e0e0e0 0px,
            #f0f0f0 40px,
            #e0e0e0 80px);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    visibility: visible;
}

/* Skeleton Preview Placeholder (Positioned to match content) */
.skeleton-preview-placeholder {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60%;
    height: 90%;
    /* Similar to player image height */
    transform: translateY(5%);
    border-radius: 12px;
    z-index: 0;
}

/* Adjustments for dark sections */
.collection-section .skeleton-preview-placeholder,
.bg-dark .skeleton-preview-placeholder {
    background-color: #222;
    background-image: linear-gradient(90deg,
            #222 0px,
            #333 40px,
            #222 80px);
    border: 1px solid #333;
}

/* Image Skeletons - Ensure Dimensions */

/* Variações Nav */
.var-thumb {
    position: relative;
    /* Ensure it has size */
    min-height: 80px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* History Items */
.player-cutout,
.mockup-view {
    position: relative;
    min-height: 200px;
    /* Default height */
    width: 100%;
}

/* Assets/Patches */
.asset-preview {
    position: relative;
    min-height: 100px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.asset-preview .skeleton-image {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Gallery Items */
.gallery-item {
    position: relative;
    min-height: 150px;
    background-color: #f0f0f0;
    /* Default background if skeleton fails */
}

/* Info Images (Context/Curiosities) */
.media {
    position: relative;
    min-height: 300px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .var-thumb {
        min-height: 50px;
    }

    .player-cutout {
        min-height: 150px;
    }

    .mockup-view {
        min-height: 120px;
    }

    .media {
        min-height: 200px;
    }
}