/**
 * User actions modal fixes
 * Ensures user action modals position correctly regardless of cursor position
 */

/* Force all modals to display correctly, overriding any problematic CSS */
.modal.fade {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  outline: 0 !important;
  z-index: 1055 !important; /* Higher than standard modal z-index */
  pointer-events: auto !important; /* Critical fix - ensure the modal receives clicks */
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

/* Fix dialogs to center properly and not depend on cursor position */
.modal-dialog {
  margin: 1.75rem auto !important;
  max-width: 500px !important;
  width: auto !important;
  pointer-events: all !important;
  position: relative !important;
  z-index: 1056 !important;
  transform: none !important; /* Prevent transform issues */
}

/* Make sure all modal content is clickable */
.modal-content {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  pointer-events: auto !important;
  background-color: #fff !important;
  background-clip: padding-box !important;
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
  border-radius: 0.3rem !important;
  outline: 0 !important;
  z-index: 1057 !important;
}

/* Ensure buttons and form elements within modals are clickable */
.modal-body button,
.modal-footer button,
.modal-body a,
.modal-content button.btn-close,
.modal-content input,
.modal-content select,
.modal-content textarea {
  position: relative !important;
  z-index: 1058 !important;
  pointer-events: auto !important;
}

/* Force modals to the top of the stacking context */
#deleteModal-\* { /* Any delete modal */
  z-index: 1060 !important;
}

/* Specifically fix modals on the users page */
body.modal-open {
  overflow: hidden !important;
}

/* Force modal centering regardless of scroll position */
@media (min-width: 576px) {
  .modal-dialog {
    max-width: 500px !important;
    margin: 1.75rem auto !important;
  }
}