/* ============================================================
   shared-modals.css — canonical modal / pop-up / confirmation
   dialog chrome, ALL roles, ALL pages.

   Every modal in the app (logout confirm, delete confirm,
   feedback pop-ups, queue-status modals, wizard step modals,
   etc.) is built from the same two building blocks:
     .modal-overlay  — full-screen dim/blur backdrop
     .modal-card     — the centered white card itself
   plus the shared .confirm-modal__* parts for simple Yes/No
   confirmations (sticker, message, submessage, actions row).

   Loaded via includes/header.php on every page, AFTER each
   page's own stylesheet, so any page-specific modal styling
   collapses onto this one shared look automatically.
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--overlay);
  backdrop-filter: blur(2px);
}
.modal-overlay[hidden] { display: none; }

.modal-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  font-family: 'Inter', sans-serif;
  animation: sharedModalFadeUp 0.2s ease both;
}
.modal-card--confirm { max-width: 380px; }
.modal-card--confirm .modal-card__body { padding: .4rem 1.75rem 1.75rem !important; }

.modal-card__header {
  padding: 1.25rem 1.5rem 0.5rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.modal-card__header h2 { font-size: 1.1rem; margin: 0; }
.modal-card__body { padding: 1.5rem; }

/* Canonical close ("x") button — same look on every modal, every page,
   whether it sits inside .modal-card__header or floats absolutely
   (as on .modal-card--svc-need below). Loaded after each page's own
   CSS, so this is the version that actually wins. */
.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-mid, #9ca3af);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition, 0.15s ease), color var(--transition, 0.15s ease);
}
.modal-close:hover { color: var(--ink, #1f1f1f); background: var(--mist, #f3f4f6); }

.confirm-modal__sticker-wrap {
  width: 140px;
  height: 140px;
  margin: 1.25rem auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-modal__sticker {
  width: 140px;
  height: 140px;
  object-fit: contain;
  display: block;
}
.confirm-modal__message {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
  margin: 0 0 .4rem;
}
.confirm-modal__submessage {
  font-size: .9rem;
  color: var(--ink-mid);
  text-align: center;
  line-height: 1.5;
  margin: 0 0 1.25rem;
}
.modal-card--confirm .form-actions {
  border-top: 0;
  padding-top: 0;
  justify-content: center;
  display: flex;
  gap: 0.6rem;
}

@keyframes sharedModalFadeUp {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ============================================================
   "Service Currently Unavailable" modal — used on the student
   dashboard, student queue wizard, and parent dashboard.
   Centered icon-led layout (same family as .confirm-modal__*)
   so all three surfaces look and feel identical.
   ============================================================ */
.modal-card--svc-need {
  max-width: 400px;
  position: relative;
}
.svc-need-modal__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 1;
}
.svc-need-modal__body {
  padding: 1.75rem 1.6rem 1.5rem;
  text-align: center;
}
.svc-need-modal__icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--warning-light, #f3e3d1);
  color: var(--warning, #b3791a);
}
.svc-need-modal__icon-wrap svg { width: 28px; height: 28px; }
.svc-need-modal__title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 0.4rem;
}
.svc-need-modal__message {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.5;
  margin: 0 0 1.1rem;
}
.svc-need-modal__body .form-group { text-align: left; }
.svc-need-modal__hint {
  text-align: left;
  margin-top: 0.6rem;
}
.svc-need-modal__actions {
  border-top: 0;
  padding-top: 0.3rem;
  justify-content: center;
  display: flex;
  gap: 0.6rem;
}
.svc-need-modal__actions .btn { min-width: 130px; }


/* Hide header X close buttons — modals already have Cancel in form-actions */
.modal-close,
.modal-card__header .modal-close,
button.modal-close {
  display: none !important;
}
