/**
 * DataTables overrides - loads after dataTables.bootstrap4.css
 * Fixes sorting arrow display and Bootstrap 4 compatibility
 */

/* Sorting arrows - use Unicode, avoid icon font issues (XL glyphs, etc.) */
table.dataTable thead .sorting:before,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_desc:before,
table.dataTable thead .sorting_asc_disabled:before,
table.dataTable thead .sorting_desc_disabled:before {
  content: none !important;
  display: none !important;
}

table.dataTable thead .sorting_asc:after {
  content: "\2191" !important;
  margin-left: 10px;
  opacity: 1 !important;
  right: 0.5em;
}

table.dataTable thead .sorting_desc:after {
  content: "\2193" !important;
  margin-left: 10px;
  opacity: 1 !important;
  right: 0.5em;
}

table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc_disabled:after,
table.dataTable thead .sorting_desc_disabled:after {
  content: "\2195" !important;
  margin-left: 10px;
  opacity: 0.3;
  right: 0.5em;
  color: rgba(50, 50, 50, 0.5);
}

/* dt-bootstrap4: ensure Buttons area doesn't break layout */
.dt-bootstrap4 .dt-buttons {
  margin-bottom: 0.5em;
}

.dt-bootstrap4 .dt-buttons .btn {
  margin-right: 0.25rem;
}

/* Page length select - Bootstrap 4 custom-select */
div.dataTables_wrapper div.dataTables_length select {
  padding: 0.375rem 1.5rem 0.375rem 0.75rem;
}

/* Pagination - remove extra arrows/icons, prevent duplicates and oversized elements */
.dataTables_wrapper .dataTables_paginate .paginate_button::before,
.dataTables_wrapper .dataTables_paginate .paginate_button::after,
.dataTables_wrapper .dataTables_paginate .page-link::before,
.dataTables_wrapper .dataTables_paginate .page-link::after {
  content: none !important;
  display: none !important;
}

/* Ensure pagination uses normal size (not pagination-lg) */
.dataTables_wrapper .dataTables_paginate ul.pagination {
  font-size: 0.875rem;
}

.dataTables_wrapper .dataTables_paginate .page-link {
  padding: 0.375rem 0.75rem;
  font-size: inherit;
}

/* Laravel pagination (nav) - remove extra arrows, prevent oversized prev/next */
nav .pagination .page-item .page-link::before,
nav .pagination .page-item .page-link::after,
nav .pagination .page-item::before,
nav .pagination .page-item::after {
  content: none !important;
  display: none !important;
}

nav .pagination {
  font-size: 0.875rem;
}

nav .pagination .page-link {
  padding: 0.375rem 0.75rem;
  font-size: inherit;
}
