$block: yagr-legend;

.#{$block} {
    padding: 8px 24px 12px;
    display: block;
    max-width: 100%;
    width: 100%;

    &__top {
        padding: 8px 24px 0;
    }

    &__container {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    &__items {
        display: flex;
        flex-flow: row wrap;
        align-items: baseline;
        padding-left: 16px;
    }

    &__item {
        &:last-child {
            margin-right: 0;
        }

        cursor: pointer;
        max-width: 350px;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-right: 16px;

        color: var(--yagr-legend-item);
        font-weight: normal;
        position: relative;
        white-space: nowrap;

        max-height: 14px;
        font-size: 12px;
        line-height: 14px;

        &:hover:not(.#{$block}__item_disabled):not(.#{$block}__item_hidden) {
            color: var(--yagr-legend-item-hover);
        }

        &_hidden {
            cursor: pointer;

            color: var(--yagr-legend-item-hidden);

            .#{$block}__icon {
                // important required to override element style color;
                // stylelint-disable-next-line
                background-color: var(--yagr-legend-item-hidden) !important;
            }
        }

        &_disabled {
            // stylelint-disable-next-line
            cursor: not-allowed !important;
            pointer-events: none;
            touch-action: none;
            user-select: none;
            color: var(--yagr-legend-item-hidden);

            .#{$block}__icon {
                // stylelint-disable-next-line
                background-color: var(--yagr-legend-item-hidden) !important;
                opacity: 0.55;
            }

            &:hover {
                color: var(--yagr-legend-item-hidden);
            }
        }
    }

    &__name {
        text-decoration: inherit;
    }

    &__icon {
        margin-right: 4px;
        width: 12px;
        display: inline-block;
        position: relative;

        &_area,
        &_column,
        &_dots {
            height: 12px;
            border-radius: 50%;
            top: 2px;
        }

        &_line {
            height: 3px;
            top: -2px;
        }
    }

    &__pagination {
        padding-left: 14px;
        display: flex;
        justify-content: flex-start;
        align-items: center;

        &-text {
            user-select: none;
            color: var(--yagr-legend-item-hover);
            font-size: 12px;
        }
    }

    &__icon-up {
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 0 6px 12px;
        border-color: transparent transparent #003399;
        cursor: pointer;

        &_disabled {
            cursor: initial;
            border-color: transparent transparent #cccccc;
        }
    }

    &__icon-down {
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 12px 6px 0;
        border-color: #003399 transparent transparent;
        cursor: pointer;

        &_disabled {
            cursor: initial;
            border-color: #cccccc transparent transparent;
        }
    }
}
