/*
Template Name: SwaMind - Admin & Dashboard Template
Author: Themesbrand
Website: https://themesbrand.com/
Contact: support@themesbrand.com
File: Custom Css File
*/

/*
 * Scrollable modals (React + Velzon): edit student/teacher put <form> after .modal-header,
 * so the flex column on .modal-content must size the <form> and scroll .modal-body inside it.
 */
.modal-dialog-scrollable.modal-dialog {
  max-height: calc(100vh - 1rem);
  max-height: calc(100dvh - 1rem);
}

.modal-dialog-scrollable .modal-content {
  height: min(90vh, calc(100dvh - 2rem));
  max-height: min(90vh, calc(100dvh - 2rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-dialog-scrollable .modal-content > .modal-header,
.modal-dialog-scrollable .modal-content > .modal-footer {
  flex-shrink: 0;
}

/* <form> as flex column: header + scrollable body + footer (edit modals) or body + footer (add modals) */
.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

/* Form is the only child of .modal-content (edit student / edit teacher) */
.modal-dialog-scrollable .modal-content > form:only-child {
  flex: 1 1 0;
  max-height: 100%;
}

.modal-dialog-scrollable .modal-content > form > .modal-footer {
  flex-shrink: 0;
}

/* Scrollable region: either direct .modal-body or body inside form */
.modal-dialog-scrollable .modal-content > .modal-body,
.modal-dialog-scrollable .modal-content > form > .modal-body {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}
