$switch-background-color-on: #0078d4;
$switch-background-color-off: #ccc;
$switch-handle-color: #fff;
$switch-width: 55px;
$switch-height: 30px;
$switch-trigger-gap: 2px;
$switch-trigger-size: $switch-height - ($switch-trigger-gap * 4);

.form-inline {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
}

.form-inline .form-check {
    width: 100%;
}
@media (min-width: 576px) {
    .form-inline label {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 0;
    }

    .form-inline .form-group {
        display: flex;
        flex: 0 0 auto;
        flex-flow: row wrap;
        align-items: center;
        margin-bottom: 0;
    }

    .form-inline .form-control {
        display: inline-block;
        width: auto;
        vertical-align: middle;
    }

    .form-inline .form-control-plaintext {
        display: inline-block;
    }

    .form-inline .custom-select,
    .form-inline .input-group {
        width: auto;
    }

    .form-inline .form-check {
        display: flex;
        align-items: center;
        justify-content: center;
        width: auto;
        padding-left: 0;
    }

    .form-inline .form-check-input {
        position: relative;
        flex-shrink: 0;
        margin-top: 0;
        margin-right: .25rem;
        margin-left: 0;
    }
}

.form-label {
    padding: .375rem .75rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: .25rem;
}

.form-check-inline {
    display: -ms-inline-flexbox;
    display: inline-flex;
    -ms-flex-align: center;
    align-items: center;
    padding-left: 0;
    margin-right: .75rem;
}

.form-check {
    position: relative;
    display: block;
    padding-left: 1.25rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group-inline {
    display: flex;
    align-items: center;

    label {
        margin: 5px 30px 5px 0;
    }
}

.invalid-feedback {
    display: block;
    flex-basis: 100%;
    margin-top: .25rem;
    font-size: 80%;
    color: #dc3545;
}

.switch {
    position: relative;
    display: inline-block;
    width: $switch-width;
    height: $switch-height;
    margin: 10px;

    input[type=checkbox] {
        opacity: 0;
        width: 0;
        height: 0;

        &:checked + .slider {
            background: $switch-background-color-on;
        }

        &:checked + .slider:before {
            transform: translateX(26px);
        }

        &:focus+.slider {
            border: 2px solid #000;
        }
    }

    .slider {
        position: absolute;
        cursor: pointer;
        border: 2px solid transparent;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: $switch-background-color-off;
        transition: .4s;

        &.round {
            border-radius: 34px;

            &:before {
                border-radius: 50%;
            }
        }

        &:before {
            position: absolute;
            content: "";
            height: $switch-trigger-size;
            width: $switch-trigger-size;
            left: $switch-trigger-gap;
            bottom: $switch-trigger-gap;
            background: #ffffff;
            transition: .4s;
        }
    }
}

$search-button-width: 30px;

.input-group {
    display: flex;
    flex-wrap: wrap;

    .input {
        border: none;
        background: none;
        flex-grow: 1;
    }

    .input-group-prepend {
        align-items: center;
    }

    .input-group-append {
        align-items: center;
    }
}

.expanded {
    .icon-chevron-down {
        // TODO: Introduce proper class for dropdown toggle
        transform: rotate(180deg);
    }
}

.search-input {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    align-items: flex-start;
    max-width: 500px;

    tag-input {
        display: block;
        margin: 5px 0;
        width: 300px;
    }

    .input-group:first-child {
        border-bottom: 1px solid #a19f9d;
        width: 300px;
        flex: 1;
    }

    input[type=search] {
        border: none;
        background: none;
        padding-left: $search-button-width;
        min-height: 32px;
        width: 100%;
        vertical-align: top;
    }

    .search-button {
        border: none;
        background: none;
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: $search-button-width;
    }

    .switch {
        margin: 0 10px;
    }
}
