// _forms.scss

label, 
.form-label {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: $font-weight-bold;
    color: #a2a2a2;
    margin-bottom: 5px;

    &.small-text {
         text-transform: capitalize; 
         font-weight: normal; 
         font-size: 10px;
    }

}

.form-control {
    @include placeholder {
        color: #bab7b6;
    }

    -webkit-appearance: none;
    -moz-appearance: none;
    -ms-appearance: none;
    -o-appearance: none;
    appearance: none;
    padding: 0 10px;
    height: 30px;
    color: $input-color;
    border: 1px solid $input-border;
    border-radius: 3px;
    width: 100%;

    &:focus {
        border-color: #0071CE;
        outline: 0;
        -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 113, 207, 0.6);
        box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 113, 207, 0.6);
    }

}

textarea.form-control {
    height: auto;
    max-width: 100%;
}

select {

    &.form-control {
        @include appearance(none);

        background: $white url(https://cdn.theorchard.io/shared/images/downarrow@2x.png) no-repeat right 8px center;
        background-size: 14px 9px;
        padding-right: 28px;

        /*IE Fix for hiding the select dropdown default arrow*/
        &::-ms-expand {
            display: none;
        }
    }

    &.multiple-form {
        background: $white;
        padding-right: 10px;

        option {
            border-bottom: 1px solid $gray-lightest;
            padding: 8px 0;
        }
    }

}

.ui-datepicker-trigger {
    right: 5px;
    position: relative;
    top: -24px;
    cursor: pointer;
    float: right;
}

/*
 * Disabled Fields
 */

.disabled {

    > .form-group {

        margin-bottom: 15px;

        > label {

            cursor:default;

        }

        .form-control[disabled],
        .form-control[readonly],
        .form-control {

            background-color: #eee;
            opacity: 0.5;

        }

    }

    > .checkbox {

        input[type="checkbox"] {

            margin-left: -20px;
            position: absolute;

        }

    }
    
}

select {

    &:disabled {
        background-color: $grey-medium;
        opacity: 0.5;
    }

}

/*
 * Disabled hover - Style
 */

.btn {

    &.btn-danger {

        &.disabled {
            @include disabled-button($btn-default-bg, $btn-default-border, $brand-danger);
        }

    }

}

disabled,
button[disabled] {
    cursor: not-allowed;
}

/*
 * Disabled link button - Style
 */
 
.btn {
    
    &.btn-link {
        
        &[disabled],
        &.disabled {
            color: $gray-darker;
            
            &:hover,
            &:focus,
            &:active {
                color: $gray-darker;
                text-decoration: none;
            }
            
        }    
        
    }    
    
}

/*
 * Checkbox & Radio Button - Label Styling
 */
 
.checkbox, .radio {

    > [type="checkbox"], > [type="radio"] {

        + label {
            color: $gorilla;
            text-transform: initial;
            font-size: 14px;
        }

    }

}

/*
 * Checkbox  - Styling
 */

.checkbox {
    
    > [type="checkbox"]:not(:checked),
    > [type="checkbox"]:checked {
        position: absolute;
        left: -9999px;

        + label {
            position: relative;
            padding-left: 25px;

            &:before,
            &:after {
                position: absolute;
                top: 50%;
                margin-top: -9px;
                left: 1px;
                width: 16px; 
                height: 16px;
                border-radius: 2px;
                transition: all .1s linear;
            }

            &:before {
                content: '';
                border: 1px solid $timberwolf;
                background: $white;
            }

            &:after {
                content: '\e013';
                color: $bluejay;
                font-family: 'Glyphicons Halflings';
                font-weight: normal;
                font-size: 10px;
                padding: 1px 3px;
                line-height: 14px; 
            }

            &:hover:before {
                border: 1px solid $rhino;
            }

        }

    }

    > [type="checkbox"]:not(:checked) {

        + label:after {
            opacity: 0;
            transform: scale(0);
        }

    }

    > [type="checkbox"]:checked {

        + label:before,
        + label:hover:before {
            border: 1px solid $bluejay;
        }

        + label:after {
            opacity: 1;
            transform: scale(1);
        }

    }

    > [type="checkbox"]:not(:checked),
    > [type="checkbox"]:checked {

        &:disabled + label {
            cursor: not-allowed;

            &:before {
                background-color: $mouse;
                border: 1px solid $koala;
                color: $koala;
                cursor: not-allowed;
                opacity: 1;
            }

            &:after {
               color: $koala; 
            }

        }

    }
    
    > [type="checkbox"][data-indeterminate] {

        + label:after {
            content: '\2212';
            left: 2px;
            opacity: 1;
            transform: scale(1);
        }
        
    }

}

/*
 * Radio Button  - Styling
 */

.radio {

    input[type="radio"] {
        margin-top: 2px;
    }
    
    > [type="radio"]:not(:checked),
    > [type="radio"]:checked {
        position: absolute;
        left: -9999px;

        + label {
            position: relative;
            padding-left: 25px;

            &:before,
            &:after {
                content: '';
                position: absolute;
                border-radius: 50%;
                transition: all .1s linear;
            }

            &:before {
                left: 1px;
                top: 50%;
                margin-top: -9px;
                width: 16px; 
                height: 16px;
                border: 1px solid $timberwolf;
                background: $white;
            }

            &:after {
                top: 50%;
                margin-top: -4px;
                left: 6px;
                background: $bluejay;
                width: 6px; 
                height: 6px;
                line-height: 13px;
            }

            &:hover:before {
                border: 1px solid $rhino;
            }

        }

    }

    > [type="radio"]:not(:checked) {

        + label:after {
            opacity: 0;
            transform: scale(0);
        }

    }

    > [type="radio"]:checked {

        + label:before,
        + label:hover:before {
           border: 1px solid $bluejay;
        }

        + label:after {
            opacity: 1;
            transform: scale(1);
        }

    }

    > [type="radio"]:not(:checked),
    > [type="radio"]:checked {

        &:disabled + label {
            cursor: not-allowed;

            &:before {
                background-color: $mouse;
                border: 1px solid $koala;
                color: $koala;
                cursor: not-allowed;
                opacity: 1;
            }

            &:after {
               background-color: $koala;
            }

        }

    }

    > [type="radio"][data-indeterminate] {

        + label:after {
            content: '\2212';
            left: 2px;
            opacity: 1;
            transform: scale(1);
        }
        
    }

    &.inline {
        display: inline-block;
        margin-right: 10px;
    }

}

/*validation error class*/
.invalid-input {

    .input-group-addon,
    .blankInput {
        border-color: $red-destroy;
    }

    .form-control {
        border: 1px solid $red-destroy;
    }

    label,
    .input-group-addon {
        color: $red-destroy;
    }

}

/*Radio Buttons with Button Group Styles*/
.radio-btn-group {

    input[type="radio"] {
        display: none;
    }

    .btn > label {
        margin-bottom: 0;
    }

}

.flex-form {
    display: flex;
}
