/**
 * MobiZora Action Engine CSS - Action Debouncing & Loading States
 */

@keyframes actionEngineSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes actionEnginePulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 0.6; }
}

/* Loading Spinner Element */
.action-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    border: 2px solid currentColor;
    border-right-color: transparent !important;
    border-radius: 50%;
    animation: actionEngineSpin 0.65s linear infinite;
    margin-right: 0.45rem;
    flex-shrink: 0;
}

.action-spinner-only {
    margin-right: 0 !important;
}

/* Loading State on Buttons */
.is-action-loading,
button[data-submitting="true"],
.btn[data-submitting="true"],
.header-action-btn[data-submitting="true"] {
    position: relative !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    opacity: 0.78 !important;
    filter: grayscale(15%) !important;
    transition: opacity 0.15s ease, filter 0.15s ease !important;
    user-select: none !important;
}

/* Ensure icons inside loading buttons don't animate weirdly */
.is-action-loading i:not(.action-spinner):not(.fa-spinner):not(.mdi-spin) {
    display: none !important;
}

/* Prevent double click ghosting */
button:active,
.btn:active,
.header-action-btn:active {
    transform: scale(0.98);
}

/* Disabled and Loading Form Controls */
form[data-submitting="true"] {
    pointer-events: auto;
}

/* SweetAlert loading confirmation safety */
.swal2-confirm.is-action-loading,
.swal2-deny.is-action-loading {
    pointer-events: none !important;
    opacity: 0.75 !important;
}
