/* ============================ SKELETON LOADERS (skeleton-all-20261121) ============================
   One shared shimmer pattern for every loading state on zurvapay.com.
   Theme-aware via html[data-theme] (works in both theme systems on the site:
   the public theme, light-first, and the dashboards, dark-first). Site palette
   (navy / blue) — NOT AceSMS black-and-white. Shapes match the content they
   replace so nothing shifts when the real data lands. Shimmer uses transform
   (compositor-cheap), not background-position. Slow + subtle: 1.9s sweep
   with a pause, same rhythm as the AceSMS reference. */
:root {
    --zp-sk-base: #e9edf4;
    --zp-sk-shine: rgba(255, 255, 255, .75);
    --zp-sk-grid: rgba(10, 15, 30, .06);
    --zp-sk-area: rgba(37, 99, 235, .13);
    --zp-sk-bar: #2563eb;
}
html[data-theme="dark"] {
    --zp-sk-base: rgba(255, 255, 255, .07);
    --zp-sk-shine: rgba(255, 255, 255, .10);
    --zp-sk-grid: rgba(255, 255, 255, .07);
    --zp-sk-area: rgba(79, 139, 255, .15);
    --zp-sk-bar: #4f8bff;
}

.zp-sk { position: relative; overflow: hidden; background: var(--zp-sk-base); border-radius: 6px; display: block; flex: none; }
.zp-sk::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(100deg, transparent 20%, var(--zp-sk-shine) 50%, transparent 80%);
    animation: zp-sk-shimmer 1.9s ease-in-out infinite;
}
@keyframes zp-sk-shimmer { 55%, 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
    .zp-sk::after { animation: none; transform: none; }
    #zp-progress { transition: none; }
}
.zp-sk-line { height: 12px; }
.zp-sk-inline { display: inline-block; vertical-align: middle; }

/* Dashboard chart: 391px = the settled container height — the ApexCharts
   height is 376, but ApexCharts sets min-height: height+15px on the container
   (verified: a constant +15 at every height), so the skeleton matches the
   SETTLED height and the card never shifts when the chart renders. */
.zp-sk-chart { height: 391px; border-radius: 8px; position: relative; overflow: hidden; background: var(--zp-sk-base); }
.zp-sk-chart::before {
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 74px, var(--zp-sk-grid) 74px, var(--zp-sk-grid) 75px);
}
.zp-sk-chart-area {
    position: absolute; inset: 0; background: var(--zp-sk-area);
    clip-path: polygon(0 78%, 12% 68%, 24% 72%, 36% 55%, 48% 60%, 60% 42%, 72% 48%, 84% 30%, 100% 36%, 100% 100%, 0 100%);
}
.zp-sk-chart::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(100deg, transparent 20%, var(--zp-sk-shine) 50%, transparent 80%);
    animation: zp-sk-shimmer 1.9s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .zp-sk-chart::after { animation: none; transform: none; } }

/* Dashboard Insights amounts: the value text stays in the layout (hidden) so
   the card never changes height; the skeleton bar sits over it. Toggled by
   the dashboard scripts with a 200ms delay, so fast responses never flash. */
.money-in, .money-out { position: relative; }
.money-in .zp-sk-amt, .money-out .zp-sk-amt {
    display: none; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: min(190px, 72%); height: 24px; border-radius: 6px;
}
.money-in.zp-sk-loading .zp-amt-val, .money-out.zp-sk-loading .zp-amt-val { visibility: hidden; }
.money-in.zp-sk-loading .zp-sk-amt, .money-out.zp-sk-loading .zp-sk-amt { display: block; }

/* Nav progress bar: 2px top bar for full-page navigations (this is an MPA —
   no SPA transitions exist, so this is the only in-between-pages feedback). */
#zp-progress {
    position: fixed; top: 0; left: 0; height: 2px; width: 0;
    background: var(--zp-sk-bar); z-index: 99999; opacity: 0;
    transition: width .45s ease, opacity .3s ease; pointer-events: none;
}
#zp-progress.on { opacity: 1; }
