/* modal.css */
/* Alpine: hide until initialized (also in admin header for early paint) */
[x-cloak] {
  display: none !important;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Overlay sits behind the modal content panel */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  z-index: 10000;
  /* Same as .modal wrapper - behind modal-content which is z-index: 10001 */
}

/* Modal content panel always renders on top of the overlay */
.modal-content {
  position: relative;
  background: white;
  border-radius: 0.75rem;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  z-index: 10001;
  /* Must be higher than .modal-overlay */
}

/* Ensure confirm dialog appears above other modals */
#confirm-dialog-modal {
  z-index: 10050 !important;
}

/* Confirm dialog overlay: below its own modal-content */
#confirm-dialog-modal .modal-overlay {
  z-index: 10050 !important;
}

/* Confirm dialog content: above its own overlay */
#confirm-dialog-modal .modal-content {
  z-index: 10052 !important;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #6B7280;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background-color: #F3F4F6;
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

@media (max-width: 640px) {
  .modal-content {
    width: 95%;
    padding: 1.5rem;
  }
}