﻿/********************************************************************************************
    psUtils.DataTable.js.css
    These CSS definitions modify both DataTables v2.0 generated code and our custom DataTables integration code
********************************************************************************************/

div.DataTableWrapper {
    --dt-width: 700px;
    position: relative;
    display: none; /* hide until initialized by the JS */
    /*display: table;*/ /* width determined by content and remain a block */
    /*margin-top: 20px;*/
    min-width: var(--dt-width);
}

    div.DataTableWrapper div.dt-search {
        margin-bottom: 5px;
        float: right;
    }

        div.DataTableWrapper div.dt-search input { /* same selector as used by data tables */
            background-color: white;
        }

    div.DataTableWrapper span.SummaryAction {
        position: absolute;
        top: 0;
        right: 5px;
    }

    div.DataTableWrapper div.TableTitle h3 {
        display: inline-block;
    }

        div.DataTableWrapper div.TableTitle h3 img {
            max-width: 16px;
            max-height: 16px;
            vertical-align: top;
            padding-right: 4px;
        }

        div.DataTableWrapper div.TableTitle h3:nth-child(1) { /* this was nth-child(0) BD 2021-12-25 */
            margin: 10px 0 3px 0;
            padding: 0;
        }

        div.DataTableWrapper div.TableTitle h3:nth-child(2) {
            float: right;
        }

    div.DataTableWrapper div.dt-container {
        margin-bottom: 10px;
    }

    div.DataTableWrapper.WebPanel div.dt-container { /* for web panels where we don't need standard margins */
        margin-bottom: 0;
    }

    div.DataTableWrapper table.psDataTable {
        margin-left: 0;
        width: auto;
    }

        div.DataTableWrapper table.psDataTable caption {
            margin: 0 0 3px 0;
            padding: 0;
            font-style: italic;
            font-weight: normal;
            width: 100%;
            vertical-align: middle;
            text-align: left;
        }

            div.DataTableWrapper table.psDataTable caption > img {
                vertical-align: middle;
            }

            div.DataTableWrapper table.psDataTable caption span.Circle {
                border: 1px solid gray;
                padding: 0 3px;
                border-radius: 3px;
            }

    table.psDataTable thead th {
        padding: 3px;
        text-align: left;
        vertical-align: bottom;
    }

        table.psDataTable thead th.dt-orderable-asc,
        table.psDataTable thead th.dt-orderable-desc {
            padding: 3px 18px 3px 3px;
            text-align: left;
            vertical-align: bottom;
            outline: 1px solid rgba(235,235,235,0.1);
            outline-offset: -1px;
        }

    table.psDataTable.psNoSelect thead th:first-child {
        display: none;
    }

    table.psDataTable tfoot th {
        padding: 10px 10px 0 10px !important;
        font-weight: normal;
    }

    table.psDataTable tbody tr td {
        vertical-align: top;
        padding: 3px 3px 3px 7px;
        border-bottom: 1px solid #ddd;
        user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        -webkit-user-select: none;
    }

        table.psDataTable tbody tr td > input,
        table.psDataTable tbody tr td > select,
        table.psDataTable tbody tr td > textarea {
            background-color: white;
            margin-left: -4px; /* effectively reduce left padding for width of input field's border (1px) and 3px left padding so text content align */
        }

        /********************************************************************************************
          Live Field Inputs: transparent until focused, hover pop, focus highlight
        ********************************************************************************************/

        table.psDataTable tbody tr td > input.psDataTableLiveField {
            background-color: rgba(255, 255, 255, 0.25);
            border: 1px solid rgba(0, 0, 0, 0.1);
            padding: 2px 4px;
            transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.1s ease;
        }

            table.psDataTable tbody tr td > input.psDataTableLiveField:hover { /* slight fill, outline, lift on hover */
                background-color: rgba(255, 255, 255, 0.85);
                border-color: rgba(0, 0, 0, 0.5);
                box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
            }

            table.psDataTable tbody tr td > input.psDataTableLiveField:focus { /* full fill, theme color outline, glow on focus  */
                background-color: white;
                border-color: #1976D2;
                box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.4);
                outline: none;
            }

    table.psDataTable.psNoSelect tbody td:first-child {
        display: none;
    }

    div.DataTableWrapper div.DataTableButtonBar {
        position: relative;
        height: 32px;
        margin-bottom: 5px;
        border-top: 2px solid black;
        padding: 3px 0 2px 32px; /* 32px to keep floating buttons to the right of the Data Table Settings Gear graphic */
        background-color: lightgrey;
        width: calc(100% - 32px); /* BD otherwise it's short the margin-right on the dataTable -- weird */
        max-width: 1024px;
    }

        div.DataTableWrapper div.DataTableButtonBar.NoButtons {
            height: 20px;
        }

        div.DataTableWrapper div.DataTableButtonBar button.DataTableButton {
            float: right;
            margin: 0 5px;
        }

        div.DataTableWrapper div.DataTableButtonBar div.DataTableColumnPicker {
            position: absolute;
            left: 5px;
            top: 5px;
            width: 16px;
            height: 16px;
            background-image: url(../../StaticPSF/Images/32/Gear_32.png);
            background-repeat: no-repeat;
            background-size: 16px;
            cursor: pointer;
        }

    div.DataTableWrapper div.caption {
        max-width: 1024px;
        margin: 0 10px 10px 0;
    }

    div.DataTableWrapper div.error {
        font-weight: bold;
        margin-left: 10px;
    }

        div.DataTableWrapper div.error:before {
            content: 'Error: ';
            font-weight: bold;
            color: red;
        }

        div.DataTableWrapper div.error span {
            color: red;
        }

div.DataTableWrapper.ForceVisible {
    display: table;
}

/********************************************************************************************
    psDataTable specific styling regardless of whether the table is in a DataTableWrapper.
********************************************************************************************/
table.psDataTable {
}

    table.psDataTable.trDblClick tbody tr td:not(:first-child) {
        cursor: zoom-in;
    }

    table.psDataTable thead tr th span.dt-column-order {
        right: 0 !important;
    }

/********************************************************************************************
    DataTables.net START (s/b psTable)

    This is until we add DataTables to the ColorScheme Builder

    NOTE: psUtils.DataTable.css is the css for all psDataTables.
********************************************************************************************/

    table.psDataTable thead tr th {
        background-color: var(--psColorScheme-TH-Head-BG-Color,#1976D2);
        color: var(--psColorScheme-TH-Head-Color,white);
    }

    table.psDataTable tbody tr td {
        background-color: white;
        border-top: 1px solid #808080;
    }

        /* Reset styles for nested tables inside td */
        table.psDataTable tbody tr td table td {
            background-color: inherit;
            border-top: none;
        }

    table.psDataTable tbody tr th {
        background-color: #bbe1f5;
    }

    table.psDataTable tbody tr th { /* change the default to be left aligned not centered */
        text-align: left;
    }

/********************************************************************************************
    Column Picker styling (located in button bar gear icon's dialog)
********************************************************************************************/

    #dlg_EditTableColumns div.dlgColumnPickerInfoContainer {
        margin-top: 2px;
        margin-bottom: 10px;
    }

    #tblColumnPicker {
        margin: 0 10px;
        width: 95%;
    }

    #tblColumnPicker tbody tr:nth-child(odd) { /* Light gray background only on odd rows */
        background-color: #eee;
    }

    #tblColumnPicker tbody tr.ui-sortable-helper { /* Dark gray background + scaling + border only while rows are being dragged */
        background-color: #bbb;
        opacity: 0.85;
        transform: scale(1.03);
        border: 1px dashed #666;
        transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease, border 0.2s ease;
    }

        #tblColumnPicker tbody tr, #tblColumnPicker tbody tr td label {
            cursor: grab;
        }

        #tblColumnPicker tbody tr td {
            padding-bottom: 5px;
            border-width: 3px;
            border-bottom-color: black;
            border-bottom-width: 3px;
            border-bottom-color: black;
        }

table.dataTable thead > tr > th.dt-orderable-asc,
table.dataTable thead > tr > th.dt-orderable-desc,
table.dataTable thead > tr > th.dt-ordering-asc,
table.dataTable thead > tr > th.dt-ordering-desc,
table.dataTable thead > tr > td.dt-orderable-asc,
table.dataTable thead > tr > td.dt-orderable-desc,
table.dataTable thead > tr > td.dt-ordering-asc,
table.dataTable thead > tr > td.dt-ordering-desc {
    padding-right: 15px; /* Override datatables.min.css so that text-align:center/right works on header cells */
}

/********************************************************************************************
    Row Refreshing Indicator
********************************************************************************************/

@keyframes fadePulse {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.4;
    }
}

table.psDataTable tbody tr.RowRefreshing {
    animation: fadePulse 0.4s ease-in-out infinite alternate;
    cursor: progress !important; /* BT 2025-05-15: not working...? */
}

/********************************************************************************************
    DataTables.net END
********************************************************************************************/
