/*!
 * 
 * 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/radio_buttons_vars";

@import "../mixins";

.dlt-radio-button-group-label {
    font-family: $forms-font-family;
    font-weight: $forms-legend-font-weight;
    font-size: $forms-legend-font-size;
    color: $forms-color-legend-text;
    display: inline-block;
    vertical-align: baseline;
    padding: 0;
    margin: 0;
    line-height: $radio-buttons-label-line-height;
    padding-bottom: $radio-buttons-legend-padding-bottom;
}

.dlt-radio-button-group {
    .dlt-radio-button {
        position: relative;
        box-sizing: content-box;
        padding: 0;
        line-height: $radio-buttons-label-line-height;
        padding-bottom: $radio-buttons-padding-bottom;

        input[type="radio"] {
            opacity: 0;
            width: 0px;
            height: 0px;
            margin: 0;
            padding: 0;
            position: absolute;

            /*Adding hover styles on the outer-box of the fake radio*/
            // &:enabled + label:hover::before,
            &:focus:enabled+label::before {
                border-color: $forms-color-primary;
                @include box-shadow(inset 0px 0px 0px 1px $forms-color-primary);
            }

            &:disabled+label {
                cursor: not-allowed;
                opacity: $forms-opacity-disabled;
            }

            /*Hide the checkmark by default*/
            &+label::after {
                content: none;
            }

            /*Unhide on the checked state*/
            &:checked+label::before {
                background-color: $forms-color-background;
            }

            /*Unhide on the checked state*/
            &:checked+label::after {
                content: "";
                background-color: $forms-color-primary;
                border: none;
            }

            &:checked:focus+label::before {
                background-color: $forms-color-background;
                border: $forms-border-width $forms-border-style $forms-color-input-border;
            }

            &:checked:hover+label::after {
                color: $white;
            }
        }

        label {
            position: relative;
            display: inline-block;
            padding: $radio-buttons-label-padding-y $radio-buttons-label-padding-x-right $radio-buttons-label-padding-y $radio-buttons-label-padding-x-left;
            cursor: pointer;
            font-weight: $forms-label-font-weight;
            font-size: $forms-label-font-size;
            color: $forms-color-label-text;
            line-height: $radio-buttons-label-line-height;
            margin: 0;

            &::before,
            &::after {
                position: absolute;
                content: "";
                display: inline-block;
            }

            /*Outer box of the fake radio*/
            &::before {
                width: $radio-buttons-size;
                height: $radio-buttons-size;
                border: $forms-border-width $forms-border-style $forms-color-input-border;
                @include border-radius($radio-buttons-border-radii);
                background-color: $forms-color-background;
                left: 0rem;
                top: 0rem;
            }

            /*Checked of the fake radio*/
            &::after {
                top: $radio-buttons-checkmark-top;
                left: $radio-buttons-checkmark-left;
                width: $radio-buttons-checkmark-width;
                height: $radio-buttons-checkmark-height;
                @include border-radius($radio-buttons-border-radii);
                background: $forms-color-background;
            }
        }
    }

    div.dlt-radio-button:last-child {
        padding-bottom: 0;
    }

    .dlt-form-requirement {
        padding-top: 0;
        margin-top: -6px;
    }
    .dlt-radio-button-group-horizontal {
        display: flex;
    }
}

.sm-radio {
    .dlt-radio-button-group-label {
        font-size: $radio-buttons-font-size-sm;
        padding-bottom: $radio-buttons-legend-padding-bottom-sm;
    }

    .dlt-radio-button {
        padding: 0;
        line-height: $radio-buttons-label-line-height;
        padding-bottom: $radio-buttons-padding-bottom-sm;

        label {
            font-size: $radio-buttons-font-size-sm;
            line-height: $radio-buttons-line-height-sm;
            padding: $radio-buttons-label-padding-y $radio-buttons-label-padding-x-right-sm $radio-buttons-label-padding-y $radio-buttons-label-padding-x-left-sm;

            &::before {
                width: $radio-buttons-size-sm;
                height: $radio-buttons-size-sm;
            }

            &::after {
                width: 6px;
                height: 6px;
                top: 3px;
                left: 3px;
            }
        }
    }
}




/* Radio Button Styling - End - */