/**
 * LPD DataTable Component Styles
 *
 * Framework-scoped overrides for tables inside .lpd-framework-table containers.
 * This class is added to the outermost wrapper in wrapper.view.php, ensuring
 * these rules ONLY apply to framework-rendered tables and never affect legacy
 * Dashboard::printTable() output.
 *
 * Loaded after main.css and DataTables CDN CSS in footer.php.
 */

/* ==========================================================================
   SORT INDICATOR ICONS
   Legacy main.css uses background shorthand on .table-with-header th which
   resets background-repeat/position/size, causing sort icon tiling.
   ========================================================================== */

.lpd-framework-table .table-with-header table thead .sorting,
.lpd-framework-table .table-with-header table thead .sorting_asc,
.lpd-framework-table .table-with-header table thead .sorting_desc {
    background-repeat: no-repeat !important;
    background-position: center right !important;
}

/* Hide DataTables 1.13.7 pseudo-element sort arrows (Unicode triangles).
   We use custom background-image icons from main.css instead. Without this,
   both the pseudo-element arrows AND background-image icons render together. */
.lpd-framework-table .table-with-header table thead .sorting::before,
.lpd-framework-table .table-with-header table thead .sorting::after,
.lpd-framework-table .table-with-header table thead .sorting_asc::before,
.lpd-framework-table .table-with-header table thead .sorting_asc::after,
.lpd-framework-table .table-with-header table thead .sorting_desc::before,
.lpd-framework-table .table-with-header table thead .sorting_desc::after {
    display: none !important;
}

/* ==========================================================================
   HEADER ROW
   Legacy .table-with-header sets background shorthand on th. Override with
   background-color so sort icon background-image is preserved.
   ========================================================================== */

.lpd-framework-table .table-with-header table tr > th {
    background-color: #2f4698 !important;
    background-repeat: no-repeat !important;
    background-position: center right !important;
}

/* ==========================================================================
   DATA ROWS
   Legacy .table-with-header sets background shorthand on td. Override with
   background-color to prevent resetting any future cell background-images.
   ========================================================================== */

.lpd-framework-table .table-with-header table tr > td {
    background-color: transparent !important;
}

/* ==========================================================================
   ROW HIGHLIGHT
   The transparent !important above overrides main.css row-selected yellow.
   Re-apply with matching specificity inside the framework scope.
   ========================================================================== */

.lpd-framework-table .table-with-header table tr.row-selected > td {
    background-color: #ffe676 !important;
    border-right-color: #ffd61a;
}
.lpd-framework-table .table-with-header table tr.row-selected:hover > td {
    background-color: #ffd61a !important;
}
