/* HTMX support styles (docs/HTMX.md) */

/* Loading indicator: any element with class htmx-indicator shows only while its request runs */
.htmx-indicator { opacity: 0; transition: opacity .15s ease-in; pointer-events: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* A spinner to put inside an indicator: <span class="htmx-indicator bset-spinner"></span> */
.bset-spinner {
    display: inline-block; width: 1em; height: 1em; vertical-align: -.125em;
    border: .15em solid currentColor; border-left-color: transparent; border-radius: 50%;
    animation: bset-spin .7s linear infinite;
}
@keyframes bset-spin { to { transform: rotate(360deg); } }

/* While a region is reloading (hx-indicator="#region" or the target itself) */
.htmx-request.bset-dim, .htmx-request .bset-dim { opacity: .55; transition: opacity .15s; }

/* Buttons disabled by hx-disabled-elt */
[disabled].htmx-request, .htmx-request [disabled] { cursor: progress; }

/* Swap fade (opt-in: add class bset-fade to the swapped element) */
.bset-fade.htmx-added { opacity: 0; }
.bset-fade { opacity: 1; transition: opacity .2s ease-out; }

/* Toasts from hx_toast() */
.bset-toasts {
    position: fixed; z-index: 10050; bottom: 20px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
.bset-toast {
    direction: rtl; font-family: 'Heebo', sans-serif; font-size: 15px; line-height: 1.4;
    padding: 10px 18px; border-radius: 10px; color: #fff; background: #2b2b2b;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .18); pointer-events: auto;
    animation: bset-toast-in .2s ease-out; transition: opacity .35s, transform .35s;
}
.bset-toast--success { background: #1f7a4d; }
.bset-toast--error { background: #b3261e; }
.bset-toast--info { background: #2b2b2b; }
.bset-toast.is-out { opacity: 0; transform: translateY(6px); }
@keyframes bset-toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
    .bset-spinner { animation-duration: 1.6s; }
    .bset-toast, .bset-fade { transition: none; animation: none; }
}
