/* ── Page Bootstrap Loader ─────────────────────────────────────────────────
   Visible immediately from raw HTML before React mounts.
   Dismissed by MutationObserver in index_string once React populates the DOM.
   Brand palette sourced from src/shared/theme.py (cantasks-primary / secondary).
─────────────────────────────────────────────────────────────────────────── */

/* Indeterminate shimmer sweep across the progress track */
@keyframes pl-shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

/* Gentle pulse on the brand wordmark while waiting */
@keyframes pl-brand-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.65; }
}

/* Fade-out + scale-down triggered by .pl-done class */
@keyframes pl-fadeout {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1.03);
        pointer-events: none;
    }
}

/* ── Overlay ─────────────────────────────────────────────────────────────── */

#page-loader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    z-index: 9999;
    gap: 18px;
}

/* ── Brand wordmark ──────────────────────────────────────────────────────── */

#page-loader .pl-brand {
    font-family: 'Martel Sans', Roboto, sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffb347;           /* cantasks-primary[6] */
    letter-spacing: 0.05em;
    animation: pl-brand-pulse 2s ease-in-out infinite;
}

/* ── Progress track ──────────────────────────────────────────────────────── */

#page-loader .pl-track {
    width: 240px;
    height: 4px;
    border-radius: 2px;
    background: #ffefdd;      /* cantasks-primary[1] — very muted tint */
    overflow: hidden;
    position: relative;
}

/* Shimmer bar: primary → teal accent → primary */
#page-loader .pl-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 45%;
    border-radius: 2px;
    background: linear-gradient(
        90deg,
        #ffb347 0%,            /* cantasks-primary[6]   */
        #80c6ff 50%,           /* cantasks-secondary[5] */
        #ffb347 100%
    );
    box-shadow: 0 0 8px rgba(255, 179, 71, 0.45);
    animation: pl-shimmer 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── Status label ────────────────────────────────────────────────────────── */

#page-loader .pl-label {
    font-family: 'Martel Sans', Roboto, sans-serif;
    font-size: 0.7rem;
    color: #ffe1bc;            /* cantasks-primary[2] */
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ── Dismiss transition (.pl-done added by JS) ───────────────────────────── */

#page-loader.pl-done {
    animation: pl-fadeout 0.4s ease forwards;
}
