/*
 * public-components.css — Modals, breadcrumbs, pagination (split from public.css).
 * Loaded non-blocking on the homepage only (see HomeController::CSS_DEFER_HOME) to cut
 * render-blocking bytes; all other public views include this in the main bundle.
 */

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 0.875rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  padding: 0 0.5rem;
  color: var(--text-muted);
}

.breadcrumb-item.active { color: var(--text-muted); }

/* List utilities (often paired with breadcrumbs / meta rows) */
.list-inline { list-style: none; padding: 0; margin: 0; }
.list-inline-item { display: inline-block; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none; padding: 0; margin: 0; }
.pagination.justify-content-center { justify-content: center; }
.page-item { }
.page-link { display: block; padding: 0.5rem 0.75rem; color: var(--primary); background: var(--surface); border: 1px solid var(--border); border-radius: 0.375rem; text-decoration: none; }
.page-link:hover { background: var(--light); color: var(--primary); }
.page-item.active .page-link { background: var(--primary); color: var(--primary-foreground, var(--text-on-green, #fff)); border-color: var(--primary); }
.page-item.disabled .page-link { opacity: 0.55; pointer-events: none; cursor: not-allowed; }

.border-bottom { border-bottom: 1px solid var(--border); }

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.modal { display: none; }
.modal[hidden] { display: none !important; }
.modal:not([hidden]) { display: block; }

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-dark);
  transition: opacity 0.15s;
}

.modal-backdrop[hidden] { display: none !important; }

.modal-dialog {
  position: relative;
  width: auto;
  max-width: 500px;
  margin: 1.75rem auto;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title { margin: 0; font-size: 1.25rem; }

.modal-body { padding: 1rem; flex: 1 1 auto; }

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem;
  border-top: 1px solid var(--border);
  gap: 0.5rem;
}

/* Success modal – dark theme (white text, green accent to match dark pages) */
.success-modal--dark .modal-content {
  background-color: var(--surface-dark-soft);
  border: 1px solid var(--border-on-dark-soft);
}
.success-modal--dark .modal-header.success-modal__header {
  background-color: var(--success);
  border-bottom-color: var(--border-on-dark);
}
.success-modal--dark .modal-body.success-modal__body {
  color: var(--text-on-dark);
  border-bottom: 1px solid var(--border-on-dark-soft);
}
.success-modal--dark .success-modal__icon {
  color: var(--success-light);
}
.success-modal--dark .success-modal__title {
  color: var(--color-text-primary);
  font-weight: 600;
}
.success-modal--dark .success-modal__description {
  color: var(--text-on-dark-muted);
}
.success-modal--dark .modal-footer.success-modal__footer {
  background-color: transparent;
  border-top-color: var(--border-on-dark-soft);
}
.success-modal--dark .btn.success-modal__btn {
  background-color: var(--success);
  border-color: var(--success);
  color: var(--text-on-dark);
}
.success-modal--dark .btn.success-modal__btn:hover {
  background-color: var(--success-hover);
  border-color: var(--success-hover);
  color: var(--text-on-dark);
}
