@import 'node_modules/argo-ui/src/styles/config';
@import 'node_modules/foundation-sites/scss/util/util';

.filter {
    background-color: white;
    padding: 10px;
    box-shadow: 1px 1px 2px 0 rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    margin-bottom: 1em;

    &__header {
        font-size: 13px;
        color: $argo-color-gray-5;
        font-weight: 500;
        margin-bottom: 0.5em;
        height: 28px;
        position: relative;
    }

    &__collapse {
        position: absolute;
        right: 0;
        cursor: pointer;
        margin-left: auto;
        color: $argo-color-gray-7;
        font-size: 20px;
    }

    &__error {
        color: $argo-failed-color-dark;

        &__retry {
            color: $argo-running-color;
            cursor: pointer;
        }
    }

    &__loading {
        color: $argo-running-color;
    }

    &__error,
    &__loading {
        text-align: center;
    }

    &__item {
        height: 2em;
        padding: 0 5px;
        border-radius: 5px;
        display: flex;
        align-items: center;
        background-color: white;
        transition: background-color 200ms ease;
        margin: 0.25em 0;
        cursor: pointer;
        flex-wrap: nowrap;

        &__label {
            text-overflow: ellipsis;
            flex-grow: 0;
            overflow: hidden;
            white-space: nowrap;
        }

        &--selected {
            background-color: $argo-color-teal-3;
            color: $argo-color-teal-8;
            font-weight: 500;
        }
    }
}

.filters-group {
    &__toggle {
        display: none;
        cursor: pointer;
        position: absolute;
        left: 16em;
        color: $argo-color-gray-6;
    }

    .fa-filter {
        float: left;
        margin-right: 1em;
    }

    &__panel {
        transition: width 0.2s ease-in-out;
        background-color: $argo-color-gray-3;
        box-shadow: 1px 1px 2px 0 rgba(0, 0, 0, 0.1);
        padding: 10px;
        overflow-y: hidden;
        overflow-x: hidden;
        z-index: 2;

        position: fixed;
        width: 240px;
        margin-top: -18px;
        left: 60px;
        bottom: 0;

        &__title {
            margin-bottom: 1em;
            font-size: 13px;
            color: $argo-color-gray-6;
            align-items: center;
            width: 200px;
        }

        &:hover {
            overflow-y: auto;
        }

        .filter {
            width: 205px;
            transition: visibility 0.2s ease-in-out;
        }
    }

    &__content {
        padding-left: 230px;
    }
}

@include breakpoint(xlarge down) {
    .filters-group__toggle {
        display: inline;
    }

    .filters-group--expanded {
        .filters-group__toggle {
            color: $argo-color-gray-8;
        }
    }

    .filters-group__toggle:hover {
        color: $argo-color-gray-7;
    }

    .filters-group:not(.filters-group--expanded) {
        .filters-group__panel:not(.filters-group__panel:hover) {
            width: 30px;

            .filters-group__toggle {
                display: none;
            }

            .filters-group__panel__title {
                display: none;
            }

            .filter {
                visibility: hidden;
            }
        }

        .filters-group__content {
            padding-left: 30px;
        }
    }
}
