/*!
 * Copyright 2023 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
@import "../common/forms.less";
@import "base.less";

// Slider

.km-fiori .k-slider .k-draghandle,
.km-fiori .k-slider .k-draghandle:hover
{
    border: 0;
    border-radius: 5em;
}

.km-fiori .k-slider-track
{
    margin: -.5em .5em 0 0;
    .box-sizing(content-box);
    border-radius: .5em;
    background-color: @fiori-list-hover-background;
}

.km-fiori .k-slider-selection
{
    margin-left: 0;
}

// Forms

.km-fiori .km-list input[type=password],
.km-fiori .km-list input[type=search],
.km-fiori .km-list input[type=number],
.km-fiori .km-list input[type=tel],
.km-fiori .km-list input[type=url],
.km-fiori .km-list input[type=email],
.km-fiori .km-list input[type=month],
.km-fiori .km-list input[type=color],
.km-fiori .km-list input[type=week],
.km-fiori .km-list input[type=date],
.km-fiori .km-list input[type=time],
.km-fiori .km-list input[type=datetime],
.km-fiori .km-list input[type=datetime-local],
.km-fiori .km-list input[type=text]:not(.k-input),
.km-fiori .km-list select:not([multiple]),
.km-fiori .km-list .k-dropdown-wrap,
.km-fiori .km-list textarea
{
    .appearance(none);
    font-size: 1.1rem;
    min-width: 6em;
    border: 0;
    padding: .4em;
    outline: none;
    background: transparent;
    margin-top: 0;
    transform: translateY(-50%);
    -webkit-transform: translateY(-50%);
}

.km-fiori .km-list .k-dropdown-wrap
{
    padding: .2em;
}

.km-fiori .km-list .k-dropdown
{
    margin-top: -1.05em;
    font-weight: normal;
}

.km-fiori .km-list input[type=color],
.km-fiori .km-list input[type=week],
.km-fiori .km-list input[type=date],
.km-fiori .km-list input[type=time],
.km-fiori .km-list input[type=month],
.km-fiori .km-list input[type=datetime],
.km-fiori .km-list input[type=datetime-local],
.km-fiori .km-list .k-dropdown
{
    text-align: left;
}

.km-fiori .km-list .k-dropdown .k-dropdown-wrap
{
    display: block;
    border-radius: 0;
    background: transparent;
    .box-shadow(none);
}

// Checkboxes and Radios

.km-fiori .km-listview-label input[type=checkbox]
{
    margin-top: -.7em;
}

.km-fiori .km-listview-label input[type=radio],
.km-fiori .km-listview-label input[type=checkbox]
{
    border-width: @fiori-border-width;
    border-style: solid;
    width: 1.4em;
    height: 1.4em;
    border-radius: @fiori-border-radius;
}

.km-fiori .km-listview-label input[type=radio]
{
    width: 1.2em;
    height: 1.2em;
    border-radius: 1em;
}

.km-fiori .km-listview-label input[type=checkbox]:after
{
    content: "\a0";
    display: block;
    width: 90%;
    height: 76%;
    .transform(scale(.9,1));
    .transform-origin(10% 50%);
}

.km-fiori .km-listview-label input[type=checkbox]:checked:after
{
    font-size: 1.4em;
}

.km-fiori .km-listview-label input[type=radio]:after
{
    color: transparent;
}

// Nova theme features
.km-fiori .km-thumbnail {
    border-radius: 50%;
}

// Label above
.km-fiori .km-label-above {
    width: 100%;
    font-size: 0.87em;
    line-height: 1.2em;
    display: block;
    padding-top: .92em;
    padding-bottom: 2.4em;
    margin-left: .5em;
}

.km-fiori .km-inline-field {
    display: inline-block;
    position: relative;
    width: calc((100% - 3.22em)/2);
    overflow: hidden;
    white-space: nowrap;
}

.km-fiori {
    .km-list {
        .km-label-above {
            input[type=text]:not(.k-input),
            input[type=password],
            input[type=search],
            input[type=number],
            input[type=tel],
            input[type=url],
            input[type=email],
            input[type=file],
            input[type=month],
            input[type=color],
            input[type=week],
            input[type=date],
            input[type=time],
            input[type=datetime],
            input[type=datetime-local],
            select:not([multiple]),
            .k-dropdown,
            textarea {
                width: 100%;
                right: 0;
                margin-top: -5px;
                padding-left: 0;
                left: 1em;
                transform: translateY(0);
                -webkit-transform: translateY(0);
            }
        }

        fieldset {
            border: none;
            padding: 0;
            padding: 0 1em;
            margin: -0.5em -0.7em;

            legend {
                text-indent: 0;
                margin: 0 -1.61em;
                font-weight: normal;
                border-bottom-width: 1px;
                border-bottom-style: solid;
                padding: 0 1.61em 0;
                width: 100%;
                box-sizing: content-box;
                padding: .45em 1em;
                margin: 0 -1em;
            }

            .km-inline-field {
                margin-top: 0;
                margin-left: 0;
                padding-left: 1.1em;
                border-right-width: 1px;
                border-right-style: solid;

                &:first-of-type {
                    padding-left: 0;
                }
            }

            textarea,
            input[type=password],
            input[type=search],
            input[type=number],
            input[type=tel],
            input[type=url],
            input[type=email],
            input[type=month],
            input[type=color],
            input[type=week],
            input[type=date],
            input[type=time],
            input[type=datetime],
            input[type=datetime-local],
            input[type=text]:not(.k-input),
            select:not([multiple]),
            .k-dropdown-wrap {
                width: 100%;
                position: relative;
                transform: translateY(0);
                -webkit-transform: translateY(0);
            }

            textarea {
                width: 100%;
                transform: translateY(0);
                -webkit-transform: translateY(0);
                margin-right: 0;
                padding-left: 0;
            }

            > input[type=password],
            > input[type=search],
            > input[type=number],
            > input[type=tel],
            > input[type=url],
            > input[type=email],
            > input[type=month],
            > input[type=color],
            > input[type=week],
            > input[type=date],
            > input[type=time],
            > input[type=datetime],
            > input[type=datetime-local],
            > input[type=text]:not(.k-input),
            > select:not([multiple]),
            > .k-dropdown-wrap {
                padding: 1.23em 0;
            }
        }

        .km-inline-field {
            input[type=text]:not(.k-input),
            input[type=password],
            input[type=search],
            input[type=number],
            input[type=tel],
            input[type=url],
            input[type=email],
            input[type=file],
            input[type=month],
            input[type=color],
            input[type=week],
            input[type=date],
            input[type=time],
            input[type=datetime],
            input[type=datetime-local],
            select:not([multiple]),
            .k-dropdown,
            textarea {
                position: absolute;
                width: 100%;
                left: 0;
                padding-left: 0;
                padding-left: 1em;
            }

            &:first-of-type {
                input[type=text]:not(.k-input),
                input[type=password],
                input[type=search],
                input[type=number],
                input[type=tel],
                input[type=url],
                input[type=email],
                input[type=file],
                input[type=month],
                input[type=color],
                input[type=week],
                input[type=date],
                input[type=time],
                input[type=datetime],
                input[type=datetime-local],
                select:not([multiple]),
                .k-dropdown,
                textarea {
                    margin-left: 0;
                    padding-left: 0;
                }
            }
        }
    }
}

.km-fiori .km-list .km-full-width-slider {
    position: relative;
    margin-top: 0;
    padding: 1.3em 0;
    width: auto;
    display: block;
}

.km-fiori .k-slider-horizontal .k-draghandle {
    top: 2px;
}

.km-fiori .k-slider-vertical .k-draghandle {
    left: -.665em;
}

.km-fiori .k-slider-horizontal .k-slider-selection {
    margin-top: 0;
}

.km-fiori .k-slider-vertical .k-slider-selection {
    margin-left: -.1em;
    width: .29rem;
}

.km-fiori .k-slider-horizontal .k-slider-track {
    height: .29rem;
}

.km-fiori .k-slider-vertical .k-slider-track {
    width: .29rem;
}

.km-fiori .k-slider-selection {
    margin-left: 0;
}

.km-fiori .k-slider .k-draghandle,
.km-fiori .k-slider .k-draghandle:hover {
    margin-top: -.665em;
    padding: 0;
    background-clip: content-box;
    -webkit-background-clip: content-box;
}

.km-fiori .k-slider .k-draghandle:active:before {
    opacity: .4;
}

.km-fiori .k-slider .k-draghandle,
.km-fiori .k-slider .k-draghandle:hover {
    border: 0;
    border-radius: 5em;
}

.km-fiori .k-slider-track {
    .box-sizing(content-box);
    border-radius: .5em;
    border-width: 0;
}

.km-fiori .km-full-width-slider .k-slider-track {
    margin-top: 0;
}

.km-fiori .k-slider-selection {
    margin-left: 0;
}

// Standalone Checkboxes and RadioButtons
.km-fiori input.km-checkbox,
.km-fiori input.km-radio {
    display: inline;
    opacity: 0;
    width: 0;
    margin: 0;
    height: 0;
}

.km-fiori .km-checkbox-label,
.km-fiori .km-radio-label {
    display: block;
    position: relative;
    vertical-align: middle;
    font-size: 1.2em;
    line-height: 1.5em;
    margin-left: 1em;
}

.km-fiori .km-checkbox-label:before {
    top: 0;
    right: .7em;
    left: auto;
    width: 18px;
    height: 18px;
    border-width: 2px;
    border-style: solid;
}

.km-fiori .km-checkbox-label:after {
    top: 6px;
    right: .85em;
    left: auto;
    width: 10px;
    height: 10px;
    vertical-align: middle;
}

.km-fiori input.km-checkbox:checked + .km-checkbox-label:after {
    content: "";
    font-size: 1.2em;
    line-height: 1em;
}

//Radio buttons
.km-fiori .km-radio-label {
    position: relative;
    vertical-align: middle;
    line-height: 1.5em;
}

.km-fiori .km-radio-label:before {
    content: "";
    position: absolute;
    top: 0;
    right: .7em;
    left: auto;
    width: 18px;
    height: 18px;
    border-width: 2px;
    border-style: solid;
    border-radius: 50%;
}

.km-fiori input.km-radio:checked + .km-radio-label:after {
    content: "";
    width: 10px;
    height: 10px;
    position: absolute;
    top: 11px;
    right: 1em;
    left: auto;
    border-radius: 50%;
}
