/* ============================================================================
   وثيقة — loading overlay (partial `_Loader.cshtml`).
   Blurs whatever sits behind it (any div or the whole page) and floats the
   white logo + progress bar on top. Neutral scrim keeps the mark legible
   without tinting the blurred UI.
   ========================================================================== */

.wq-loader {
    position: absolute;          /* fills the nearest positioned ancestor */
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(9px);
    backdrop-filter: blur(9px);
    opacity: 1;
    transition: opacity .35s ease;
}

.wq-loader--fixed { position: fixed; }          /* whole-viewport splash */

.wq-loader.is-hidden {                           /* add to fade out, then remove */
    opacity: 0;
    pointer-events: none;
}

/* A REUSED loader (shown/hidden repeatedly, e.g. per upload) toggles `hidden` instead of being removed.
   The author-level `display:flex` above would otherwise beat the UA's `[hidden] { display:none }`. */
.wq-loader[hidden] { display: none; }

/* Compact variant — fills a SMALL panel (the attachments card) instead of the page: the full-size
   140px mark + 230px bar would overflow it. */
.wq-loader--panel { border-radius: 10px; }
.wq-loader--panel .wq-loader__box { gap: 14px; }
.wq-loader--panel .wq-loader__logo { width: 62px; }
.wq-loader--panel .wq-loader__bar { width: 150px; height: 3px; }
.wq-loader--panel .wq-loader__text { font-size: .78rem; }

/* No-logo variant — blurred backdrop + bar + text only, for a surface that already carries the mark
   (the login panel sits under the green logo) or is too short for a 140px image. The box loses the
   logo's 32px gap, and the scrim lightens: with no white mark to lift off the background, the heavy
   centre vignette would just read as a grey smear. */
.wq-loader--nologo .wq-loader__box { gap: 16px; }
.wq-loader--nologo .wq-loader__bar { width: 180px; }
.wq-loader--nologo .wq-loader__text { font-size: .95rem; font-weight: 600; }

.wq-loader--nologo .wq-loader__scrim {
    background: radial-gradient(70% 70% at 50% 50%, rgba(16, 20, 24, .58), rgba(16, 20, 24, .30));
}

/* Neutral centre vignette — darkens the middle just enough for the white
   mark to read, while the edges keep the real UI colours. */
.wq-loader__scrim {
    position: absolute;
    inset: 0;
    background: radial-gradient(58% 58% at 50% 54%, rgba(16, 20, 24, .40), rgba(16, 20, 24, .06));
}

.wq-loader__box {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.wq-loader__logo {
    width: 140px;
    height: auto;
    filter: drop-shadow(0 10px 26px rgba(0, 0, 0, .35));
    animation: wqLoaderPulse 2.2s ease-in-out infinite;
}

.wq-loader__bar {
    width: 230px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .20);
    overflow: hidden;
}

.wq-loader__bar span {
    display: block;
    width: 45%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, .2), #ffffff, rgba(255, 255, 255, .2));
    animation: wqLoaderBar 1.5s ease-in-out infinite;
}

.wq-loader__text {
    color: rgba(255, 255, 255, .9);
    font-size: .9rem;
    letter-spacing: .02em;
}

@keyframes wqLoaderPulse {
    0%, 100% { transform: scale(1);    opacity: .9; }
    50%      { transform: scale(1.05); opacity: 1; }
}

@keyframes wqLoaderBar {
    0%   { transform: translateX(120%); }
    100% { transform: translateX(-260%); }
}

@media (prefers-reduced-motion: reduce) {
    .wq-loader__logo,
    .wq-loader__bar span { animation: none; }
}
