/* 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(17, 24, 39, 0.55);
  backdrop-filter: blur(2px);
  cursor: pointer;
  z-index: 10000;
  /* Same as .modal wrapper - behind modal-content which is z-index: 10001 */
}

/* Modal content panel — TailAdmin-style card */
.modal-content {
  position: relative;
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 1rem;
  padding: 1.5rem 1.5rem;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.08),
    0px 4px 6px -2px rgba(16, 24, 40, 0.03);
  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: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.modal-close:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.modal-content h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #111827;
}

@media (max-width: 640px) {
  .modal-content {
    width: 95%;
    padding: 1.5rem;
  }
}