/**
 * Skeleton Loading - Placeholders animés
 * Affichés pendant le chargement des contenus
 */

/* Animation shimmer */
@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Skeleton de base */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(111, 175, 166, 0.05) 25%,
        rgba(111, 175, 166, 0.15) 50%,
        rgba(111, 175, 166, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* Variantes de skeleton */
.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-text:last-child {
    margin-bottom: 0;
    width: 80%; /* Dernière ligne plus courte */
}

.skeleton-title {
    height: 2em;
    margin-bottom: 1em;
    border-radius: 6px;
}

.skeleton-card {
    height: 200px;
    border-radius: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-button {
    height: 40px;
    width: 120px;
    border-radius: 4px;
}

.skeleton-image {
    width: 100%;
    padding-bottom: 75%; /* Ratio 4:3 */
    border-radius: 8px;
}

.skeleton-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
}

/* Skeleton countdown */
.skeleton-countdown {
    display: inline-block;
    width: 60px;
    height: 60px;
    border-radius: 8px;
}

.skeleton-countdown-label {
    width: 50px;
    height: 12px;
    margin-top: 8px;
}

/* Skeleton pour les compteurs de grimaces */
.skeleton-counter {
    width: 80px;
    height: 50px;
    border-radius: 8px;
}

.skeleton-counter-label {
    width: 70px;
    height: 10px;
    margin-top: 4px;
}

/* Container pour plusieurs skeletons */
.skeleton-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* Pulse variant - alternative à shimmer */
@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton-pulse {
    background: rgba(111, 175, 166, 0.1);
    animation: skeleton-pulse 2s ease-in-out infinite;
}

/* Wave variant - effet de vague */
@keyframes skeleton-wave {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.skeleton-wave::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: skeleton-wave 1.5s ease-in-out infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .skeleton-card {
        height: 150px;
    }

    .skeleton-countdown {
        width: 50px;
        height: 50px;
    }
}

/* Transition when content loads */
.skeleton-loaded {
    animation: fade-in 0.3s ease-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Hide actual content while skeleton is showing */
.skeleton-container.loading > *:not(.skeleton) {
    visibility: hidden;
}

.skeleton-container.loaded .skeleton {
    display: none;
}
