/* Modal Fix - Ensure modals are always clickable and on top */

/* Highest z-index for modals */
.modal {
    z-index: 999999 !important;
}

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

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    z-index: 1000000 !important;
    position: relative;
    pointer-events: auto !important;
}

.modal-content {
    pointer-events: auto !important;
    position: relative;
    z-index: 1000001 !important;
}

/* Ensure all interactive elements in modals are clickable */
.modal-content button,
.modal-content .btn,
.modal-content a,
.modal-content input,
.modal-content select,
.modal-content textarea,
.modal-content .btn-close {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative;
    z-index: 1000002 !important;
}

/* Remove any overlays that might block modals */
.modal-backdrop.show {
    opacity: 0.5;
}

/* Ensure modal body is scrollable and clickable */
.modal-body {
    pointer-events: auto !important;
}

/* Fix for any iframe or video overlays */
iframe,
video,
.video-container {
    pointer-events: none !important;
}

.modal iframe,
.modal video,
.modal .video-container {
    pointer-events: auto !important;
}

/* Ensure close button is always clickable */
.modal .btn-close,
.modal [data-bs-dismiss="modal"] {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 1000003 !important;
}

/* SweetAlert2 Modal Fixes */
.swal2-container {
    z-index: 9999999 !important;
    pointer-events: auto !important;
}

.swal2-popup {
    z-index: 10000000 !important;
    pointer-events: auto !important;
}

.swal2-backdrop-show {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.swal2-close {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 10000001 !important;
}

.swal2-actions button {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Ensure SweetAlert backdrop is clickable */
body.swal2-shown > [aria-hidden="true"] {
    pointer-events: none !important;
}

body.swal2-shown .swal2-container {
    pointer-events: auto !important;
}
