/**
 * Skeleton Screen Styles
 * 
 * Provides loading placeholders that mimic the final content layout,
 * improving perceived performance and reducing layout shift.
 */

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    margin: 0.5em 0;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-text.long {
    width: 100%;
}

.skeleton-title {
    height: 1.5em;
    width: 50%;
    margin-bottom: 1em;
}

.skeleton-card {
    padding: 1.5em;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1em;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 4px;
}

.skeleton-button {
    height: 2.5em;
    width: 120px;
    border-radius: 4px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .skeleton {
        background: linear-gradient(
            90deg,
            #2a2a2a 25%,
            #3a3a3a 50%,
            #2a2a2a 75%
        );
        background-size: 200% 100%;
    }
    
    .skeleton-card {
        border-color: #3a3a3a;
    }
}

/* Fade-in animation for content replacement */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Skeleton container */
.skeleton-container {
    display: none;
}

.skeleton-container.loading {
    display: block;
}

.skeleton-container.loading ~ .content-container {
    display: none;
}

.content-container {
    display: block;
}

.content-container.loading {
    display: none;
}

