/*
 * Non-blocking dialog - replaces native alert() / confirm() / prompt().
 *
 * Existing modals here use z-index 1000 (.modal, .v2-modal, .edit-modal). This
 * sits at 2000 so a confirmation raised FROM inside one of those still lands on
 * top rather than behind it - which is exactly when a confirm gets used.
 *
 * @author Sander Tamaela
 * @created 2026-08-17
 * @modified 2026-08-17
 */

.ofo-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ofo-dialog {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  max-width: 480px;
  width: 100%;
  padding: 22px 24px 18px;
  /* The message can be an API error of any length; keep the dialog on screen. */
  max-height: 80vh;
  overflow-y: auto;
}

.ofo-dialog-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900, #111827);
}

.ofo-dialog-message {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--gray-700, #374151);
  /* Server messages arrive with real newlines; honour them without needing <br>,
     and break long unbroken strings (URLs, task ids) instead of overflowing. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ofo-dialog-input {
  width: 100%;
  padding: 8px 10px;
  margin: 0 0 18px;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.ofo-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Visible focus ring matters more than usual here: the OK button is focused on
   open by design, so the user must be able to SEE that Enter will confirm. */
.ofo-dialog-actions .btn:focus-visible {
  outline: 2px solid var(--blue-500, #2563eb);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .ofo-dialog-actions { flex-direction: column-reverse; }
  .ofo-dialog-actions .btn { width: 100%; }
}
