/* ============================================================
   skeleton.css — Skeleton loaders reusables, mobile-first
   Compatible dark mode (body.dark-mode)
   Aucun texte visible, pas de librairie externe
   ============================================================ */

/* ── Variables de couleur ── */
:root {
    --sk-base: #e4e7ec;
    --sk-shine: #f0f3f8;
}
body.dark-mode {
    --sk-base: #1e2436;
    --sk-shine: #252d42;
}

/* ── Animation shimmer ── */
@keyframes sk-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

/* ── Classe de base ── */
.skeleton {
    background: var(--sk-base);
    background-image: linear-gradient(
        90deg,
        var(--sk-base)   0px,
        var(--sk-shine) 40%,
        var(--sk-base) 100%
    );
    background-size: 800px 100%;
    background-repeat: no-repeat;
    border-radius: 6px;
    animation: sk-shimmer 1.4s ease-in-out infinite;
    /* Aucun texte visible */
    color: transparent !important;
    user-select: none;
    pointer-events: none;
}

/* ── Bloc générique (dimensions via style inline) ── */
.skeleton-block {
    display: block;
    min-height: 16px;
    width: 100%;
}

/* ── Ligne de texte ── */
.skeleton-line {
    display: block;
    height: 14px;
    border-radius: 4px;
    margin-bottom: 8px;
}
.skeleton-line:last-child { margin-bottom: 0; }

/* Largeurs prédéfinies */
.sk-w25 { width: 25%; }
.sk-w50 { width: 50%; }
.sk-w75 { width: 75%; }
.sk-w100 { width: 100%; }

/* ── Carte entière ── */
.skeleton-card {
    background: var(--sk-base);
    background-image: linear-gradient(
        90deg,
        var(--sk-base)   0px,
        var(--sk-shine) 40%,
        var(--sk-base) 100%
    );
    background-size: 800px 100%;
    background-repeat: no-repeat;
    animation: sk-shimmer 1.4s ease-in-out infinite;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    min-height: 90px;
    color: transparent !important;
    user-select: none;
    pointer-events: none;
}

/* ── Ligne de tableau ── */
.skeleton-table-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--sk-base);
}
.skeleton-table-row .skeleton {
    height: 14px;
    border-radius: 4px;
}
.skeleton-table-row .sk-col-rank  { flex: 0 0 24px; }
.skeleton-table-row .sk-col-name  { flex: 1; }
.skeleton-table-row .sk-col-val   { flex: 0 0 52px; }

/* ── Placeholder graphique ECharts ── */
.skeleton-chart {
    width: 100%;
    min-height: 280px;
    border-radius: 10px;
    background: var(--sk-base);
    background-image: linear-gradient(
        90deg,
        var(--sk-base)   0px,
        var(--sk-shine) 40%,
        var(--sk-base) 100%
    );
    background-size: 800px 100%;
    background-repeat: no-repeat;
    animation: sk-shimmer 1.4s ease-in-out infinite;
    color: transparent !important;
    user-select: none;
    pointer-events: none;
}

/* ── Placeholder carte Leaflet ── */
.skeleton-map {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    background: var(--sk-base);
    background-image: linear-gradient(
        90deg,
        var(--sk-base)   0px,
        var(--sk-shine) 40%,
        var(--sk-base) 100%
    );
    background-size: 800px 100%;
    background-repeat: no-repeat;
    animation: sk-shimmer 1.4s ease-in-out infinite;
    color: transparent !important;
    user-select: none;
    pointer-events: none;
}

@media (max-width: 576px) {
    .skeleton-map {
        height: 260px;
        border-radius: 10px;
    }
    .skeleton-chart {
        min-height: 180px;
    }
}

/* ============================================================
   Onboarding — tutoriel guidé multi-étapes
   ============================================================ */

/* ── Overlay de fond ── */
.ob-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: ob-fadein .22s ease;
}
@keyframes ob-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Carte centrale ── */
.ob-card {
    background: #fff;
    border-radius: 18px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    display: flex;
    flex-direction: column;
    animation: ob-slidein .25s ease;
    -webkit-overflow-scrolling: touch;
    position: relative;
}
@keyframes ob-slidein {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
body.dark-mode .ob-card {
    background: #1a2035;
    color: #d0d8ef;
}

/* ── Header ── */
.ob-card-header {
    padding: 22px 22px 0;
    text-align: center;
}
/* ── Bouton Passer en haut à droite ── */
.ob-btn-skip {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: #aab0c4;
    font-size: .8rem;
    font-weight: 400;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color .15s, background .15s;
    line-height: 1;
}
.ob-btn-skip:hover { color: #4a5270; background: #f0f3f8; }
body.dark-mode .ob-btn-skip { color: #4a5270; }
body.dark-mode .ob-btn-skip:hover { color: #8892aa; background: #1e2436; }
.ob-emoji {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 8px;
}
.ob-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a2035;
    margin: 0 0 6px;
}
body.dark-mode .ob-title { color: #e8edf8; }

/* ── Corps ── */
.ob-card-body {
    padding: 12px 22px 0;
    font-size: .9rem;
    color: #4a5270;
    line-height: 1.55;
    flex: 1;
}
body.dark-mode .ob-card-body { color: #8892aa; }
.ob-card-body p { margin: 0 0 10px; }
.ob-card-body p:last-child { margin-bottom: 0; }

/* ── Tableau des points ── */
.ob-pts-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 4px;
    font-size: .85rem;
}
.ob-pts-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #e8ecf4;
}
body.dark-mode .ob-pts-table td { border-color: #2a3150; }
.ob-pts-table tr:last-child td { border-bottom: none; }
.ob-pts-table td:first-child { font-weight: 600; }
.ob-pts-table td:last-child  { text-align: right; color: #1c8c48; font-weight: 700; }
body.dark-mode .ob-pts-table td:last-child { color: #2db86e; }
.ob-pts-row-exact td { background: #f0fff5; }
body.dark-mode .ob-pts-row-exact td { background: rgba(29,140,72,.12); }

/* ── Progress dots ── */
.ob-progress {
    display: flex;
    justify-content: center;
    gap: 7px;
    padding: 16px 22px 0;
}
.ob-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cdd2e0;
    transition: background .2s, transform .2s;
}
.ob-dot.active {
    background: #3b82f6;
    transform: scale(1.25);
}
body.dark-mode .ob-dot { background: #2e3650; }
body.dark-mode .ob-dot.active { background: #5b9df5; }

/* ── Actions ── */
.ob-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px 20px;
    gap: 10px;
}
.ob-btn {
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 600;
    padding: 9px 20px;
    transition: opacity .15s, transform .1s;
    white-space: nowrap;
}
.ob-btn:active { transform: scale(.96); }
.ob-btn-prev {
    background: #f0f3f8;
    color: #4a5270;
}
body.dark-mode .ob-btn-prev { background: #252d42; color: #8892aa; }
.ob-btn-next, .ob-btn-done {
    background: #3b82f6;
    color: #fff;
    margin-left: auto;
}
.ob-btn-next:hover, .ob-btn-done:hover { opacity: .88; }

/* ── Bouton replay (hors modal) ── */
.ob-replay-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #8892aa;
    font-size: .75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}
.ob-replay-btn:hover {
    color: #4a5270;
    background: #f0f3f8;
}
body.dark-mode .ob-replay-btn { color: #5a6480; }
body.dark-mode .ob-replay-btn:hover { color: #8892aa; background: #1e2436; }

/* ── Step caché ── */
.ob-step { display: none; }
.ob-step.ob-active { display: block; }

@media (max-width: 400px) {
    .ob-card { border-radius: 14px; }
    .ob-card-header { padding: 16px 16px 0; }
    .ob-card-body  { padding: 10px 16px 0; }
    .ob-actions    { padding: 12px 16px 16px; }
    .ob-btn { padding: 8px 14px; font-size: .82rem; }
}
