/*!
 * 
 * Copyright (c) 2019-2023 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA,
 * and/or its subsidiaries and/or its affiliates and/or their licensors.
 * 
 */
@import "../variables";
@import "../variables/forms_vars";
@import "../variables/input_groups_vars";
@import "../mixins";

.dlt-input-group {
    display: flex;
    flex-flow: row wrap;
    flex: 1 100%;

    &[disabled="disabled"] {
        opacity: $forms-opacity-disabled;
        cursor: not-allowed;

        .dlt-button {
            pointer-events: none;
        }

        .dlt-number-input {
            cursor: not-allowed;
        }
    }

    label {
        flex: 1 100%;
    }

    .dlt-form-requirement {
        width: calc(100% - 1px);
    }

    .dlt-form-item input{
        border-radius: 0 $forms-border-radii $forms-border-radii 0;
    }

    .dlt-input-addon {
        background: $input-groups-color-select-background;
        border: $forms-border-width solid $forms-color-input-border;
        border-right: 0;
        color: $forms-color-input-border!important;
        height: $input-groups-height;
        min-width: $input-groups-min-width;
        padding: $input-groups-padding;
        line-height: $forms-input-line-height;
        font-weight: $input-groups-font-weight;
        text-align: center;
        z-index: 1;
        border-radius: $forms-border-radii 0 0 $forms-border-radii;
    }

    &.sm-input .dlt-input-addon {
        height: $input-groups-height-sm;
        min-width: $input-groups-min-width-sm;
        font-size: $input-groups-font-size-sm;
        line-height: $input-groups-line-height-sm;
        padding: $input-groups-padding-sm;

    }

    &.lg-input .dlt-input-addon {
        height: $input-groups-height-lg;
        min-width: $input-groups-min-width-lg;
        font-size: $input-groups-font-size-lg;
        line-height: $input-groups-line-height-lg;
    }

    .dlt-form-item+.dlt-input-addon {
        border-left: 0;
        border-right: $forms-border-width solid $forms-color-input-border;
        border-radius: 0 $forms-border-radii $forms-border-radii 0;
    }

    .dlt-input-addon + .dlt-form-item input{
        border-radius: 0 $forms-border-radii $forms-border-radii 0;
    }

    button.dlt-button,
    [type="submit"],
    [type="reset"] {
        align-self: flex-start;
    }

    .dropdown-content {
        width: auto;
        right: 0;
        white-space: nowrap;
    }

    .dlt-input-addon-dropdown {

        flex: 0 1;
        width: auto;
        margin-right: -1px;

        .select-arrow-icon::after {
            font-size: $input-groups-select-icon-font-size;
            color: $forms-color-icon-interactive-secondary;
            right: $input-groups-select-icon-right;
        }

        .dlt-form-label {
            clip-path: inset(100%);
            clip: rect(1px, 1px, 1px, 1px);
            height: 1px;
            overflow: hidden;
            position: absolute;
            white-space: nowrap;
            width: 1px;
        }

        .dlt-form-group {
            width: inherit;
        }

        .dlt-select-input {
            background: $input-groups-color-select-background;
            color: $forms-color-input-border!important;
            font-weight: $input-groups-font-weight;
            padding: $input-groups-select-input-padding;
            width: auto;
            font-style: normal;
            line-height: 31px;
            border-radius: $forms-border-radii 0 0 $forms-border-radii;
            
              
            &:focus:enabled,
            &:hover:enabled {
                border: $forms-border-width solid $forms-color-input-border-hover;
                outline: $forms-border-width-hover solid $forms-color-input-border-hover;
                outline-offset: $forms-outline-offset;
            }
        }

    }

    .dlt-form-item :first-child{
        border-radius: $forms-border-radii 0 0 $forms-border-radii;
    }

    .dlt-input-addon-dropdown + .dlt-form-item input{
        border-radius: 0 $forms-border-radii $forms-border-radii 0;
    }

    .dlt-form-item + .dlt-input-addon-dropdown .dlt-select-input{
        border-radius: 0 $forms-border-radii $forms-border-radii 0;
    }

    .dlt-form-requirement::after{ //border radius fix for the red error line 
        border-radius:  0 0 $forms-border-radii $forms-border-radii;
    }

    .dlt-form-item+.dlt-input-addon-dropdown {
        margin-left: -1px;
        margin-right: 0;
        border-radius: 0 $forms-border-radii $forms-border-radii 0;
    }

    .dlt-form-item + .dlt-button, .dlt-form-item + .dlt-dropdown .dlt-button{
        border-radius: 0 $forms-border-radii $forms-border-radii 0;
    }
    &.sm-input .dlt-input-addon-dropdown {

        .dlt-select-input {
            padding: $input-groups-select-input-padding-sm;
            line-height: 23px;
        }

        .select-arrow-icon::after {
            right: $input-groups-select-icon-right-sm;
        }
    }

}