/* =============================================
   SKELETON.CSS
   Estilos base para loaders inteligentes
   ============================================= */

.skeleton {
    background-color: #1a1a1a;
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    position: relative;
    overflow: hidden;
}

/* --- POLISH: Clean Load Transition --- */
.skeleton-img-transition,
.skeleton img {
    /* When clean, opacity will be 1 (default) */
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* While loading (parent has .skeleton), hide the image/child */
.skeleton>img,
.skeleton>.skeleton-img-transition,
.skeleton .skeleton-image-hidden {
    opacity: 0 !important;
}

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

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

/* Base Rects */
.skeleton-rect {
    background: #1a1a1a;
}

/* Specific Sizes for Profile Header */
.skeleton-profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.skeleton-profile-name {
    width: 250px;
    height: 32px;
    border-radius: 4px;
}

.skeleton-profile-meta {
    height: 14px;
    border-radius: 2px;
    display: inline-block;
}

.skeleton-profile-bio {
    width: 100%;
    max-width: 600px;
    height: 16px;
    margin-top: 12px;
    border-radius: 4px;
}

.skeleton-profile-stats {
    height: 14px;
    border-radius: 2px;
    display: inline-block;
}

.skeleton-profile-btn {
    width: 120px;
    height: 40px;
    border-radius: 8px;
}

.skeleton-profile-social {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Waveform Skeleton (Specific for Wavesurfer replacements) */
.skeleton-waveform {
    height: 30px;
    background: #1a1a1a;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 4px;
}

.skeleton-waveform::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Create a repeating bar pattern for the waveform look */
    background: repeating-linear-gradient(90deg,
            #444,
            /* Darker bars */
            #444 2px,
            transparent 2px,
            transparent 4px);
    opacity: 0.8;
}

/* Static Fallback (Solid look, no animation) */
.waveform-static-fallback {
    height: 24px;
    width: 100%;
    background: repeating-linear-gradient(90deg,
            rgba(255, 255, 255, 0.25),
            /* Increased brightness */
            rgba(255, 255, 255, 0.25) 2px,
            transparent 2px,
            transparent 4px);
    border-radius: 4px;
    align-self: center;
}

.skeleton-waveform::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(139, 92, 246, 0.2) 50%,
            transparent 100%);
    animation: skeleton-waveform-slide 2s infinite linear;
}

@keyframes skeleton-waveform-slide {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(50%);
    }
}

/* Trending Cards */
.skeleton-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-card-cover {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 8px;
}

.skeleton-card-title {
    width: 80%;
    height: 16px;
    border-radius: 4px;
}

.skeleton-card-subtitle {
    width: 40%;
    height: 12px;
    border-radius: 2px;
}

/* Row Skeletons (List View) */
.skeleton-fav-row,
.skeleton-list-row {
    background: transparent !important;
}

.skeleton {
    display: inline-block;
}