/* ==========================================================================
   DentDesk loader — the one loading indicator used across the system.

   The artwork is public/assets/images/dd-loader.svg (vector redraw of
   design/loader.webp, head recoloured to the system orange #E2551C). It
   animates itself, so every place a loader appears looks and moves the same.

   Markup:
     <span class="dd-loader" role="status" aria-label="Loading"></span>       inline, 1.25em (text, buttons, inputs)
     add dd-loader-sm | -md | -lg | -xl                                       fixed sizes: 1rem / 2rem / 3rem / 4.5rem
     <div class="dd-loader-block">                                            centred panel state, optional caption
       <span class="dd-loader dd-loader-lg" role="status" aria-label="Loading"></span>
       <p>Loading…</p>
     </div>
   ========================================================================== */

.dd-loader {
    display: inline-block;
    flex: none;
    width: 1.25em;
    height: 1.25em;
    vertical-align: -0.28em;
    background: url('/assets/images/dd-loader.svg') center / contain no-repeat;
}

.dd-loader-sm { width: 1rem; height: 1rem; }
.dd-loader-md { width: 2rem; height: 2rem; }
.dd-loader-lg { width: 3rem; height: 3rem; }
.dd-loader-xl { width: 4.5rem; height: 4.5rem; }

.dd-loader-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--body-color-secondary, #6c757d);
}
.dd-loader-block > p { margin: 0; font-size: 0.875rem; }

/* Button busy state (submit guard): the loader takes the place of the button's leading icon, or sits before the label. */
.dd-btn-loader { margin-inline-end: 0.45em; }
.dd-btn-loader.dd-btn-loader-solo { margin-inline-end: 0; }

/* ── Page navigation (src/client/nav/progress.ts) ─────────────────────────── */
#dd-nav-loader {
    position: fixed;
    z-index: 20000;
    left: 50%;
    top: 50%;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 24px rgba(24, 39, 75, 0.16), 0 1px 3px rgba(24, 39, 75, 0.08);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
#dd-nav-loader.on { opacity: 1; transform: none; }
[data-color-theme="dark"] #dd-nav-loader { background: #2c2d33; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); }
#dd-nav-loader > .dd-loader { width: 44px; height: 44px; }
html.dd-nav-slow .content[data-dd-page-root] { opacity: 0.55; transition: opacity 0.2s ease; }
html.dd-navigating,
html.dd-navigating * { cursor: progress; }

/* ── Safety net: template / vendor spinners render as the DentDesk loader ─── */
.spinner-border,
.spinner-grow {
    width: 2rem;
    height: 2rem;
    border: 0 !important;
    border-radius: 0;
    background: url('/assets/images/dd-loader.svg') center / contain no-repeat !important;
    animation: none !important;
    opacity: 1;
    vertical-align: middle;
}
.spinner-border-sm,
.spinner-grow-sm { width: 1.1rem; height: 1.1rem; }

/* Icon-font spinners (Phosphor ph-spinner / ph-circle-notch spun by .spinner or .ph-spin, e.g. the template's card reload). */
i.ph-spinner.spinner,
i.ph-spinner.ph-spin,
i.ph-circle-notch.spinner,
i.ph-circle-notch.ph-spin {
    display: inline-block;
    width: 1.25em;
    height: 1.25em;
    vertical-align: -0.28em;
    background: url('/assets/images/dd-loader.svg') center / contain no-repeat;
    animation: none !important;
}
i.ph-spinner.spinner::before,
i.ph-spinner.ph-spin::before,
i.ph-circle-notch.spinner::before,
i.ph-circle-notch.ph-spin::before { content: none !important; }

/* Public clinic search (public/js/discovery/landing.js): one loader over the skeleton cards while results load. */
.cards:has(> .dd-cards-loader) { position: relative; }
.dd-cards-loader {
    position: absolute;
    left: 50%;
    top: 84px;
    margin: -1.5rem 0 0 -1.5rem;
    pointer-events: none;
}
