/**
 * CloudWifi — Skeleton loaders (site-wide)
 * Classes: .cw-skel, .cw-skel-line, .cw-page-skel
 * Helpers JS: window.CWSkeleton
 */

/* Lignes */
.cw-skel {
    padding: 0.75rem 0.25rem;
}

.cw-skel-line {
    display: block;
    height: 14px;
    width: 100%;
    margin-bottom: 12px;
    border-radius: 6px;
    background-color: #d1d5db;
    background-image: linear-gradient(90deg, #d1d5db 0%, #f3f4f6 40%, #d1d5db 80%);
    background-size: 200% 100%;
    animation: cw-skel-shine 1.1s linear infinite;
}

.cw-skel-line:last-child { margin-bottom: 0; }
.cw-skel-line.lg { height: 22px; width: 48%; margin-bottom: 18px; }
.cw-skel-line.mid { width: 70%; }
.cw-skel-line.short { width: 40%; }
.cw-skel-line.kpi { height: 72px; border-radius: 12px; margin-bottom: 0; }

.cw-skel-table .cw-skel-line {
    height: 40px;
    margin-bottom: 10px;
    border-radius: 8px;
}

.cw-skel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 1.25rem;
}

@keyframes cw-skel-shine {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Overlay page (navigation / boot) */
.cw-page-skel {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: var(--page-bg, #f4f6f9);
    padding: 80px 24px 24px;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.cw-page-skel.is-hiding {
    opacity: 0;
    pointer-events: none;
}

.cw-page-skel[hidden] {
    display: none !important;
}

.cw-page-skel-inner {
    max-width: 1100px;
    margin: 0 auto;
}

body.cw-has-sidebar .cw-page-skel {
    left: var(--sb-total-w, 0);
}

@media (max-width: 991.98px) {
    body.cw-has-sidebar .cw-page-skel {
        left: 0;
        padding-top: 72px;
    }
}

/* Bootstrap placeholder fallback */
.placeholder {
    display: inline-block;
    min-height: 1em;
    vertical-align: middle;
    cursor: wait;
    background-color: currentColor;
    opacity: 0.18;
    border-radius: 0.25rem;
}
.placeholder.col-12,
.placeholder.col-10,
.placeholder.col-8,
.placeholder.col-6,
.placeholder.col-5 {
    display: block;
    width: 100%;
}
.placeholder.col-10 { width: 83%; }
.placeholder.col-8 { width: 66%; }
.placeholder.col-6 { width: 50%; }
.placeholder.col-5 { width: 42%; }
.placeholder-glow .placeholder {
    animation: cw-placeholder-glow 1.6s ease-in-out infinite;
}
@keyframes cw-placeholder-glow {
    50% { opacity: 0.08; }
}

/* Chatbot typing → skeleton */
.cb-typing .message-bubble.cw-skel-chat {
    min-width: 140px;
    padding: 12px 14px;
}
.cb-typing .cw-skel-line {
    height: 10px;
    margin-bottom: 8px;
}
