/**
 * Stylesheet
 *
 * @namespace LUNGO.Widgets
 * @class Form
 *
 * @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
 */

@import "constants.less";
@import "mixins.less";

@input-height: 29px;

form, .form { }

label {
    font-size: 0.9em;
}

input:not([type=checkbox]), textarea, select {
    display: block;
    width: 97%;
    margin: 0 0 2px;
    padding: 0% 1.5% ;
    height: @input-height;
    font-size: 14px;
    font-weight: bold;

    -webkit-appearance: none;
    -webkit-user-select: text;
    -webkit-font-smoothing: antialiased;
}


/* @group search */
input[type=search] {
    width: 86%;

    & + .button {
        float: right;
        padding: 0px;
        width: 32px;
        height: 30px;

        & .icon {
            font-size: 22px !important;
            line-height: 30px;
        }
    }
}
/* @end */

/* @group select */

select {
    width: 100%;
    height: @input-height;
}

label.select {
    position: relative;
    display: inline-block;
    width: 100%;
}

.select:after {
    text-align: center;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    height: @input-height;
    width: @input-height;

    content: "▼";
    pointer-events:none;
    line-height: 31px;
}

.no-pointer-events .select:after {
    content: none;
}

/* @end */


/* @group switch */

input[type="checkbox"], input[type="radio"]{
    width: 82px;
    height: @input-height;
    z-index: 2;
}

input[type="checkbox"] + span::after,
   input[type="radio"] + span::after {
    content: "OFF";
}

input[type="checkbox"]:checked + span::after,
   input[type="radio"]:checked + span::after {
    content: "ON";
}

input[type="checkbox"] + span,
   input[type="radio"] + span,
   input[type="checkbox"] + span::before,
   input[type="radio"] + span::before,
   input[type="checkbox"] + span::after,
   input[type="radio"] + span::after {
    display: inline-block;
}

input[type="checkbox"] + span::before,
   input[type="radio"] + span::before,
   input[type="checkbox"] + span::after,
   input[type="radio"] + span::after,
   input[type="checkbox"]:checked + span::before,
   input[type="radio"]:checked + span::before,
   input[type="checkbox"]:checked + span::after,
   input[type="radio"]:checked + span::after {
    top: 0;
}

input[type="checkbox"] + span::after,
   input[type="radio"] + span::after,
   input[type="checkbox"]:checked + span::before,
   input[type="radio"]:checked + span::before {
    right: 0;
}

input[type="checkbox"] + span::before,
   input[type="radio"] + span::before,
   input[type="checkbox"]:checked + span::after,
   input[type="radio"]:checked + span::after {
    left: 0;
}

input[type="checkbox"],
   input[type="radio"],
   input[type="checkbox"] + span::before,
   input[type="radio"] + span::before,
   input[type="checkbox"] + span::after,
   input[type="radio"] + span::after {
    position: absolute;
}

input[type="checkbox"],
   input[type="radio"] {
    -webkit-opacity: 0;
    opacity: 0;
}

input[type="checkbox"] + span,
   input[type="radio"] + span {
    width: 82px;
    height: 27px;
    position: relative;
    font-size: 11px;
    line-height: @input-height;
    font-weight: bold;
    text-transform: uppercase;
    text-indent: -9999px;
}

input[type="checkbox"] + span::before,
   input[type="radio"] + span::before {
    content: "";
    width: 41px;
    height: 27px;
}

input[type="checkbox"] + span::after,
   input[type="radio"] + span::after {
    text-indent: 0;
    width: 41px;
    height: 27px;
    text-align: center;
}

input[type="checkbox"]:checked + span::before,
   input[type="radio"]:checked + span::before {
    left: auto;
}

input[type="checkbox"]:checked + span::after,
   input[type="radio"]:checked + span::after {
    height: 27px;
}
/* @end */

/* @group range */
input[type="range"] {
    -webkit-appearance: none;
    height: 15px;
    width: 100%;
    outline: none;
    position: relative;
    padding: 0px;
    margin: 0px;
    border: 0;
    cursor: ew-resize;

    &::-webkit-slider-thumb {
        -webkit-appearance: none;
        position: relative;
        z-index: 1;

        top:-1px;
        width: 24px;
        height: 24px;
    }
}
/* @end */

/* @group progress */
.progress {
    width: 100%;
    margin-bottom: 8px;

    .labels {

        font-size: 1.0em;
        display: block;
        & span:last-child { float: right; }
    }

    & .bar {
        height:  15px;
        line-height: 15px;
        display: block;

        & .value {
            display:block;
            height: inherit;
            width: 0%;
            -webkit-transition: width 500ms @defaultTrasition;

            & .label {
                float: right;
                margin-right: 4px;
                font-size: 0.75em;
            }
        }
    }
}

.big .progress .bar {
    height:  @input-height;
    line-height: 30px;
}
/* @end */


@media screen and (-webkit-min-device-pixel-ratio:0) {
    .custom-select select {padding-right:30px;}
}