/* Hand-rolled Blazor Bootstrap modals: .modal.fade.show.d-block
   Default: shrink to content; cap height at viewport and scroll body when needed.
   .modal-dialog-fit-content remains an alias for the same sizing rules. */

.modal.fade.show.d-block {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    overflow-y: auto;
}

.modal.fade.show.d-block .modal-dialog {
    margin: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: min(100%, calc(100vw - 2rem));
    height: auto;
    max-height: min(90vh, calc(100vh - 2rem));
}

.modal.fade.show.d-block .modal-dialog.modal-dialog-fit-content {
    width: auto;
    max-width: min(100%, calc(100vw - 2rem));
    height: auto;
    max-height: min(90vh, calc(100vh - 2rem));
}

.modal.fade.show.d-block .modal-content {
    flex: 0 1 auto;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal.fade.show.d-block .modal-dialog.modal-dialog-fit-content .modal-content {
    flex: 0 1 auto;
    overflow: hidden;
}

.modal.fade.show.d-block .modal-dialog.modal-dialog-fit-content .modal-body {
    flex: 0 1 auto;
    overflow-y: auto;
}

.modal.fade.show.d-block .modal-header,
.modal.fade.show.d-block .modal-footer {
    flex-shrink: 0;
}

.modal.fade.show.d-block .modal-body {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* Short confirmations (edition sale recovery, etc.) — content height, not 90vh */
.modal.fade.show.d-block.modal-compact .modal-dialog,
.modal.fade.show.d-block.modal-compact .modal-dialog.modal-dialog-centered {
    display: block;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    max-width: min(420px, 100%);
}

.modal.fade.show.d-block.modal-compact .modal-content {
    flex: 0 0 auto !important;
    overflow: visible;
    display: block;
}

.modal.fade.show.d-block.modal-compact .modal-body {
    flex: 0 0 auto !important;
    overflow: visible;
}

/* Content-sized confirm — avoids Bootstrap modal + clubivate 90vh rules entirely */
.clubivate-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
}

.clubivate-confirm-dialog {
    width: min(420px, 100%);
    background: var(--bs-body-bg, #fff);
    border-radius: var(--bs-border-radius-lg, 0.5rem);
    border: var(--bs-border-width, 1px) solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.175));
    box-shadow: var(--bs-box-shadow-sm, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075));
}

.clubivate-confirm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: var(--bs-border-width, 1px) solid var(--bs-border-color, #dee2e6);
}

.clubivate-confirm-header .modal-title {
    margin-bottom: 0;
    font-size: 1.25rem;
}

.clubivate-confirm-body {
    padding: 1rem;
}

.clubivate-confirm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: var(--bs-border-width, 1px) solid var(--bs-border-color, #dee2e6);
}
