/* Premium global loading overlay — shown on saves, uploads, and slow navigation/fetch. */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px) saturate(120%);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.app-loader.is-active {
    opacity: 1;
    visibility: visible;
}

.app-loader__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 30px 40px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 70px rgba(2, 6, 23, 0.35);
    min-width: 210px;
    transform: translateY(8px) scale(0.98);
    transition: transform 0.25s ease;
}

.app-loader.is-active .app-loader__panel {
    transform: translateY(0) scale(1);
}

.app-loader__spinner {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #5b3df5, #9333ea, #b68a3e, #5b3df5);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 0);
    animation: app-loader-spin 0.9s linear infinite;
}

@keyframes app-loader-spin {
    to { transform: rotate(360deg); }
}

.app-loader__text {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: 0.02em;
}

.app-loader__dots::after {
    content: '';
    animation: app-loader-dots 1.3s steps(4, end) infinite;
}

@keyframes app-loader-dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%, 100% { content: '...'; }
}

@media (prefers-reduced-motion: reduce) {
    .app-loader__spinner { animation-duration: 1.8s; }
    .app-loader, .app-loader__panel { transition: none; }
}
