/* stylelint-disable selector-max-type, selector-max-compound-selectors */

.VueTables {
    flex: 1;
    display: flex;
    flex-direction: column;

    .row {
        flex: 0 0 auto;
    }

    .col-md-12 {
        display: flex;

        > div,
        > nav {
            flex: 1;
        }

        > .pull-left {
            flex: 0 0 auto;
        }

        > .pull-right {
            flex: 1;
        }
    }

    label {
        display: none;
    }

    &__search-wrapper {
        flex: 1;
    }

    &__search-field input {
        min-width: 180px;
    }

    &__search-limit {
        flex: 1;
    }

    .table-responsive {
        flex: 1;
        margin-top: 1rem;
    }

    &__table {
        width: 100%;
        border-collapse: collapse;
    }

    th {
        background: $bg-color-table-th;
        text-align: left;
        white-space: nowrap;

        &:focus {
            outline: 0;
        }
    }

    &__sortable {
        padding: 0.78rem 0.35rem;
        cursor: pointer;
    }

    &__limit {
        margin-left: 1rem;
    }

    &__actions {
        width: 6rem;
        min-width: 6rem;
        text-align: left;
    }

    &__sort-icon {
        margin-left: 0.5rem;
        float: none;
        opacity: 0.5;
    }

    td {
        padding: 0.45rem;
        border-bottom: 1px solid $bg-color-body;
        background: $bg-color-table-td;
        color: $text-base-color;

        &:focus {
            outline: 0;
        }
    }

    &__row {
        &--warning > td {
            background-color: rgba($text-warning-color, 0.25);
        }
    }

    &__no-results td {
        padding: 0.78rem;
        color: $text-light-color;
        font-style: italic;
        text-align: center;
    }

    &__columns-dropdown-wrapper {
        position: relative;
        display: none;
        margin-left: 1rem;
        text-align: right;

        .dropdown-toggle {
            padding: 0.78rem;
            border: 1px solid $bg-color-button-default;
            background: none;
            color: $help-text-color;

            &:hover {
                border-color: $text-base-color;
                color: $text-base-color;
            }
        }
    }

    &__columns-dropdown {
        .dropdown-menu {
            position: absolute;
            z-index: 1;
            right: 0;
            margin: 0;
            padding: 10px;
            background-color: $bg-color-main-header;
            box-shadow: 3px 3px 14px rgba(0, 0, 0, 0.4);

            li {
                list-style: none;

                a {
                    display: flex;
                }

                // - Hide the 'actions' column in list
                &:last-child {
                    display: none;
                }
            }
        }
    }

    @media (min-width: $screen-desktop) {
        &__columns-dropdown-wrapper {
            display: block;
        }
    }
}
