/*
 * RAANMAT LIVE-28 — Batch 548
 * Global Action / Report Loading Feedback — Full Page Interaction Lock
 * Shared by Admin, User and Franchise panels.
 *
 * Contract:
 * - Every accepted user action immediately locks page interaction.
 * - A neutral-slate full-page overlay keeps roughly 86% of the page visually visible while making the busy state unmistakable.
 * - The background stays clearly visible but is visibly muted and cannot be clicked, scrolled or re-submitted.
 * - A compact status pill remains exactly centered in the viewport above the overlay.
 * - The overlay remains until the action completes or the destination page replaces it.
 */

html.raanmat-global-action-busy,
body.raanmat-global-action-busy {
    cursor: progress;
}

.raanmat-global-action-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147482998;
    display: block;
    background: rgba(15, 23, 42, 0.14);
    cursor: wait;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    touch-action: none;
    overscroll-behavior: contain;
    transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1), visibility 180ms linear;
}

.raanmat-global-action-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.raanmat-global-action-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 2147483000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 36px;
    max-width: min(88vw, 380px);
    padding: 8px 14px;
    border: 1px solid rgba(15, 51, 94, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.985);
    color: #123b67;
    box-shadow: 0 10px 28px rgba(19, 55, 91, 0.18);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, calc(-50% + 6px)) scale(0.965);
    will-change: opacity, transform;
    transition: opacity 200ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
                visibility 200ms linear;
}

.raanmat-global-action-loader.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.raanmat-global-action-loader__spinner {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    border: 2px solid rgba(18, 59, 103, 0.18);
    border-top-color: #1769aa;
    border-radius: 50%;
    animation: raanmat-global-action-spin 0.7s linear infinite;
}

.raanmat-global-action-loader__text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.raanmat-action-locked,
.raanmat-action-locked[aria-disabled="true"] {
    cursor: wait;
    opacity: 0.78;
    pointer-events: none;
}

form[data-raanmat-action-busy="1"] {
    cursor: progress;
}

@keyframes raanmat-global-action-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    .raanmat-global-action-loader {
        min-height: 34px;
        max-width: min(92vw, 340px);
        padding: 7px 12px;
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .raanmat-global-action-overlay,
    .raanmat-global-action-loader {
        transition: none;
    }

    .raanmat-global-action-loader__spinner {
        animation-duration: 1.4s;
    }
}
