/*============================
  67.datatables
============================*/

@use "../variables" as *;
@use "../utils/mixins" as *;

table.dataTable {
    margin: 0 !important;
    border: 1px solid $border-color;
    border-bottom: none;
}
.dataTables_scrollHeadInner{
    width: 100% !important;
}
table.dataTable>thead .sorting:after, 
table.dataTable>thead .sorting_asc:after,
table.dataTable>thead .sorting_desc:after,
table.dataTable>thead .sorting_asc_disabled:after, 
table.dataTable>thead .sorting_desc_disabled:after {
    right: 8px !important;
    content: "\f175" !important;
    font-family: 'Font Awesome 5 Free';
    bottom: 12px !important;
    color: $gray-500 !important;
    font-size: 10px !important;
    opacity: 1 !important;
    position: absolute;
    font-weight: $font-weight-semibold;
    line-height: 1px !important;
    display: none !important;
}
table.dataTable>thead .sorting:before, 
table.dataTable>thead .sorting_asc:before, 
table.dataTable>thead .sorting_desc:before, 
table.dataTable>thead .sorting_asc_disabled:before, 
table.dataTable>thead .sorting_desc_disabled:before {
    right: 14px !important;
    content: "\f176" !important;
    font-family: 'Font Awesome 5 Free';
    top: 50% !important;
    color: $gray-500 !important;
    font-size: 10px !important;
    opacity: 1 !important;
    position: absolute;
    font-weight: $font-weight-semibold;
    line-height: 1px !important;
    display: none !important;
}
.dataTables_paginate .paging_numbers {
    float: right;
}
.dataTables_info {
    font-size: 14px;
    color: $gray-500;
    font-weight: $font-weight-medium;
    @include respond-below(md) {
        font-size: 12px;
        text-align: center;
        padding-bottom: 0 !important;
    }
}
.custom-select {
    min-width: 80px;
}
.dataTables_paginate .pagination{
    justify-content: end;
    -webkit-justify-content: end;
    -ms-flex-pack: end;
    li{
        margin: 0 4px;
        a {
            background: $white;
            border-color: $border-color;
            border-radius: 5px !important;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: $gray-900;
            font-size: 14px;
            padding: 0;
            box-shadow: 0px 1px 1px 0px #0000000D;
            &:hover{
                background: $light;
                border-color: $border-color;
                color: $gray-900;
            }
        }
        &.active a.page-link{
            background: $primary;
            border-color: $primary;
            color: $white;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        &.previous.disabled, &.prev {
            width: auto;
            margin: 0 4px 0 0;
            a {
                background: $white;
                width: 32px;
                height: 32px;
                padding: 0;
                font-size: 15px;
                box-shadow: 0px 1px 1px 0px #0000000D;
                &:hover {
                    color: $success;
                }
            }
        }
        &.previous.disabled, &.next.disabled {
            a {
                color: $gray-200;
            }
        }
        &.next.disabled, &.next {
            width: auto;
            margin: 0 0 0 4px;
            a {
                background: $white;
                width: 32px;
                height: 32px;
                padding: 0;
                font-size: 15px;
                box-shadow: 0px 1px 1px 0px #0000000D;

                &:hover {
                    color: $primary;
                }
            }
        }
    }
    @include respond-below(md) {
        justify-content: center !important;
        -webkit-justify-content: center !important;
        -ms-flex-pack: center !important;
    }
}
.dataTables_length {
    padding: 20px 0 0;
    float: left;
    @include respond-below(md) {
        text-align: center;
        padding-bottom: 0;
        float: none;
    }
    label {
        @include respond-below(md) {
            justify-content: center !important;
            -webkit-justify-content: center !important;
            -ms-flex-pack: center !important;
        }
    }
}
.dataTables_paginate {
    margin-top: 20px !important;
}
.dataTables_length {
    label {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        color: $gray-500;
        font-size: 13px;  
        .form-select {
            width: 61px;
            border: 1px solid $border-color;
            border-radius: 5px;
            color: $gray-700;
            margin: 0 8px;
            background-position: right 5px center;
            padding-right: 15px;
            line-height: normal;
        }
    }
}
.datatable-length {
    @include respond-below(md) {
        text-align: center;
    }

}
div.dataTables_wrapper {
    div.dataTables_info {
        padding: 15px 0;
        display: none;
    }
    div.dataTables_length {
        label {
            font-weight: $font-weight-medium;   
        }
    }
    div.dataTables_length {
        select {
            padding: 6px 10px;
            width: 51px;
            font-size: 13px;
            background-color: $white;
        }
    }
}
table.dataTable thead>tr>th.no-sort.sorting_asc:before {
    display: none;
}
table.dataTable thead>tr>th.no-sort.sorting_asc::after {
    display: none;
}
table.dataTable thead>tr>th.no-sort.sorting:before {
    display: none;
}
table.dataTable thead>tr>th.no-sort.sorting::after {
    display: none;
}
.custom-table .table-responsive {
    border: 1px solid $gray-200;
    border-radius: 6px;
}
table.table.dataTable {
    & > tbody {
        > tr {
            border-color: $border-color;
            td {
                color: $body-color;                
                border-bottom: 1px solid $border-color;
                padding: 12px 24px 12px 16px;
            }
        } 
    }
    & > thead > tr {
        border-color: $border-color;
            th {
                color: $gray-900;
                font-size: 14px;
                font-weight: $font-weight-semibold;
                padding: 12px 28px 12px 16px;
            }
    }
}
.dataTables_filter {
    margin-bottom: 20px;
    
}
#select-all {
     ~ .checkmarks {
        top: -7px;
    }
}
#select-all2 {
    ~ .checkmarks {
       top: -7px;
   }
}
#select-all3 {
    ~ .checkmarks {
       top: -7px;
   }
}
.custom-datatable-filter {
    [class*=col-md] {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }
    .dataTables_filter {
        margin: 15px 0;
        @include respond-below(md) {
            text-align: center !important;
        }
    }
    .dataTables_paginate {
        margin: 24px 0 0 !important;
        @include respond-below(md) {
            text-align: center !important;
        }
    }
    table {
        thead {
            tr {
                th {
                    &:first-child {
                        border-top-left-radius: 5px;
                    }
                    &:last-child {
                        border-top-right-radius: 5px;
                    }
                }
            }
        }
        tbody {
            tr {
                &:last-child {
                    border: 0;
                    td {
                        border: 0;
                        &:first-child {
                            border-bottom-left-radius: 5px;
                        }
                        &:last-child {
                            border-bottom-right-radius: 5px;
                        }
                    }
                }
            }
        }
    }
}
.no-datatable_length {
    .dataTables_length {
        display: none;
    }
    .dataTables_filter {
        display: none;
    }
    .dataTables_info {
        display: none;
    }
    .dataTables_paginate {
        display: none;
    }
}
.datatable-info {
    .dataTables_info  {
        display: none !important;
        &:first-child {
            display: block !important;
        }
    }
}
.datatable-length {
    .dataTables_length {
        display: none !important;
        &:first-child {
            display: block !important;
        }
    }
}
.datatable-paginate {
    .dataTables_paginate {
        display: none !important;
        &:first-child {
            display: block !important;
        }  
    }
}
.dataTables_scroll{
    border: 1px solid $border-color;
    table.table {
        &.dataTable > tbody > tr {
            &:last-child {
                td {
                    border: 0;
                }
            }
        }
    }
}
.table-search {
    margin-bottom: 20px;
    @include respond-below(sm){
        width: 100%;
    }
    .dataTables_filter {
        margin-bottom: 0;
    }
    .search-input{
        position: relative;
        @include respond-below(sm) {
            width: 100%;
            margin-right: 0;
        }    
        input {
            height: 32px;
            width: 210px;
            font-size: 12px;
            color: $gray-900;
            background: $white;
            border: 1px solid $border-color;
            border-radius: 5px;
            &:focus-within {
                border-color: $primary;
            }
            &:focus-visible {
                outline: 0;
            }
            @include respond-below(xl) {
                width: 220px;
            }
            @include respond-below(lg) {
                width: 200px;
            }
            @include respond-below(sm) {
                width: 100%;
            }
        }
        .btn-searchset {
            @include rounded(50px);
            position: absolute;
            top: 50%;
            @include transform(translateY(-50%));
            left: 12px;
            border: 0;
            color: $gray-500;
        }
    }
}
table {
    td {
        a {
            color: $gray-900;
            &:hover {
                color: $primary;
            }
        }
    }
}
.table-search {
    input {
        height: 32px;
        width: 210px;
        font-size: 12px;
        color: $gray-900;
        background: $white;
        @include respond-below(xl) {
            width: 220px;
        }
        @include respond-below(lg) {
            width: 200px;
        }
        @include respond-below(sm) {
            width: 100%;
        }
    }
}
.datatable-top, .datatable-info {
    display: none;
}
.datatable-bottom {
    padding: 0;
}
.datatable-selector {
    margin-left: 0;
}
.datatable-pagination-list button {
    border: 1px solid $border-color;   
}