/* WP Project app — htmx UI primitives (modal, lazy table, indicator) */

/* --- modal ---------------------------------------------------------------- */
.wpp-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

/* display:flex only when shown — a bare `display:flex` would override the
   `hidden` attribute and the invisible modal would block the whole page */
.wpp-modal:not([hidden]) {
    display: flex;
}

.wpp-modal[hidden] {
    display: none !important;
}

.wpp-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.wpp-modal__dialog {
    position: relative;
    background: #fff;
    color: #1e1e1e;
    border-radius: 6px;
    max-width: 640px;
    width: calc(100% - 2rem);
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.wpp-modal__close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    border: 0;
    background: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

body.wpp-modal-open {
    overflow: hidden;
}

/* --- lazy table ----------------------------------------------------------- */
.wpp-table {
    width: 100%;
    border-collapse: collapse;
}

.wpp-table th,
.wpp-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.25);
    text-align: left;
}

/* --- htmx loading indicator ----------------------------------------------- */
.wpp-indicator {
    padding: 0.5rem 0.75rem;
    opacity: 0.7;
    font-style: italic;
}

/* htmx toggles .htmx-request on the indicator element */
.htmx-indicator {
    display: none;
}

.htmx-indicator.htmx-request {
    display: block;
}
