/* ============================================================
   connection-ui.css — connection banner, loading status row,
   skeleton shimmer, cached pill. Scoped to #socialPage.
   ============================================================ */

/* ---- Spinner (pure CSS ring) ---- */
#socialPage .cui-spin {
    width: 16px; height: 16px; flex: 0 0 auto;
    border: 2px solid rgba(255,255,255,.22);
    border-top-color: #5865f2;
    border-radius: 50%;
    display: inline-block; vertical-align: middle;
    animation: cui-rot 0.8s linear infinite;
}
@keyframes cui-rot { to { transform: rotate(360deg); } }

/* ---- Top connection banner (thin, full width, overlays the top) ---- */
#socialPage .cui-banner {
    position: absolute; top: 0; left: 0; right: 0; z-index: 9000;
    display: flex; align-items: center; justify-content: center; gap: 9px;
    min-height: 34px; padding: 6px 14px;
    font-size: 13px; font-weight: 600; letter-spacing: .1px;
    background: #2b2b2b; color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.4);
    transition: background .2s ease, opacity .25s ease;
    /* The banner is a STATUS strip, not a modal: it must never swallow
       clicks meant for the top bars beneath it (app back button, header
       actions, …). Only its own buttons are interactive. */
    pointer-events: none;
}
#socialPage .cui-banner .cui-btn, #socialPage .cui-banner .cui-spin, #socialPage .cui-banner .cui-txt, #socialPage .cui-banner .cui-ico {
    pointer-events: auto;
}
#socialPage .cui-banner .cui-spin { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
#socialPage .cui-banner.cui-warn    { background: #f0b232; color: #2b1d02; }
#socialPage .cui-banner.cui-warn .cui-spin { border-color: rgba(43,29,2,.35); border-top-color: #2b1d02; }
#socialPage .cui-banner.cui-fail    { background: #f23f43; color: #fff; }
#socialPage .cui-banner.cui-fail .cui-spin { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
#socialPage .cui-banner.cui-ok      { background: #23a559; color: #fff; }
#socialPage .cui-banner.cui-offline { background: #f0b232; color: #2b1d02; }
#socialPage .cui-banner.cui-hidden  { opacity: 0; pointer-events: none; transform: translateY(-4px); }
#socialPage .cui-banner .cui-ico    { font-size: 14px; line-height: 1; }
#socialPage .cui-banner .cui-ico.ok { font-weight: 800; }
#socialPage .cui-btn {
    margin-left: 6px; padding: 4px 12px; min-height: 26px;
    border: 1px solid rgba(255,255,255,.5); border-radius: 6px;
    background: rgba(255,255,255,.14); color: inherit;
    font-size: 12px; font-weight: 700; cursor: pointer;
}
#socialPage .cui-btn:hover { background: rgba(255,255,255,.28); }

/* ---- "Showing cached content" pill (top-right) ---- */
#socialPage .cui-cached-pill {
    position: absolute; top: 8px; right: 10px; z-index: 8999;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
    background: rgba(240,178,50,.16); color: #f0b232;
    border: 1px solid rgba(240,178,50,.5);
    backdrop-filter: blur(4px);
    transition: opacity .25s ease;
}
#socialPage .cui-cached-pill.cui-hidden { opacity: 0; pointer-events: none; }

/* ---- Welcome-screen status row (spinner + copy + tips + retry) ---- */
#socialPage .cui-status {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 8px 2px;
}
#socialPage .cui-status .cui-spin { width: 20px; height: 20px; border-width: 2.5px; }
#socialPage .cui-status-txt { font-size: 13.5px; font-weight: 600; color: var(--win-text, #e8e8e8); }
#socialPage .cui-status.cui-fail .cui-status-txt { color: #ff8f92; }
#socialPage .cui-tips {
    width: 100%;
    font-size: 12px; font-style: italic; opacity: .7;
    color: var(--win-text-2, #b6b6b6);
    transition: opacity .18s ease;
}
#socialPage .cui-tips.cui-fade { opacity: 0; }
#socialPage .cui-status .cui-btn {
    margin-left: 0; padding: 5px 14px; min-height: 28px;
    border: 1px solid rgba(255,255,255,.35); border-radius: 7px;
    background: rgba(255,255,255,.1); color: var(--win-text, #fff);
    font-size: 12.5px; font-weight: 700; cursor: pointer;
}
#socialPage .cui-status .cui-btn:hover { background: rgba(255,255,255,.2); }

/* ---- Skeleton shimmer ---- */
#socialPage .cui-skel { display: flex; flex-direction: column; gap: 10px; padding: 10px 8px; }
#socialPage .cui-sk-line,
#socialPage .cui-sk-circle,
#socialPage .cui-sk-bar {
    background: linear-gradient(90deg,
        rgba(255,255,255,.05) 25%,
        rgba(255,255,255,.12) 37%,
        rgba(255,255,255,.05) 63%);
    background-size: 400% 100%;
    animation: cui-shimmer 1.2s ease-in-out infinite;
    border-radius: 6px;
}
@keyframes cui-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
/* rail: 4 circles (48px) */
#socialPage .cui-rail { gap: 12px; align-items: center; padding: 6px 4px; }
#socialPage .cui-rail .cui-sk-circle {
    width: 40px; height: 40px; border-radius: 50%;
}
/* bars: 5 lines of varying width (set inline) */
#socialPage .cui-bars .cui-sk-line { height: 12px; }
/* people: circle + bar rows */
#socialPage .cui-people .cui-sk-row { display: flex; align-items: center; gap: 10px; }
#socialPage .cui-people .cui-sk-circle { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; }
#socialPage .cui-people .cui-sk-bar { height: 12px; flex: 1 1 auto; }

/* Respect prefers-reduced-motion: keep the placeholders, stop the shimmer. */
@media (prefers-reduced-motion: reduce) {
    #socialPage .cui-sk-line,
    #socialPage .cui-sk-circle,
    #socialPage .cui-sk-bar { animation: none; background: rgba(255,255,255,.08); }
    #socialPage .cui-spin { animation-duration: 1.6s; }
}
