.modal {
  display: none;
  /* Hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  /* For centering the spinner or content: */
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease;
  opacity: 0;
}

/* When we add the .show class, use flex layout and fade in */
.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 20px;
  padding-top: 45px; /* Add space for close button */
  border: 1px solid #888;
  width: 80%;
  max-width: 400px;
  max-height: 90vh;
  /* Ensure it fits within the viewport height */
  overflow-y: auto;
  /* Enable vertical scrolling if content exceeds height */
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  text-align: center;
  position: relative;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #6a5acd;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}


.close-button {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  background: none;
  border: none;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-button:hover,
.close-button:focus {
  color: #000;
  text-decoration: none;
}

/* Specific styling for error text */
#errorMessageText {
  color: #b00020;
}