/* ========================================================================
   SLMDForm.css -- DFormLoader dialog layout + chrome
   Split from SLM.css 2026-07-24 to prevent cross-feature CSS corruption.
   ======================================================================== */

.slm-dform-title {
    margin: 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slm-dform-overlay {
    background: var(--slm-dialog-backdrop, rgba(0, 0, 0, 0.32));
}

.slm-dform-dialog {
    background: var(--slm-dialog-surface, #fafbfc);
    border: 1px solid var(--slm-dialog-border, #d1d5db);
    border-radius: var(--slm-dialog-radius, 12px);
    padding: 12px;
}

.slm-dform-center {
    margin-top: 10px;
}

.slm-dform-center.is-disabled {
    color: var(--slm-color-text-muted, #6b6f73);
    font-style: italic;
}

.slm-dform-footer {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.slm-dform-specdebug {
    margin-right: auto;
    color: var(--slm-color-text-muted, #6b6f73);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.slm-dform-group {
    border: 1px solid var(--slm-color-border, #cdd3da);
    border-radius: 6px;
    padding: 10px;
}

.slm-dform-group-title {
    font-weight: 700;
    color: var(--slm-color-text-primary, #2d3136);
    margin: 0 0 8px 0;
}

/* ------------------------------------------------------------------------
   DFormLoader dialog layout classes (avoid inline styles)
   ------------------------------------------------------------------------ */

.slm-dform-overlay--fixed {
    position: fixed;
    inset: 0;
    z-index: 3000;
    overflow: auto;
    background: rgba(0,0,0,0.18);
}

.slm-dform-dialog--fixed {
    position: fixed;
    left: 24px;
    top: 24px;
    z-index: 3001;
    width: 1300px;
    max-width: calc(100vw - 48px);
    min-width: var(--slm-dform-dialog-min-width, 360px);

    /* single container, but allow natural height until user resizes */
    display: flex;
    flex-direction: column;

    height: auto;
    max-height: calc(100vh - 48px);
    min-height: var(--slm-dialog-min-height, 260px);

    background: var(--slm-dialog-surface, #fafbfc);
    border: 1px solid var(--slm-dialog-border, #d1d5db);
    border-radius: var(--slm-dialog-radius, 12px);
    padding: 12px;
    box-shadow: var(--slm-dialog-shadow,
        0 2px 8px rgba(0,0,0,0.08),
        0 8px 24px rgba(0,0,0,0.12),
        0 24px 48px rgba(0,0,0,0.06));

    overflow: visible; /* allow dropdowns/popovers to escape */

    /* we use the JS handle to resize; CSS resize causes native grip + inconsistent sizing */
    resize: none;
}

/* Ensure header title + close button stay on one row */
.slm-dform-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.slm-dform-title--flex {
    flex: 1 1 0;
    min-width: 0;
}

.slm-dform-center--scroll {
    margin-top: 10px;
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

/* When a dropdown is open inside a DForm dialog, keep the dialog body from scrolling.
   This prevents a second scrollbar appearing due to the popup. */
.slm-dform-center--scroll.slm-scrolllock {
    overflow: hidden;
}

.slm-dform-footer {
    flex: 0 0 auto;
}

/* Dropdowns need a stacking context above the dialog chrome when near the bottom. */
.slm-dform-dialog--fixed .slm-dropdown {
    z-index: 4000;
}
