/* Override Dash's default loading indicator — hidden, no generic rectangle */
._dash-loading { display: none !important; }


/* Style empty dcc.Graph containers as skeletons */
.dash-graph:not(:has(.plot-container)) {
    min-height: 380px;
    background: linear-gradient(135deg, var(--dash-card) 0%, rgba(255,255,255,0.02) 100%);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.dash-graph:not(:has(.plot-container))::after {
    content: "";
    position: absolute;
    top: 0; left: -150%; width: 150%; height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 50%, transparent 100%);
    animation: skeletonSweep 1.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

@keyframes skeletonSweep {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Full-page Loading Overlay (shown from first paint until first data callback) --- */
#page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 100%);
    overflow: hidden;
}

#page-loading-overlay::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
    animation: skeletonSweep 1.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
