/* Shimmer skeletons — placeholders shown while something loads, shaped like
   what will replace them. Markup comes from assets/js/skeleton.js
   (window.raSkel); used by the queue tab, the pickers' home shelves and the
   Data tab.

   .ra-skel           a shimmering block (give it a size)
   .ra-skel-card      cover + two text lines; drops into any card grid
   .ra-skel-cover     the card's cover: square, --poster (2:3), --wide (16:9)
   .ra-skel-line      a text line; --sm is shorter and thinner */

@keyframes raSkelSweep {
    from { background-position: 100% 0; }
    to   { background-position: -100% 0; }
}
.ra-skel {
    display: block;
    border-radius: 8px;
    background: linear-gradient(100deg, #eceef3 30%, #f7f8fb 50%, #eceef3 70%);
    background-size: 200% 100%;
    animation: raSkelSweep 1.3s ease-in-out infinite;
}
.ra-skel-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    pointer-events: none;
}
.ra-skel-cover { width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; }
.ra-skel-cover--poster { aspect-ratio: 2 / 3; }
.ra-skel-cover--wide   { aspect-ratio: 16 / 9; }
.ra-skel-line { height: 11px; width: 80%; border-radius: 6px; }
.ra-skel-line--sm { height: 9px; width: 50%; }

/* A shelf: a title line over one row of cards. Cards past the first row are
   clipped, so the row always ends on whole cards at any width. */
.ra-skel-shelf { margin-bottom: 26px; }
.ra-skel-shelf__title { height: 14px; width: 150px; margin-bottom: 14px; }
.ra-skel-shelf__row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    grid-template-rows: auto;
    grid-auto-rows: 0;
    column-gap: 14px;
    overflow: hidden;
}

/* Lazy queue tab: header, list, then the picker's search bar and shelves. */
.ra-skel-tab { padding-top: 4px; }
.ra-skel-tab__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.ra-skel-tab__title { height: 20px; width: 130px; }
.ra-skel-tab__btns { display: flex; gap: 8px; }
.ra-skel-tab__btn { width: 64px; height: 30px; border-radius: 8px; }
.ra-skel-tab__addhead {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 30px 0 16px;
    padding-top: 22px;
    border-top: 1px solid #eef0f4;
}
.ra-skel-tab__icon { width: 40px; height: 40px; border-radius: 10px; }
.ra-skel-tab__addtitle { height: 18px; width: 220px; max-width: 60%; }
.ra-skel-tab__search { height: 58px; border-radius: 12px; margin-bottom: 24px; }

/* Queue list items (clubQueue.js swaps them for the real queue). Card view
   follows the real cards: a row on small phones, a tall card from 530px. */
#pane-queue .queue-skel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    min-height: 80px;
    border-radius: 12px;
    background: #f7f8fa;
    list-style: none;
    pointer-events: none;
}
#pane-queue .queue-skel .ra-skel-cover { width: 56px; flex: 0 0 56px; border-radius: 8px; }
#pane-queue .queue-skel .ra-skel-cover--poster { width: 44px; flex-basis: 44px; }
#pane-queue .queue-skel .ra-skel-cover--wide { width: 88px; flex-basis: 88px; }
#pane-queue .queue-skel__lines { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
@media (min-width: 530px) {
    #pane-queue:not(.queue-compact) .queue-skel {
        flex-direction: column;
        align-items: stretch;
        padding: 0 0 14px;
        border-radius: 14px;
        overflow: hidden;
    }
    #pane-queue:not(.queue-compact) .queue-skel .ra-skel-cover {
        width: 100%;
        flex-basis: auto;
        border-radius: 0;
    }
    #pane-queue:not(.queue-compact) .queue-skel__lines { padding: 0 12px; }
}
#pane-queue.queue-compact .queue-skel {
    min-height: 0;
    padding: 10px 14px;
    border-radius: 0;
    background: #fff;
    border-bottom: 1px solid #f0f1f4;
}
#pane-queue.queue-compact .queue-skel .ra-skel-cover { width: 40px; flex-basis: 40px; }
#pane-queue.queue-compact .queue-skel .ra-skel-cover--wide { width: 64px; flex-basis: 64px; }

/* Data tab: the real .kpi-row / .chart-grid boxes (data.css) holding shimmer. */
.ra-skel-data .kpi-card { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ra-skel-data .kpi-card .ra-skel-line { width: 55%; }
.ra-skel-data__value { width: 64px; height: 32px; }
.ra-skel-data .chart-card { pointer-events: none; }
.ra-skel-data__ctitle { height: 16px; width: 45%; margin: 4px auto 20px; }
.ra-skel-data__bars {
    display: flex;
    align-items: flex-end;
    gap: 8%;
    height: 170px;
    padding: 0 6% 0 8%;
    border-left: 1px solid #f0f1f4;
    border-bottom: 1px solid #f0f1f4;
}
.ra-skel-data__bars .ra-skel { flex: 1; border-radius: 6px 6px 0 0; }

@media (prefers-reduced-motion: reduce) {
    .ra-skel { animation: none; }
}

/* Archive / Club / Settings tabs (raSkel.archive / .club / .settings). */
.ra-skel-arch__head {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
    gap: 14px 20px; margin-bottom: 18px;
}
.ra-skel-arch__heading { display: flex; align-items: center; gap: 12px; }
.ra-skel-arch__titles { display: flex; flex-direction: column; gap: 8px; width: 160px; }
.ra-skel-arch__title { height: 18px; width: 150px; }
.ra-skel-arch__tray {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 10px;
    background: var(--surface-2, #f3f3f3); border: 1px solid var(--line, #e5e7eb);
}
.ra-skel-arch__search { width: 220px; height: 38px; border-radius: 6px; }
.ra-skel-arch__chip { width: 76px; height: 38px; border-radius: 6px; }

.ra-skel-arow {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 8px; border-radius: 8px;
}
.ra-skel-arow:nth-child(even of .ra-skel-arow) { background: var(--zebra, rgba(0, 0, 0, .03)); }
.ra-skel-arow .ra-skel-cover { width: 48px; flex: 0 0 48px; border-radius: 6px; }
.ra-skel-arow .ra-skel-cover--poster { width: 40px; flex-basis: 40px; }
.ra-skel-arow .ra-skel-cover--wide { width: 80px; flex-basis: 80px; }
.ra-skel-arow__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ra-skel-arow__text .ra-skel-line { width: 55%; }
.ra-skel-arow__text .ra-skel-line--sm { width: 35%; }
.ra-skel-arow__who { width: 110px; height: 11px; flex: none; }
.ra-skel-arow__date { width: 80px; height: 11px; flex: none; }
.ra-skel-arow__score { width: 44px; height: 22px; flex: none; border-radius: 6px; }
@media (max-width: 767.98px) { .ra-skel-arow__who, .ra-skel-arow__date { display: none; } }

.ra-skel-box {
    margin-bottom: 18px; overflow: hidden;
    border: 1px solid var(--line, #e5e7eb); border-radius: var(--r-l, 18px);
    background: var(--surface, #fff);
}
.ra-skel-box--pad { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.ra-skel-box--pad > .ra-skel-arch__title { margin-bottom: 8px; }
.ra-skel-club__info { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.ra-skel-club__img { width: 64px; height: 64px; flex: none; border-radius: 10px; }
.ra-skel-club__fact { width: 110px; height: 40px; flex: none; border-radius: 8px; }
.ra-skel-club__halves { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line, #e5e7eb); }
.ra-skel-club__half { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; }
.ra-skel-club__half + .ra-skel-club__half { border-left: 1px solid var(--line, #e5e7eb); }
.ra-skel-club__half > .ra-skel-line--sm { width: 90px; }
.ra-skel-club__pick { display: flex; gap: 12px; align-items: flex-start; }
.ra-skel-club__pick .ra-skel-cover { width: 72px; flex: 0 0 72px; border-radius: 8px; }
.ra-skel-club__pick .ra-skel-cover--poster { width: 60px; flex-basis: 60px; }
.ra-skel-club__pick .ra-skel-cover--wide { width: 110px; flex-basis: 110px; }
@media (max-width: 767.98px) {
    .ra-skel-club__fact { display: none; }
    .ra-skel-club__halves { grid-template-columns: 1fr; }
    .ra-skel-club__half + .ra-skel-club__half { border-left: 0; border-top: 1px solid var(--line, #e5e7eb); }
}

.ra-skel-set__row { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; }
.ra-skel-set__row .ra-skel-line--sm { width: 120px; }
.ra-skel-set__field { height: 38px; width: min(100%, 460px); border-radius: 6px; }

/* Notification bell dropdown (assets/js/notifications.js): avatar + two
   lines per row, shaped like .notification-item, shown on the first open
   while get-notifications.php loads. */
.ra-skel-notif {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    pointer-events: none;
}
.ra-skel-notif__avatar { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; }
.ra-skel-notif__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ra-skel-notif__text .ra-skel-line { width: 85%; }
.ra-skel-notif:nth-child(2) .ra-skel-line { width: 70%; }
.ra-skel-notif:nth-child(3) .ra-skel-line { width: 78%; }
.ra-skel-notif__text .ra-skel-line--sm { width: 35%; }

/* Members tab (raSkel.members). */
.ra-skel-mem__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ra-skel-mem { display: flex; align-items: center; gap: 12px; }
.ra-skel-mem__ava { flex: none; width: 48px; height: 48px; border-radius: 50%; }
