/**
 * Custom modal styling for Brain Train
 * This ensures modals work consistently across all browsers
 */

/* Modal backdrop styling */
#bt-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  transition: opacity 0.15s linear;
  opacity: 0;
}

#bt-modal-backdrop.show {
  opacity: 0.5;
}

/* Ensure all modals are visible with proper z-index */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1055 !important;
  outline: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.modal.show {
  display: block;
}

/* Override any possibly conflicting style */
.modal .modal-dialog {
  position: relative;
  width: auto;
  margin: 0.5rem;
  transform: translate(0, 0);
  transition: transform 0.3s ease-out;
  z-index: 1060;
}

.modal.show .modal-dialog {
  transform: translate(0, 0) !important;
}

@media (min-width: 576px) {
  .modal .modal-dialog {
    max-width: 500px;
    margin: 1.75rem auto;
  }
  
  .modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
  }
  
  .modal-lg {
    max-width: 800px;
  }
}

/* Modal utility classes */
body.modal-open {
  overflow: hidden;
}