/* EmrLoadingOverlay: shared page and container loading presentation. */
.emr-loading-host {
    position: relative !important;
}

.emr-loading-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    padding: 12px;
    border: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.88);
    color: #187347;
    cursor: wait;
}

.emr-loading-overlay.emr-loading-page {
    position: fixed;
    z-index: 100000;
    border-radius: 0;
}

.emr-loading-overlay .emr-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    max-width: 100%;
    text-align: center;
}

.emr-loading-overlay .emr-loading-spinner {
    display: block;
    flex: 0 0 36px;
    box-sizing: border-box;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0, 166, 81, 0.18);
    border-top-color: #00a651;
    border-radius: 50%;
    animation: emr-loading-rotate 0.8s linear infinite;
}

.emr-loading-overlay .emr-loading-message {
    margin: 0;
    color: #187347;
    font-family: Kh-Battambang, Battambang, Arial, sans-serif;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.8;
    overflow-wrap: break-word;
}

/* Suppress the legacy DataTables loader only while its shared overlay is active. */
.emr-loading-active .dataTables_processing {
    display: none !important;
}

@keyframes emr-loading-rotate {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .emr-loading-overlay .emr-loading-spinner {
        animation-duration: 2s;
    }
}

@media print {
    .emr-loading-overlay { display: none !important; }
}
