@import "main/mixins";

.grid-container {
    display: block;
    width: 100%;

    .grid-top {
        display: grid;
        grid-template-rows: auto auto auto;
        row-gap: 8px;
        align-items: center;

        .datagrid-filters {
            display: grid;
            grid-template-columns: auto auto;
            column-gap: 10px;

            .grid-right {
                justify-self: end;
                display: grid;
                grid-template-columns: auto auto;
                column-gap: 10px;
                align-items: end;
            }

            .dropdown-filters {
                display: inline-block;

                &.per-page {
                    .control-group {
                        label {
                            margin-bottom: 7px;
                            margin-right: 10px;
                            flex: auto;
                        }

                        .control {
                            width: 100%;
                            margin: 0;
                            flex: 1;
                        }
                    }
                }
            }
        }
    }

    .datagrid-filters {
        display: grid;
        grid-template-columns: auto auto;
        column-gap: 10px;
        align-items: end;

        .filter-right {
            justify-self: end;
            display: grid;
            grid-template-columns: auto auto;
            column-gap: 10px;
            align-items: end;

            .control-group {
                .control {
                    margin-bottom: 0px;
                }
            }
        }
    }
}

.filtered-tags {
    display: inline-flex;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.search-filter {
    border-radius: 3px;
    height: 36px;
    max-width: 300px;

    .control {
        font-size: 15px;
        border: 1px solid $control-border-color;
        border-right: none;
        border-top-left-radius: 3px;
        border-bottom-left-radius: 3px;
        height: 36px;
        width: calc(100% - 36px);
        padding-left: 10px;
        -webkit-appearance: none;
    }

    &:hover {
        box-shadow: 0px 0px 0px 1px $selection-color;
    }

    .contorl:focus {
        border-color: $brand-color;
    }

    .icon-wrapper {
        border: 1px solid $control-border-color;
        border-radius: 3px;
        border-top-left-radius: 0px;
        border-bottom-left-radius: 0px;
        height: 36px;
        width: 36px;
        padding: 5px;
        float: right;
    }
}

.grid-dropdown-header {
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    height: 36px;
    width: 100%;
    min-width: 200px;
    border: 1px solid $control-border-color;
    border-radius: 3px;
    background-color: $white-color;
    padding: 0px 5px 0px 5px;

    .arrow-icon-down {
        float: right;
    }
}

.dropdown-list.dropdown-container {
    padding: 15px;
    width: 100%;
    top: 43px;

    ul {
        li {
            .control-group {
                margin-bottom: 15px;
                display: block;

                .control {
                    margin-bottom: 15px;
                }
            }

        }
    }

    .apply-filter {
        padding: 10px;
        width: 100%;
    }
}

.filter-advance {
    display: flex;
    justify-content: space-between;

    .datagrid-count {
        margin-bottom: 10px;
        display: inline-block;
    }
}

.filter-tag {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    height: 40px;
    border-radius: 2px;
    margin-right: 20px;

    .wrapper {
        margin-left: 4px;
        padding: 5px 10px 5px 16px;
        display: flex;
        flex-direction: row;
        align-items: center;
        background: #E7E7E7;
        border: 1px solid #E7E7E7;
        font-size: 14px;
        height: 40px;
        color: #000311;
        letter-spacing: -0.22px;
        @include border-radius(24px);

        .icon.cross-icon {
            margin-left: 10px;
            cursor: pointer;
        }

        &:hover {
            background: $white-color;
            border: 1px solid #E7E7E7;
        }
    }
}

.rtl {
    .search-filter {

        .control {
            padding-right: 10px;
            border-left: 0;
            border-right: 1px solid #C7C7C7;
            border-top-right-radius: 3px;
            border-bottom-right-radius: 3px;
            border-top-left-radius: 0;
            border-bottom-left-radius: 0;
        }

        .icon-wrapper {
            float: left;
            border-top-right-radius: 0px;
            border-bottom-right-radius: 0px;
            border-top-left-radius: 3px;
            border-bottom-left-radius: 3px;
        }

        &:hover {
            box-shadow: 0px 0px 0px 1px $selection-color;
        }
    }

    .dropdown-filters {
        display: inline-block;


        &.per-page {
            margin-left: 10px;
            margin-right: 10px;
        }

    }

    .filtered-tags {
        .filter-tag {

            .wrapper,
            .cross-icon {
                margin-right: 10px;
                margin-left: 0;
            }
        }
    }
}


@media only screen and (max-width: 1040px) {
    .grid-container {

        .grid-top {
            .datagrid-filters {
                grid-template-columns: 100%;
                row-gap: 0px;

                .search-filter {
                    max-width: 100% !important;

                }

                .filter-left {
                    display: grid;
                    grid-template-columns: 49.5% 49%;
                    column-gap: 5px;
                }

                .filter-right {
                    display: grid;
                    grid-template-columns: 49.5% 49%;
                    column-gap: 5px;
                    width: 100%;
                }
            }
        }
    }

    .grid-dropdown-header {
        min-width: 122px;
    }
}