/**
 * EBootstrapDialog CSS overrides
 * Fix layout shift issues with Bootstrap 5 modals
 */

/* Prevent Bootstrap modal from adding padding-right to body which causes layout shift */
/* Enhanced fix to disable all scrollbar compensation */
body.modal-open {
    padding-right: 0 !important;
    margin-right: 0 !important;
    overflow: visible !important;
}

/* Prevent any padding compensation on fixed elements */
.fixed-top, .fixed-bottom, .sticky-top {
    padding-right: 0 !important;
    margin-right: 0 !important;
}

/* Ensure modals still work properly without the body padding compensation */
.modal {
    overflow-y: auto;
    padding-right: 0 !important;
}

/* Prevent scrollbar width calculation effects */
.modal-backdrop {
    right: 0 !important;
}

/* For nested/stacked modals - ensure proper z-index handling */
/* z-index values increased to appear above fixed navbar (1030) and sidebar (1000) */
.modal.show {
    z-index: 1100 !important;
}

.modal-backdrop.show {
    z-index: 1090 !important;
}

.modal.show + .modal.show {
    z-index: 1110 !important;
}

.modal.show + .modal.show + .modal.show {
    z-index: 1120 !important;
}

/* CSS para modal draggable (aplicado via JS) */
.bd-draggable .modal-header {
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.bd-draggable .modal-header:active {
    cursor: grabbing;
}

/* Responsive adjustments for small screens */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }
}