/*!
 * 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-android .k-slider-horizontal
{
    margin-top: -.5em;
    height: .1em;
}

.km-android .km-list .km-full-width-slider .k-slider-track {
    border-width: 0;
}

.km-android .k-slider .k-draghandle,
.km-android .k-slider .k-draghandle:hover
{
    width: .4em;
    height: .4em;
    .box-shadow(none);
    border-radius: 5em;
    border: 0;
}

.km-android .k-slider-horizontal .k-draghandle
{
    top: -3px;
}

.km-android .k-slider-vertical .k-draghandle
{
    left: -.5em;
}

.km-android .k-slider-horizontal .k-slider-selection
{
    margin-top: -1px;
    height: .2em;
}

.km-android .k-slider-vertical .k-slider-selection
{
    margin-left: -.1em;
    width: .2em;
}

.km-android .k-slider-horizontal .k-slider-track
{
    height: .1em;
}

.km-android .k-slider-vertical .k-slider-track
{
    width: .1em;
}

.km-android .km-list .km-full-width-slider .k-slider-track,
.km-android .km-list .km-full-width-slider .k-slider-selection {
    height: .15rem;
}

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

// Forms

.km-android input[type=password],
.km-android input[type=search],
.km-android input[type=number],
.km-android input[type=tel],
.km-android input[type=url],
.km-android input[type=email],
.km-android input[type=month],
.km-android input[type=color],
.km-android input[type=week],
.km-android input[type=date],
.km-android input[type=time],
.km-android input[type=datetime],
.km-android input[type=datetime-local],
.km-android input[type=text]:not(.k-input),
.km-android select:not([multiple]),
.km-android .k-dropdown,
.km-android textarea
{
    .appearance(none);
    padding: .4em;
    border-radius: 0;
    .box-sizing(border-box);
}

.km-android .km-list input[type=password],
.km-android .km-list input[type=search],
.km-android .km-list input[type=number],
.km-android .km-list input[type=tel],
.km-android .km-list input[type=url],
.km-android .km-list input[type=email],
.km-android .km-list input[type=month],
.km-android .km-list input[type=color],
.km-android .km-list input[type=week],
.km-android .km-list input[type=date],
.km-android .km-list input[type=time],
.km-android .km-list input[type=datetime],
.km-android .km-list input[type=datetime-local],
.km-android .km-list input[type=text]:not(.k-input),
.km-android .km-list select:not([multiple]),
.km-android .km-list .k-dropdown
{
    margin-top: -1.05em;
    font-size: 1em;
}

.km-native-scrolling .km-android .km-list input[type=password],
.km-native-scrolling .km-android .km-list input[type=search],
.km-native-scrolling .km-android .km-list input[type=number],
.km-native-scrolling .km-android .km-list input[type=tel],
.km-native-scrolling .km-android .km-list input[type=url],
.km-native-scrolling .km-android .km-list input[type=email],
.km-native-scrolling .km-android .km-list input[type=month],
.km-native-scrolling .km-android .km-list input[type=color],
.km-native-scrolling .km-android .km-list input[type=week],
.km-native-scrolling .km-android .km-list input[type=date],
.km-native-scrolling .km-android .km-list input[type=time],
.km-native-scrolling .km-android .km-list input[type=datetime],
.km-native-scrolling .km-android .km-list input[type=datetime-local],
.km-native-scrolling .km-android .km-list input[type=text]:not(.k-input),
.km-native-scrolling .km-android .km-list select:not([multiple]),
.km-native-scrolling .km-android .km-list textarea
{
    position: static;
    float: right;
    margin-top: 0;
    margin-bottom: -.2em;
}

.km-android input[type=file]
{
    padding: .25em;
    outline: none;
}

.km-android .km-list textarea
{
    font-size: 1em;
}

.km-native-scrolling .km-android .km-list textarea
{
    width: 50%;
    margin: 0;
}

.km-android .k-dropdown
{
    padding: 0;
    min-width: 8em;
}

.km-root .km-android .k-dropdown
{
    margin-top: -1.2em;
}

.km-native-scrolling .km-android .km-list .k-dropdown
{
    width: 48%;
    width: ~"-webkit-calc(50% - .7em)";
    width: ~"-moz-calc(50% - .7em)";
    width: ~"calc(50% - .7em)";
    margin-right: .7em;
}

.km-android .k-dropdown .k-dropdown-wrap
{
    width: 100%;
    padding: .1em .3em;
    border-radius: 0;
    .box-sizing(border-box);
    .box-shadow(none);
}

.km-android .k-dropdown .k-input
{
    border-radius: 0;
}

.km-android input[type=password],
.km-android input[type=search],
.km-android input[type=number],
.km-android input[type=tel],
.km-android input[type=url],
.km-android input[type=email],
.km-android input[type=text]:not(.k-input),
.km-root .km-android textarea
{
    outline-width: 4px;
    outline-style: solid;
    outline-offset: -5px;
    border-width: 0 0 5px;
    border-style: solid;
}

.km-android input[type=password]:focus,
.km-android input[type=search]:focus,
.km-android input[type=number]:focus,
.km-android input[type=tel]:focus,
.km-android input[type=url]:focus,
.km-android input[type=email]:focus,
.km-android input[type=text]:not(.k-input):focus,
.km-android textarea:focus
{
    outline-offset: -6px;
}

.km-android input[type=month],
.km-android input[type=color],
.km-android input[type=week],
.km-android input[type=date],
.km-android input[type=time],
.km-android input[type=datetime],
.km-android input[type=datetime-local],
.km-android select:not([multiple]),
.km-android .k-dropdown .k-dropdown-wrap
{
    border-width: 0 0 1px;
    border-style: solid;
    margin-bottom: 1px;
    background-clip: border-box;
}

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

.km-android .k-slider .k-draghandle:before
{
    content: "\a0";
    display: block;
    margin-top: -.5em;
    margin-left: -.5em;
    width: 100%;
    height: 100%;
    opacity: .3;
    border-radius: 5em;
    padding: .5em;
    margin-bottom: .5em;
}

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

.km-android .km-popup .k-state-hover
{
    opacity: .6;
}

// Checkboxes and Radios

.km-android .km-listview-label input[type=radio],
.km-android .km-listview-label input[type=checkbox]
{
    border-width: @android-border-width;
    border-style: solid;
    width: 1em;
    height: 1em;
    font-size: 1.2em;
}

.km-android .km-listview-label input[type=radio],
.km-android .km-listview-label input[type=radio]:after,
.km-android .km-state-active input[type=radio]:before
{
    border-radius: 1em;
}

.km-android .km-listview-label input[type=radio]:after,
.km-android .km-listview-label input[type=checkbox]:after,
.km-android .km-state-active input[type=radio]:before,
.km-android .km-state-active input[type=checkbox]:before
{
    content: "\a0";
    display: block;
    width: 78%;
    height: 78%;
}

.km-android .km-listview-label input[type=radio]:after
{
    margin: 11% 0 0 11%;
}

.km-android .km-listview-label input[type=checkbox]:after
{
    margin: -20% 0 0 20%;
    width: 120%;
    height: 120%;
    .transform(scale(1,1.2));
}

.km-android .km-state-active input[type=radio]:before,
.km-android .km-state-active input[type=checkbox]:before
{
    position: absolute;
    margin: -45% 0 0 -45%;
    width: 190%;
    height: 190%;
}

.km-android .km-state-active input[type=radio],
.km-android .km-state-active input[type=checkbox]
{
    border-width: @android-border-width;
    border-style: solid;
}

.km-android .km-listview-label input[type=radio]:checked:after
{
    content: "\a0";
    .box-shadow(0 0 3px currentcolor);
}

// Nova theme features
.km-android .km-icon-label.km-required:after {
    margin-left: -.89em;
}

.km-android .km-label-above {
    font-size: 0.87em;
    margin-top: -2px;
    padding-top: .42em;
    padding-bottom: 2em;
    margin-bottom: .13em;
}

.km-android fieldset .km-label-above {
    margin-top: 0;
    padding-top: 1.455em;
    padding-bottom: 3.091em;
}

.km-android .km-label-above textarea {
    top: 50%;
}

.km-android {
    .km-list {
        .km-label-above {
            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,
            textarea  {
                padding-left: .7em;
                margin-top: -.375em;
                border: none;
            }
        }
    }
}

.km-android {
    .km-list {
        fieldset {
            .km-label-above {
                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,
                textarea  {
                    margin-top: -.25em;
                }
            }
        }
    }
}

.km-android .km-list fieldset {
    border: none;
    padding: 0 1.61em;
    margin: -.5em -1.61em;
}

.km-android .km-list fieldset > input[type=password],
.km-android .km-list fieldset > input[type=search],
.km-android .km-list fieldset > input[type=number],
.km-android .km-list fieldset > input[type=tel],
.km-android .km-list fieldset > input[type=url],
.km-android .km-list fieldset > input[type=email],
.km-android .km-list fieldset > input[type=month],
.km-android .km-list fieldset > input[type=color],
.km-android .km-list fieldset > input[type=week],
.km-android .km-list fieldset > input[type=date],
.km-android .km-list fieldset > input[type=time],
.km-android .km-list fieldset > input[type=datetime],
.km-android .km-list fieldset > input[type=datetime-local],
.km-android .km-list fieldset > input[type=text]:not(.k-input),
.km-android .km-list fieldset > select:not([multiple]),
.km-android .km-list fieldset > .k-dropdown-wrap,
.km-android .km-list fieldset > textarea {
    padding: 1.23em 0 1.23em 0;
    margin: 2px 0;
    border: none;
    outline: none;
}

.km-android .km-list fieldset legend {
    text-indent: 0;
    margin: 0 -1.61em;
    font-weight: normal;
    padding: 1.23em 1.61em .11em;
    width: 100%;
    box-sizing: content-box;
    text-transform: uppercase;
}

.km-android .km-legend-button {
    text-transform: uppercase;
}

.km-android .km-list fieldset .km-inline-field {
    margin-top: 0;
    margin-left: 0;
    padding-left: 1.61em;
}

.km-android .km-list fieldset .km-inline-field:first-of-type {
    padding-left: 0;
}

.km-android .km-inline-field.km-label-above {
    margin-bottom: 0;
}

.km-android {
    .km-list {
        .km-inline-field {
            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,
            textarea  {
                left: 0;
                padding-left: 0;
                padding-left: 1em;
            }
        }
    }
}

.km-android {
    .km-list {
        .km-inline-field:first-of-type {
            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,
            textarea  {
                margin-left: 0;
                padding-left: 0;
            }
        }
    }
}

.km-android .km-list .km-full-width-slider {
    margin-top: 0;
    padding: 1.55em 0;
}

// Standalone Checkboxes and RadioButtons
.km-android .km-checkbox-label,
.km-android .km-radio-label {
    font-size: 1em;
    line-height: 1.5em;
    margin-left: .89em;
}

.km-android .km-checkbox-label:before,
.km-android .km-checkbox-label:after {
    right: .7em;
    width: 1.07rem;
    height: 1.07rem;
    text-align: right;
    font-size: 1.5em;
}

.km-android .km-checkbox-label:before {
    border-width: 0.133rem;
    border-style: solid;
}

//Radio buttons
.km-android .km-radio-label {
    padding-left: 2.5em;
    line-height: 1.5em;
}

.km-android .km-radio-label:before {
    width: 1.07rem;
    height: 1.07rem;
    border-width: 0.133rem;
    border-style: solid;
}

.km-android input.km-radio:checked + .km-radio-label:after {
    border-width: 2px;
    border-style: solid;
    top: 45%;
}

.km-android input.km-radio:checked + .km-radio-label:after {
    width: .55rem;
    height: .55rem;
    left: 0.2rem;
}
