/**
* DevExtreme (widgets/base/dataGrid.less)
* Version: 19.2.6
* Build date: Thu Jan 30 2020
*
* Copyright (c) 2012 - 2020 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
.dx-datagrid-borders {
    > .dx-datagrid-headers,
    > .dx-datagrid-rowsview,
    > .dx-datagrid-total-footer {
        border-left: @datagrid-border;
        border-right: @datagrid-border;
    }

    > .dx-datagrid-rowsview,
    > .dx-datagrid-total-footer {
        border-bottom: @datagrid-border;
    }

    > .dx-datagrid-pager,
    > .dx-datagrid-headers,
    > .dx-datagrid-filter-panel {
        border-top: @datagrid-border;
    }

    > .dx-datagrid-filter-panel {
        border-top-width: 0;
        border-left: @datagrid-border;
        border-right: @datagrid-border;
        border-bottom: @datagrid-border;
    }
}

.dx-sortable-dragging > div > .dx-gridbase-container > .dx-datagrid-rowsview {
    border-color: @datagrid-drag-header-border-color;
}

.dx-datagrid-error-message() {
    background-color: @datagrid-row-error-bg;
    white-space: normal;
    word-wrap: break-word;
}

.dx-datagrid {
    color: @datagrid-base-color;
    background-color: @datagrid-base-background-color;

    .dx-sort-up {
        .dx-icon-sortup;
    }

    .dx-sort-down {
        .dx-icon-sortdown;
    }

    .dx-sort-down,
    .dx-sort-up {
        font-family: inherit;

        &:before {
            font-family: 'DXIcons', sans-serif;
        }
    }

    .dx-datagrid-header-panel {
        .dx-group-panel-item,
        .dx-header-filter {
            outline: none;
        }

        &.dx-state-focused .dx-datagrid-group-panel {
            .dx-group-panel-item:focus,
            .dx-header-filter:focus {
                outline: 2px solid @datagrid-focused-border-color;
                outline-offset: -2px;
            }

            .dx-header-filter:focus {
                outline-offset: 2px;
            }
        }
    }

    .dx-datagrid-headers {
        .dx-header-row > td,
        .dx-header-filter {
            outline: none;
        }

        &.dx-state-focused .dx-header-row {
            td:focus,
            td .dx-header-filter:focus {
                outline: 2px solid @datagrid-focused-border-color;
                outline-offset: 2px;
            }

            td:focus {
                outline-offset: -2px;
            }
        }
    }

    .dx-header-filter {
        position: relative;
        color: @HEADER_FILTER_COLOR;
        .dx-icon-filter;
    }

    .dx-header-filter-empty {
        color: @HEADER_FILTER_COLOR_EMPTY;
    }

    &.dx-filter-menu {
        .dx-menu-item-content .dx-icon {
            .dx-icon-sizing(14px);
        }
    }

    .dx-datagrid-content-fixed {
        .dx-datagrid-table {
            .dx-col-fixed {
                background-color: @datagrid-base-background-color;
            }
        }
    }

    .dx-datagrid-rowsview .dx-data-row,
    .dx-datagrid-rowsview .dx-freespace-row,
    .dx-datagrid-rowsview .dx-virtual-row,
    .dx-datagrid-rowsview .dx-header-row,
    .dx-datagrid-headers .dx-row {
        td.dx-pointer-events-none {
            border-left: 2px solid @datagrid-border-color;
            border-right: 2px solid @datagrid-border-color;

            &.dx-first-cell {
                border-left: none;
            }

            &.dx-last-cell {
                border-right: none;
            }
        }
    }

    .dx-datagrid-rowsview.dx-state-focused .dx-data-row {
        & > td.dx-command-edit > a.dx-link:focus {
            outline: 2px solid @datagrid-focused-border-color;
            outline-offset: 2px;
        }

        &.dx-row-focused > td.dx-command-edit > a.dx-link:focus {
            outline-color: @base-focus-color;
            outline-offset: 0;
        }
    }

    .dx-datagrid-rowsview {
        .dx-datagrid-edit-form {
            background-color: @datagrid-base-background-color;
        }

        .dx-virtual-row > td {
            position: relative;

            &:not(.dx-datagrid-group-space):before {
                display: block;
                height: 100%;
                content: '';
                background-image: @datagrid-text-stub-background-image-path;
                background-repeat: no-repeat repeat;
            }

            &[style*="text-align: right"]:before {
                .flip-horizontally();
            }
        }
    }

    .dx-datagrid-filter-row .dx-filter-range-content {
        color: @datagrid-base-color;
    }

    .dx-error-row {
        td {
            color: @datagrid-row-error-color;
            padding: 0;
        }

        .dx-error-message {
            .dx-datagrid-error-message();
        }
    }

    .dx-column-lines > td {
        &:first-child {
            border-left: none;
        }

        &:last-child {
            border-right: none;
        }
    }

    .dx-command-drag .dx-datagrid-drag-icon {
        .dx-icon-dragvertical;
    }
}

.dx-datagrid-filter-panel {
    color: @datagrid-base-color;
    border-top: @datagrid-border;

    .dx-icon-filter,
    .dx-datagrid-filter-panel-text,
    .dx-datagrid-filter-panel-clear-filter {
        outline: none;
    }

    &.dx-state-focused {
        .dx-icon-filter:focus,
        .dx-datagrid-filter-panel-text:focus,
        .dx-datagrid-filter-panel-clear-filter:focus {
            outline: 2px solid @datagrid-focused-border-color;
            outline-offset: 3px;
        }
    }
}

.dx-datagrid-form-buttons-container {
    float: right;

    .dx-button {
        margin-left: 10px;
        margin-top: 10px;
    }
}

.dx-datagrid-column-chooser {
    .dx-base-typography();
}

.dx-datagrid-adaptive-more {
    cursor: pointer;
    .dx-icon-more;
    .dx-icon-sizing(21px);
}

.dx-datagrid-edit-popup .dx-error-message {
    .dx-datagrid-error-message();

    color: @datagrid-row-error-color;
    margin-bottom: 20px;
}

.dx-rtl {
    .dx-datagrid {
        .dx-datagrid-rowsview .dx-data-row,
        .dx-datagrid-rowsview .dx-freespace-row,
        .dx-datagrid-rowsview .dx-virtual-row,
        .dx-datagrid-rowsview .dx-header-row,
        .dx-datagrid-headers .dx-row {
            td.dx-pointer-events-none {
                border-left: 2px solid @datagrid-border-color;
                border-right: 2px solid @datagrid-border-color;

                &.dx-first-cell {
                    border-right: none;
                }

                &.dx-last-cell {
                    border-left: none;
                }
            }
        }

        .dx-datagrid-rowsview {
            .dx-virtual-row > td {
                &:before {
                    .flip-horizontally();
                }

                &[style*="text-align: left"]:before {
                    transform: scale(1);
                }
            }
        }

        .dx-column-lines > td {
            &:first-child {
                border-right: none;
                border-left: @datagrid-border;
            }

            &:last-child {
                border-left: none;
                border-right: @datagrid-border;
            }
        }
    }

    .dx-datagrid-form-buttons-container {
        float: left;

        .dx-button {
            margin-left: 0;
            margin-right: 10px;
        }
    }
}

.dx-datagrid-cell-updated-animation {
    animation: dx-datagrid-highlight-change 1s;
}

@keyframes dx-datagrid-highlight-change {
    from {
        background-color: fade(@datagrid-base-color, 8%);
    }

    50% {
        background-color: fade(@datagrid-base-color, 8%);
    }
}
