@import '../../styles/mixins';

.relation-dialog {
    $class: &;
    display: flex;
    flex-direction: column;
    width: 560px;

    &__select-type {
        flex: 0 0 auto;
        margin: 0 16px;
    }

    &__join-type {
        width: 100%;
        display: flex;
        justify-content: space-between;
        margin-bottom: 10px;
        padding-right: 28px;
    }

    &__left-source {
        flex: 1;
        display: flex;
        align-items: center;
    }

    &__right-source {
        flex: 1;
        display: flex;
        align-items: center;
    }

    &__icon-table {
        flex: 0 0 auto;
        margin-right: 10px;
    }

    &__avatar-name {
        max-width: 190px;
        @include overflow-ellipsis();
    }

    &__divider {
        flex-grow: 1;
        height: 1px;
        border-top: 1px solid var(--ds-color-relation-line);

        &_invalid {
            border: 1px dashed var(--ds-color-error);
        }
    }

    &__select-join-type {
        display: flex;
        justify-content: center;

        .g-button__icon {
            width: 100%;
        }

        &_invalid {
            border: 1px dashed var(--ds-color-error);
        }
    }

    &__join-condition {
        display: flex;
        position: relative;

        &:not(:first-child) {
            margin-top: 10px;
        }

        &:hover {
            #{$class}__btn-delete-condition {
                visibility: visible;
            }
        }
    }

    &__btn-select-join-type {
        padding: 10px;
    }

    &__btn-delete-condition {
        margin-left: 5px;

        &_disabled {
            visibility: hidden;
        }

        &.button2.button2_view_default.button2_theme_flat {
            margin-left: 10px;
        }
    }

    &__ic-join-type {
        transform: scale(0.7);
        --ds-join-stroke-color: var(--dl-color-border);

        &_disabled {
            opacity: 0.5;
        }
    }

    &__btn-add-condition {
        display: flex;
        justify-content: center;
        width: 150px;
        margin-top: 20px;

        &-ic {
            height: inherit;
            display: flex;
            align-items: center;
            left: 10px;
            position: relative;
        }
    }

    &__field-type {
        opacity: 0.5;
    }

    &__option {
        display: flex;
        align-items: center;
    }

    &__option-icon {
        display: flex;
        align-items: center;
        margin-right: 5px;
    }

    &__optimize-join {
        margin-top: 20px;
    }

    &__hint-optimize-join {
        margin: 0 1ex;
    }
}
