/* Styles for static/js/sortable-table.js — the vanilla replacement for the
 * jQuery DataTables 1.10 plugin on dashboard/ pages (#508 follow-up, no-3p7).
 * A 1:1 swap for the css/jquery.dataTables-1.10.18.min.css and
 * css/dataTables.bootstrap4-1.10.18.min.css <link>s those templates carried.
 *
 * Deliberately self-contained plain CSS — neither Bootstrap classes nor tw:*
 * utilities:
 *   - Bootstrap: no-054 (Phase 3) removes Bootstrap CSS and is blocked BY this
 *     bead; styling this widget with .form-control/.pagination would hand it new
 *     work rather than less.
 *   - Tailwind: these class names are applied from JS, which the tw.css JIT
 *     scanner never reads, so every utility would need an @source inline()
 *     safelist entry to survive a rebuild (see the crispy CSSContainer and
 *     Layout-grid precedents in tailwind/input.css).
 * Layout mirrors DataTables' wrapper: length menu left + search right above the
 * table, info left + pagination right below it.
 */

.sortable-table__top,
.sortable-table__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
  margin: 0.5em 0;
}

.sortable-table__length,
.sortable-table__search {
  margin: 0;
}

.sortable-table__search-input,
.sortable-table__length-select {
  margin-left: 0.5em;
  padding: 0.25rem 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  color: inherit;
  background-color: #fff;
}

.sortable-table__search-input:focus,
.sortable-table__length-select:focus,
.sortable-table__th:focus {
  outline: 2px solid #188ec5; /* dashboard accent, cf. raadgiverliste chart */
  outline-offset: 1px;
}

/* Sort affordance. The arrow sits in padding reserved on every sortable th so a
 * column does not reflow when it becomes the sorted one. */
.sortable-table__th {
  cursor: pointer;
  position: relative;
  padding-right: 1.25em;
  user-select: none;
}

.sortable-table__th::after {
  content: "\2195"; /* up-down arrow: sortable, not currently sorted */
  position: absolute;
  right: 0.5em;
  opacity: 0.3;
}

.sortable-table__th--asc::after {
  content: "\2191";
  opacity: 1;
}

.sortable-table__th--desc::after {
  content: "\2193";
  opacity: 1;
}

.sortable-table__empty td {
  text-align: center;
  padding: 1em;
  color: #6c757d;
}

.sortable-table__info {
  color: #6c757d;
}

.sortable-table__pagination {
  display: flex;
  gap: 0.25em;
}

.sortable-table__page {
  padding: 0.25rem 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  background-color: #fff;
  color: #188ec5;
  cursor: pointer;
}

.sortable-table__page:hover:not(:disabled) {
  background-color: #e9ecef;
}

.sortable-table__page:disabled {
  color: #6c757d;
  cursor: default;
  opacity: 0.5;
}
