/**
 * Skeleton Screens - Chargement avec formes grises
 * Imite la structure du contenu final pour une meilleure UX
 * 
 * @package UMOA
 * @version 1.0
 */

/* ============================================================================
   SKELETON BASE
   ============================================================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 0%,
        var(--gray-100) 50%,
        var(--gray-200) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
    display: inline-block;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================================================
   SKELETON TYPES
   ============================================================================ */

/* Texte */
.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: var(--radius-sm);
}

.skeleton-text:last-child {
    margin-bottom: 0;
}

.skeleton-text-sm {
    height: 0.875em;
    width: 60%;
}

.skeleton-text-md {
    height: 1em;
    width: 80%;
}

.skeleton-text-lg {
    height: 1.25em;
    width: 100%;
}

/* Titre */
.skeleton-title {
    height: 1.5em;
    width: 70%;
    margin-bottom: 1em;
    border-radius: var(--radius-sm);
}

.skeleton-title-lg {
    height: 2em;
    width: 60%;
}

/* Avatar/Cercle */
.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.skeleton-avatar-sm {
    width: 32px;
    height: 32px;
}

.skeleton-avatar-lg {
    width: 64px;
    height: 64px;
}

/* Image/Rectangle */
.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-md);
    margin-bottom: 1em;
}

.skeleton-image-sm {
    height: 120px;
}

.skeleton-image-lg {
    height: 300px;
}

.skeleton-image-square {
    aspect-ratio: 1;
    height: auto;
}

/* Bouton */
.skeleton-button {
    height: 44px;
    width: 120px;
    border-radius: var(--radius-md);
}

.skeleton-button-full {
    width: 100%;
}

/* Card Skeleton */
.skeleton-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.skeleton-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.skeleton-card-body {
    margin-bottom: 1rem;
}

.skeleton-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Liste Skeleton */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skeleton-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Table Skeleton (mobile cards) */
.skeleton-table-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.skeleton-table-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skeleton-table-row-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Grid Skeleton */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.skeleton-grid-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ============================================================================
   SKELETON MOBILE
   ============================================================================ */

@media (max-width: 768px) {
    .skeleton-card {
        padding: 1rem;
        border-radius: var(--radius-mobile-lg);
    }
    
    .skeleton-image {
        height: 180px;
        border-radius: var(--radius-mobile-md);
    }
    
    .skeleton-grid {
        grid-template-columns: 1fr;
    }
    
    .skeleton-list-item {
        padding: 0.875rem;
        border-radius: var(--radius-mobile-md);
    }
}

/* ============================================================================
   UTILITAIRES
   ============================================================================ */

.skeleton-hidden {
    display: none !important;
}

.skeleton-fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

