/* =====================================================================
   appTable — the row that is working
   ---------------------------------------------------------------------
   Pairs with assets/js/apptable-row-refresh.js, which puts `at-row-busy`
   on the ONE row a request is about and takes it off when the answer
   arrives. Everything here is scoped to that row: its cells blur and stop
   taking clicks (its action buttons included) and a loader sits in the
   middle of it. The toolbar, the other rows and the rest of the page stay
   live — a row updating is not a reason to freeze a screen.

   The spinner is a `::before` on the <tr> rather than an element, so
   nothing is inserted into the table for DataTables to trip over and
   there is nothing to clean up: the class goes, the loader goes.

   Two things it depends on:
     - `position: relative` on a <tr>, which every current browser honours
       (verified in-browser here, not assumed);
     - the pseudo-element being ABSOLUTE, which keeps it out of flow so it
       never becomes an anonymous table-cell (or, on the mobile list where
       the row is a grid, a grid item).

   The blur is on the CELLS, not the row, so the loader — a child of the
   row, not of a cell — stays sharp on top of it.
   ===================================================================== */

.dt-container table.dataTable > tbody > tr.at-row-busy {
    position: relative;
}

.dt-container table.dataTable > tbody > tr.at-row-busy > td,
.dt-container table.dataTable > tbody > tr.at-row-busy > th {
    /* the row is unreadable on purpose: it is about to say something else */
    filter: blur(1.7px);
    opacity: 0.5;

    /* THE row's buttons stop responding — and only this row's */
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;

    transition: opacity 0.14s ease;
}

.dt-container table.dataTable > tbody > tr.at-row-busy::before {
    content: "";

    position: absolute;
    top: 50%;

    /* the middle of what you can SEE: apptable-row-refresh.js sets this to
       the centre of the scroll box whenever the row is wider than it, and
       leaves it unset (so, the middle of the row) when it is not */
    left: var(--at-busy-left, 50%);

    z-index: 6;

    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;

    border: 2px solid var(--ios26-hairline-strong, rgba(17, 24, 39, 0.12));
    border-top-color: var(--ios26-accent, #5b73e8);
    border-radius: 50%;

    animation: at-row-spin 0.7s linear infinite;
    pointer-events: none;
}

@keyframes at-row-spin {
    to {
        transform: rotate(360deg);
    }
}

/* the frozen action column paints its own opaque background over the row,
   so it has to dim with the rest of it */
.dt-container table.dataTable > tbody > tr.at-row-busy > td:last-child {
    opacity: 0.5;
}

/* ------------------------------------------------------- dark theme */

body.color-1E202D .dt-container table.dataTable > tbody > tr.at-row-busy::before {
    border-color: rgba(255, 255, 255, 0.18);
    border-top-color: var(--ios26-accent, #6690F4);
}

/* --------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {

    .dt-container table.dataTable > tbody > tr.at-row-busy > td,
    .dt-container table.dataTable > tbody > tr.at-row-busy > th {
        transition: none;
    }

    /* the spin is the message — slow it rather than stop it */
    .dt-container table.dataTable > tbody > tr.at-row-busy::before {
        animation-duration: 1.6s;
    }
}
