/*!
 * WAC ERP UI layer — loaders & polish on top of DashLite.
 */

/* ---- Top progress bar (all AJAX + page navigations) ---- */
#wac-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 10000;
    background: linear-gradient(90deg, #1b84ff, #0a5edb);
    box-shadow: 0 0 10px rgba(27, 132, 255, .55);
    border-radius: 0 3px 3px 0;
    opacity: 0;
    pointer-events: none;
    transition: width .25s ease, opacity .4s ease;
}
#wac-progress.is-active { opacity: 1; }

/* ---- Dot-pulse loader ---- */
.wac-loader {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.wac-loader span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1b84ff, #0a5edb);
    animation: wac-pulse 1s infinite ease-in-out;
}
.wac-loader span:nth-child(2) { animation-delay: .15s; }
.wac-loader span:nth-child(3) { animation-delay: .3s; }
.wac-loader--sm span { width: 7px; height: 7px; }
@keyframes wac-pulse {
    0%, 80%, 100% { transform: scale(.55); opacity: .35; }
    40% { transform: scale(1); opacity: 1; }
}
.wac-loader-label {
    margin-top: .65rem;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8094ae;
}

/* ---- DataTables processing: full-cover frosted overlay ---- */
div.dataTables_processing {
    position: absolute !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .72) !important;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 4px;
    z-index: 5;
    color: transparent; /* hide any stray default text */
}
div.dataTables_processing > div:last-child { display: none; } /* DT2 default spinner */
body.dark-mode div.dataTables_processing,
body[theme="dark"] div.dataTables_processing {
    background: rgba(20, 24, 43, .72) !important;
}

/* Give the table wrapper a positioning context + minimum height so the
   overlay covers something visible even on the very first load. */
div.dataTables_wrapper { position: relative; }
div.dataTables_wrapper .dataTable { min-height: 120px; }

/* ---- Buttons while submitting ---- */
.wac-spin { vertical-align: -0.15em; }

/* ---- Full-content overlay (opt-in via JS wacOverlay()) ---- */
.wac-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .72);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    border-radius: 4px;
    z-index: 20;
}
body.dark-mode .wac-overlay,
body[theme="dark"] .wac-overlay {
    background: rgba(20, 24, 43, .72);
}
