/** Styles for all themes */
.TcHmi_Controls_Beckhoff_TcHmiDatagrid,
.tchmi-datagrid {
    /* Prevent overflow if the border radius is huge */
    overflow: hidden;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template,
.tchmi-datagrid-template {
    top: 0px;
    left: 0px;
    position: relative;
    width: 100%;
    height: 100%;
    /*background:#eee;*/ /* same as data-tchmi-background-color */
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-border,
.tchmi-datagrid-template-border {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-outer,
.tchmi-datagrid-template-outer {
    width: 100%;
    height: 100%;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-table,
.tchmi-datagrid-template-table {
    padding: 0px;
    margin: 0px;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template table,
.tchmi-datagrid-template table {
    border-collapse: separate;
    border-spacing: 0px;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-header,
.tchmi-datagrid-template-header {
    height: 100%;
    white-space: nowrap;
    /* Browser default is 3 px! */
    border-top-width: 0px;
    border-left-width: 0px;
    border-right-width: 0px;
    border-bottom-width: 0px;
    padding: 0px; /*padding not specify, adapt by header-height*/
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-header-border,
.tchmi-datagrid-template-header-border {
    border-bottom-width: 1px;
    border-bottom-style: solid; /* table border **/
    border-top: 0px;
    border-left: 0px;
    border-right: 0px;
    overflow-x: hidden;
    overflow-y: hidden;
    position: relative;
    display: -webkit-flex;
    display: flex;
}

    .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-header-border > table,
    .tchmi-datagrid-template-header-border > table {
        height: 100%;
        border-spacing: 0px;
    }

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-header-wrapper,
.tchmi-datagrid-template-header-wrapper {
    position: relative;
    height: 100%;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-sort-element,
.tchmi-datagrid-template-sort-element {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
}

    .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-sort-element.sortable,
    .tchmi-datagrid-template-sort-element.sortable {
        cursor: pointer;
    }

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-sort-element-child,
.tchmi-datagrid-template-sort-element-child {
    white-space: pre;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-resize-element,
.tchmi-datagrid-template-resize-element {
    height: 100%;
    position: absolute;
    width: 8px; /* keep in sync with ./TcHmiDatagrid.ts (__resizeElementMinWidth) */
    right: -4px; /* negative half of width */
    z-index: 1;
    top: 0px;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-header.resizable .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-resize-element,
.tchmi-datagrid-template-header.resizable .tchmi-datagrid-template-resize-element {
    cursor: e-resize;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-row,
.tchmi-datagrid-template-row {
    white-space: nowrap;
    line-height: 0;
}

    .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-row.hidden,
    .tchmi-datagrid-template-row.hidden {
        /* Hide a row without unfocusing controls in that row */
        position: absolute;
        left: -100%;
    }

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-row-numbers,
.tchmi-datagrid-template-row-numbers {
    position: relative;
    border-right: 1px solid; /* table border **/
    border-bottom: 1px solid; /* table border **/
    white-space: nowrap;
    text-align: center;
    padding: 0px;
}

th.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-row-numbers,
th.tchmi-datagrid-template-row-numbers {
    cursor: pointer;
}

td.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-row-numbers,
td.tchmi-datagrid-template-row-numbers {
    overflow: hidden;
    line-height: normal;
    display: inline-flex;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-placeholder,
.tchmi-datagrid-template-placeholder {
    height: 100%;
    min-width: 17px; /* width of scrollbar in all major browsers */
    -webkit-flex-grow: 1;
    flex-grow: 1;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-data-scroll,
.tchmi-datagrid-template-data-scroll {
    overflow: auto;
}

    .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-data-scroll table,
    .tchmi-datagrid-template-data-scroll table {
        table-layout: fixed;
    }

    .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-data-scroll tr.focused td:not(.focused)::before,
    .tchmi-datagrid-template-data-scroll tr.focused td:not(.focused)::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 10000px; /* Because Internet Explorer cannot deal with height: 100% on absolute positioned elements when the parent is a table cell. */
        pointer-events: none;
        z-index: 1;
    }

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-cell,
.tchmi-datagrid-template-cell {
    display: inline-flex;
    /* Browser default is 3 px! */
    border-top-width: 0px;
    border-left-width: 0px;
    white-space: pre;
    border-right: 1px solid; /* table border **/
    border-bottom: 1px solid; /* table border **/
    padding: 0;
    height: 100%;
    position: relative;
    overflow: hidden;
    text-overflow: clip;
    cursor: default;
    line-height: normal;
}

    .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-cell.textbox,
    .tchmi-datagrid-template-cell.textbox {
        cursor: text;
    }

    .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-cell img,
    .tchmi-datagrid-template-cell img {
        vertical-align: middle;
        position: relative;
        margin: 0px;
    }

    .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-cell input[type=checkbox],
    .tchmi-datagrid-template-cell input[type=checkbox] {
        /* hide the checkbox itself, whole logic is on the styled label */
        display: none;
    }

        .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-cell input[type=checkbox] + label,
        .tchmi-datagrid-template-cell input[type=checkbox] + label {
            display: inline-block;
            height: 100%;
            width: 100%;
        }

    .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-cell input[type=radio],
    .tchmi-datagrid-template-cell input[type=radio] {
        /* hide the checkbox itself, whole logic is on the styled label */
        display: none;
    }

        .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-cell input[type=radio] + label,
        .tchmi-datagrid-template-cell input[type=radio] + label {
            display: inline-block;
            height: 100%;
            width: 100%;
        }

    .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-cell input[type=text],
    .tchmi-datagrid-template-cell input[type=text],
    .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-cell input[inputmode=decimal],
    .tchmi-datagrid-template-cell input[inputmode=decimal],
    .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-cell input[type=password],
    .tchmi-datagrid-template-cell input[type=password] {
        height: 100%;
        width: 100%;
        box-sizing: border-box;
        border: 0px;
        margin: 0px;
        white-space: nowrap;
        padding: inherit;
    }

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-spinbox-input,
.TcHmi_Controls_Beckhoff_TcHmiDatagrid-date-time-input,
.TcHmi_Controls_Beckhoff_TcHmiDatagrid-timespan-input {
    display: grid;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    border: 0px;
    margin: 0px;
    white-space: nowrap;
    padding: inherit;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-button {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-combobox-template,
.tchmi-datagrid-combobox-template {
    width: 100%;
    height: 100%;
    background-color: transparent;
    border-radius: inherit;
}

/*--------------------------------------------Button--------------------------------------------------------------*/
.TcHmi_Controls_Beckhoff_TcHmiDatagrid-combobox-template-button,
.tchmi-datagrid-combobox-template-button {
    width: 26px;
    height: 100%;
    position: absolute;
    top: 0;
    right: 0;
    background-size: 100%;
    border-top-right-radius: inherit;
    border-bottom-right-radius: inherit;
    pointer-events: none; /* Be transparent to pointer events, so the root element receives them and we dont have to deal with SVGElements not having classList in IE. */
}

/*--------------------------------------------select--------------------------------------------------*/
.TcHmi_Controls_Beckhoff_TcHmiDatagrid-combobox-template-select,
.tchmi-datagrid-combobox-template-select {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 26px);
    height: 100%;
    white-space: nowrap;
    overflow: hidden;
    cursor: default;
    border-top-left-radius: inherit;
    border-bottom-left-radius: inherit;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

/*-----------------------table--------------------------------------*/

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-combobox-template-dropdown,
.tchmi-datagrid-combobox-template-dropdown {
    position: absolute;
    max-width: 60%;
    max-height: 60%;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-combobox-template-dropdown-element,
.tchmi-datagrid-combobox-template-dropdown-element {
    white-space: nowrap;
    cursor: default;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    height: 20px;
}


.TcHmi_Controls_Beckhoff_TcHmiDatagrid.TcHmi_Controls_System_TcHmiControl-operate-disallowed .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-sort-element,
.TcHmi_Controls_Beckhoff_TcHmiDatagrid.TcHmi_Controls_System_TcHmiControl-operate-disallowed .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-resize-element,
.tchmi-datagrid.TcHmi_Controls_System_TcHmiControl-operate-disallowed .tchmi-datagrid-template-sort-element,
.tchmi-datagrid.TcHmi_Controls_System_TcHmiControl-operate-disallowed .tchmi-datagrid-template-resize-element {
    cursor: not-allowed;
}
/* The main use for this control is interaction. So mark when this is not allowed. */
.TcHmi_Controls_Beckhoff_TcHmiDatagrid.TcHmi_Controls_System_TcHmiControl-operate-disallowed .TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-cell::after,
.tchmi-datagrid.tchmi-control-operate-disallowed .tchmi-datagrid-template-cell::after {
    content: '';
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    z-index: 100;
    cursor: not-allowed;
}

.TcHmi_Controls_Beckhoff_TcHmiDatagrid-template-scroll-sentinel-bottom,
.tchmi-datagrid-template-scroll-sentinel-bottom {
    min-height: 10px;
    pointer-events: none;
}
