/**
 * skeleton.css — Skeleton loading pour le thème ADIMED SARL
 * Utilise l'animation shimmer pour indiquer le chargement des contenus
 */

/* ====================================================
   1. BASE SHIMMER ANIMATION
   ==================================================== */
@keyframes adimed-shimmer {
    0%   { background-position: -800px 0; }
    100% { background-position:  800px 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #e8ecef 25%,
        #f4f6f8 50%,
        #e8ecef 75%
    );
    background-size: 800px 100%;
    animation: adimed-shimmer 1.6s ease-in-out infinite;
    border-radius: 6px;
    display: block;
}

/* ====================================================
   2. VARIANTES DE BLOCS
   ==================================================== */
.skeleton--text {
    height: 16px;
    width: 100%;
    border-radius: 4px;
    margin-bottom: 10px;
}
.skeleton--text-sm   { height: 12px; width: 65%; }
.skeleton--text-lg   { height: 22px; width: 80%; }
.skeleton--text-xl   { height: 28px; width: 60%; }
.skeleton--text-hero { height: 48px; width: 70%; }

.skeleton--line-group .skeleton--text:last-child { width: 45%; }

.skeleton--avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}
.skeleton--avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton--thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
    margin-bottom: 20px;
}

.skeleton--badge {
    height: 22px;
    width: 80px;
    border-radius: 100px;
    margin-bottom: 12px;
}

/* ====================================================
   3. CARD SKELETON — remplace une product/service card
   ==================================================== */
.skeleton-card {
    background: #ffffff;
    border: 1px solid #e8ecef;
    border-radius: 16px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.skeleton-card__thumb {
    width: 100%;
    height: 180px;
    border-radius: 10px;
    margin-bottom: 24px;
    background: linear-gradient(
        90deg,
        #e8ecef 25%,
        #f4f6f8 50%,
        #e8ecef 75%
    );
    background-size: 800px 100%;
    animation: adimed-shimmer 1.6s ease-in-out infinite;
}

.skeleton-card__title {
    height: 26px;
    width: 70%;
    border-radius: 4px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #e8ecef 25%, #f4f6f8 50%, #e8ecef 75%);
    background-size: 800px 100%;
    animation: adimed-shimmer 1.6s ease-in-out infinite;
}

.skeleton-card__subtitle {
    height: 14px;
    width: 40%;
    border-radius: 4px;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #e8ecef 25%, #f4f6f8 50%, #e8ecef 75%);
    background-size: 800px 100%;
    animation: adimed-shimmer 1.6s ease-in-out infinite;
}

.skeleton-card__lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
}

.skeleton-card__line {
    height: 13px;
    border-radius: 4px;
    background: linear-gradient(90deg, #e8ecef 25%, #f4f6f8 50%, #e8ecef 75%);
    background-size: 800px 100%;
    animation: adimed-shimmer 1.6s ease-in-out infinite;
}
.skeleton-card__line:nth-child(1) { width: 100%; }
.skeleton-card__line:nth-child(2) { width: 88%; }
.skeleton-card__line:nth-child(3) { width: 72%; }

.skeleton-card__btn {
    height: 46px;
    border-radius: 8px;
    background: linear-gradient(90deg, #e8ecef 25%, #f4f6f8 50%, #e8ecef 75%);
    background-size: 800px 100%;
    animation: adimed-shimmer 1.6s ease-in-out infinite;
}

/* ====================================================
   4. HERO SKELETON
   ==================================================== */
.skeleton-hero {
    height: 480px;
    background: linear-gradient(135deg, #001B3E 0%, #002B5C 100%);
    display: flex;
    align-items: center;
    padding: 0 5%;
}

.skeleton-hero__content {
    max-width: 560px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-hero .skeleton {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.05) 25%,
        rgba(255,255,255,0.10) 50%,
        rgba(255,255,255,0.05) 75%
    );
    background-size: 800px 100%;
}

/* ====================================================
   5. LIST ITEM SKELETON
   ==================================================== */
.skeleton-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f2f4;
}

/* ====================================================
   6. GRILLE SKELETON (products/solutions)
   ==================================================== */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

/* Stagger animation delay pour effet cascade */
.skeleton-card:nth-child(2) .skeleton-card__thumb,
.skeleton-card:nth-child(2) .skeleton-card__title,
.skeleton-card:nth-child(2) .skeleton-card__subtitle,
.skeleton-card:nth-child(2) .skeleton-card__line,
.skeleton-card:nth-child(2) .skeleton-card__btn { animation-delay: 0.1s; }

.skeleton-card:nth-child(3) .skeleton-card__thumb,
.skeleton-card:nth-child(3) .skeleton-card__title,
.skeleton-card:nth-child(3) .skeleton-card__subtitle,
.skeleton-card:nth-child(3) .skeleton-card__line,
.skeleton-card:nth-child(3) .skeleton-card__btn { animation-delay: 0.2s; }

/* ====================================================
   7. FADE-IN au reveal (quand le vrai contenu arrive)
   ==================================================== */
.skeleton-reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.skeleton-reveal.is-loaded {
    opacity: 1;
    transform: translateY(0);
}

/* stagger delay entre cards révélées */
.skeleton-reveal:nth-child(2) { transition-delay: 0.07s; }
.skeleton-reveal:nth-child(3) { transition-delay: 0.14s; }
.skeleton-reveal:nth-child(4) { transition-delay: 0.21s; }
.skeleton-reveal:nth-child(5) { transition-delay: 0.28s; }
.skeleton-reveal:nth-child(6) { transition-delay: 0.35s; }

/* ====================================================
   8. DARK MODE SKELETON
   ==================================================== */
@media (prefers-color-scheme: dark) {
    .skeleton,
    .skeleton-card__thumb,
    .skeleton-card__title,
    .skeleton-card__subtitle,
    .skeleton-card__line,
    .skeleton-card__btn {
        background: linear-gradient(
            90deg,
            #1e2533 25%,
            #252d3d 50%,
            #1e2533 75%
        );
        background-size: 800px 100%;
    }
    .skeleton-card {
        background: #151c2c;
        border-color: #252d3d;
    }
}
