.modal.show {
  opacity: 1;
}

.modal::before {
  content: "";
  position: fixed;
  inset: 0; 
  background: rgba(0, 0, 0, 0.15); 
  z-index: -1; 
  opacity: 1;
  transition: opacity 0.15s ease;
}

/* Modal base */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1055;
  display: none;
  width: 100%;
  height: 100%;
  /* overflow-y: auto; */
  outline: 0;
}

/* Modal dialog shell */
.modal-dialog {
  position: relative;
  width: auto;
  margin: 0.5rem;
  pointer-events: none;
  transition: transform 0.3s ease-out;
  transform: translate(0, -50px);
}

/* Show state */
.modal.show .modal-dialog {
  transform: none;
}

/* Modal static (when trying to close without backdrop dismiss) */
.modal.modal-static .modal-dialog {
  transform: scale(1.02);
}

/* Modal scrollable */
.modal-dialog-scrollable {
  height: calc(100% - 1rem);
}

.modal-dialog-scrollable .modal-content {
  max-height: 100%;
}

/* .modal-dialog-scrollable .modal-body {
  overflow-y: auto;
} */

/* Vertically centered modal */
.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 1rem);
}

/* Modal content */
.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  outline: 0;
}

/* Modal header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

/* Modal title */
.modal-title {
  margin-bottom: 0;
  line-height: 1.5;
}

/* Close button inside header */
.modal-header .btn-close {
  padding: 0.5rem;
  margin: -0.5rem -0.5rem -0.5rem auto;
}

/* Modal body */
.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 70vh;
}

/* Modal footer */
.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem;
  background-color: #f1f1f1;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

.modal-footer > * {
  margin: 0.25rem;
}

/* Modal backdrop */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  opacity: 0.5;
}

/* Responsive modal sizes */
@media (min-width: 576px) {
  .modal-dialog {
    max-width: 500px;
    margin-right: auto;
    margin-left: auto;
  }
  .modal-sm {
    max-width: 300px;
  }
}

@media (min-width: 992px) {
  .modal-lg,
  .modal-xl {
    max-width: 800px;
  }
}

@media (min-width: 1200px) {
  .modal-xl {
    max-width: 1140px;
  }
}

/* Fullscreen modal support */
@media (max-width: 576px) {
  .modal-fullscreen-sm-down {
    width: 100vw;
    max-width: none;
    height: 100%;
    margin: 0;
  }

  .modal-fullscreen-sm-down .modal-content {
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .modal-fullscreen-sm-down .modal-header,
  .modal-fullscreen-sm-down .modal-footer {
    border-radius: 0;
  }

  .modal-fullscreen-sm-down .modal-body {
    overflow-y: auto;
  }
}
