@import '../../../styles/variables';

@mixin dropdown-input {
    position: auto;
    width: 160px;
    height: 34px;
    margin: auto;
    margin-top: auto;
    padding: 8px;
    border: 1px solid #d2d2d2;
    border-radius: $bdl-border-radius-size-med;
    box-shadow: 0 1px 1px 1px rgb(0 0 0 / 5%);
}

@mixin error-border {
    border: 1px solid $bdl-watermelon-red;
}

.condition-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    padding-bottom: 10px;

    .condition-delete-button {
        display: flex;
        align-items: center;
        width: 35px;

        .delete-button {
            position: relative;
            display: flex;
            padding-top: 0;
            padding-bottom: 0;
            padding-left: 10px;
            color: $bdl-gray-50;
            font-weight: bold;
            font-size: 11px;
            background: none;
            border: 0;
            cursor: pointer;
        }
    }

    .condition-connector {
        display: flex;
        align-items: center;
        width: 70px;
        padding-right: 70px;
        padding-left: 10px;

        .condition-connector-text {
            position: relative;
            margin: auto;
            color: $black;
        }
    }

    .condition-column-dropdown-container {
        align-items: center;

        .filter-dropdown-single-select-field-container {
            flex: 1;
        }

        .select-field {
            .bdl-SelectButton,
            .select-button {
                width: 160px;
                border-radius: $bdl-border-radius-size-med;
            }

            .bdl-SelectButton.placeholder,
            .select-button.placeholder {
                color: $bdl-gray-65;
            }
        }
    }

    .condition-operator-dropdown-container {
        align-items: center;

        .filter-dropdown-single-select-field-container {
            flex: 1;
        }

        .select-container {
            width: 110px;
            padding-right: 10px;
            padding-left: 10px;

            .bdl-SelectButton,
            .select-button {
                border-radius: $bdl-border-radius-size-med;
            }
        }
    }

    .condition-value-dropdown-container {
        align-items: center;
        height: 100%;
        padding-right: 5px;

        .filter-dropdown-text-field-container {
            flex: 1;

            .text-input-container {
                margin: auto;
            }

            input {
                @include dropdown-input;
            }
        }

        .filter-dropdown-date-field-container {
            flex: 1;

            .date-picker-wrapper {
                margin: auto;
            }

            .date-picker-wrapper .date-picker-icon-holder {
                width: 100%;
            }

            .text-input-container {
                margin: auto;
            }

            input {
                @include dropdown-input;
            }
        }

        .filter-dropdown-single-select-field-container {
            flex: 1;
        }

        .select-container {
            width: 100%;

            .bdl-SelectButton,
            .select-button {
                width: 160px;
                border-radius: $bdl-border-radius-size-med;
            }

            .bdl-SelectButton.placeholder,
            .select-button.placeholder {
                color: $bdl-gray-65;
            }
        }
    }

    .condition-value-dropdown-container.show-error {
        .select-container {
            button.bdl-SelectButton,
            button.select-button {
                @include error-border;
            }
        }

        .filter-dropdown-text-field-container {
            .text-input-container input {
                @include error-border;
            }
        }

        .date-picker-wrapper input {
            @include error-border;
        }

        .bdl-SelectButton.placeholder,
        .select-button.placeholder {
            @include error-border;
        }
    }

    .condition-error-icon-status {
        display: flex;
        align-items: center;

        .icon-alert-default {
            display: block;
            margin: 0 auto;

            use:nth-child(2) {
                fill: $bdl-watermelon-red;
            }
        }
    }
}
