/* Dialog styles */
.modal-dialog {
  padding: 0;
  border: none;
  border-radius: 0.75rem;
  background-color: transparent;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  color: #e2e8f0;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Specific styling for Game Settings and How to Play modals to ensure proper vertical centering */
#settings-modal, #info-modal, #investment-modal {
  /* Ensure modals are only visible when opened via showModal() */
  top: 30%;
  transform: translate(-50%, -20%) !important;
}

/* Only apply these styles when the dialog is open */
#settings-modal:not([open]), #info-modal:not([open]) {
  display: none;
}

#settings-modal .modal-content, #info-modal .modal-content {
  max-height: 80vh;
  margin: 0 auto;
}

.modal-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
}

/* Keep the existing modal content styles */
.modal-dialog .modal-content {
  background-color: #2d3748;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  border-top: 4px solid #0066b3; /* Capitec blue */
}

.modal-dialog .modal-header {
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.modal-dialog .modal-body {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.modal-dialog .modal-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  flex-shrink: 0;
}

.modal-dialog .modal-close-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #a0aec0;
  cursor: pointer;
  padding: 0.25rem;
  z-index: 10;
}

.modal-dialog .modal-close-button:hover {
  color: #e2e8f0;
}

.modal-dialog .modal-close-button svg {
  width: 1.5rem;
  height: 1.5rem;
}