/* ============================================================
   ANTI-FOUC PAGE COVER
   Loaded as the VERY FIRST CSS file to prevent blinking.
   ============================================================ */

/* Cover overlay */
#page-cover {
    position: fixed;
    inset: 0;
    z-index: 9999997;
    background: rgba(241, 245, 249, 0.35);
    backdrop-filter: blur(8px) saturate(1.2);
    -webkit-backdrop-filter: blur(8px) saturate(1.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: all;
}

html.dark #page-cover {
    background: rgba(12, 17, 31, 0.4);
}

html.theme-error #page-cover {
    background: rgba(18, 19, 24, 0.42);
}

html.theme-1c #page-cover {
    background: rgba(230, 230, 230, 0.35);
}

/* Fade-out state */
#page-cover.page-cover--hiding {
    opacity: 0;
    pointer-events: none;
}

/* ── Glass card — must contrast against the dark/light overlay ── */
#page-cover-card {
    position: relative;
    width: 128px;
    height: 128px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(249, 115, 22, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

html.dark #page-cover-card {
    /* Lighter than the dark overlay so it stands out */
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(249, 115, 22, 0.35);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(249, 115, 22, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ── Spinner ─────────────────────────────────────────────── */
#page-cover-spinner {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.pcr-track {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(249, 115, 22, 0.18);
    box-sizing: border-box;
}

.pcr-fill {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #f97316;
    border-right-color: rgba(249, 115, 22, 0.45);
    box-sizing: border-box;
    animation: pcr-spin 0.75s linear infinite;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}

@keyframes pcr-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pcr-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #f97316;
    border-radius: 50%;
    margin-top: -4px;
    margin-left: -4px;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.8);
    animation: pcr-pulse 0.75s ease-in-out infinite alternate;
}

@keyframes pcr-pulse {
    from { transform: scale(0.7); opacity: 0.6; }
    to   { transform: scale(1.2); opacity: 1; }
}

/* ── Label ───────────────────────────────────────────────── */
.pcr-label {
    display: block;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #f97316;
    text-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
    animation: pcr-blink 1.4s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes pcr-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}
