@import '@angular/material/theming';

@mixin es-grid-theme($theme) {
    $primary: map-get($theme, primary);
    $accent: map-get($theme, accent);
    $warn: map-get($theme, warn);
    $background: map-get($theme, background);
    $foreground: map-get($theme, foreground);
    $isDark: map-get($theme, is-dark);

    .ngx-datatable.material {
        background-color: mat-color($background, card);

        .datatable-header,
        .datatable-header .datatable-header-cell
        {
            //background-color: transparent;    // to je default
            background-color: mat-color($background, background);
            color: mat-color($foreground, secondary-text);

            .resize-handle {
                border-right: solid 1px mat-color($foreground, divider);
            }
        }

        .datatable-header {
            border-top: 1px solid mat-color($foreground, divider);
            border-bottom: 1px solid mat-color($foreground, divider);
        }

        .datatable-body {

            .datatable-body-row {
                &:hover,
                &:hover .datatable-row-group {
                    background-color: mat-color($background, hover);
                }

                .datatable-body-cell {
                    color: mat-color($foreground, text);
                }
            }

            .datatable-row-detail {
                background-color: mat-color($background, hover);
            }

            .mask-row-group-scrollbar,
            .row-group-cell {
                //background-color: #6d6d6d !important;
                //color: white !important;

                //realtime barvy
                @if $isDark {
                    color: white;
                } @else {
                    color: black;
                }
                //color: mat-color($accent, 700);
                background-color: mat-color($background, disabled-button);
            }

        }

        .datatable-footer,
        .datatable-footer a
        {
            color: mat-color($foreground, secondary-text);

            .datatable-pager li.active a {
                background-color: mat-color($background, focused-button);   //unselected-chip/hover
            }
        }

        .datatable-footer {
            border-top: 1px solid mat-color($foreground, divider);
        }

        //border-right: solid 1px mat-color($foreground, divider);
    }


    .ngx-datatable.material.single-selection {
        .datatable-body-row.active,
        .datatable-body-row.active:hover,
        .datatable-body-row.active .datatable-row-group,
        .datatable-body-row.active:hover .datatable-row-group
        {
            background-color: mat-color($accent, 100) !important;
            .datatable-body-cell {
                color: mat-contrast($accent, 100);
            }
        }
    }

    .template-menu-container {
        .template-menu {
            border-top: 1px solid mat-color($foreground, divider);
        }
    }

    .dynamic-grid-container {
        .grid-add-button {
            background-color: mat-color($accent);
            color: mat-contrast($accent, 900);
        }
    }




}
