﻿
.cmn-toggle {
    position: absolute;
    margin-left: -9999px;
    opacity: 0;
}

    .cmn-toggle + label.cb {
        display: block;
        position: relative;
        cursor: pointer;
        outline: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

/* ============================================================
  SWITCH 1 - ROUND
============================================================ */
input.cmn-toggle-round + label.cb {
    padding: 2px;
    width: 120px;
    height: 60px;
    background-color: #dddddd;
    -webkit-border-radius: 60px;
    -moz-border-radius: 60px;
    -ms-border-radius: 60px;
    -o-border-radius: 60px;
    border-radius: 60px;
}

    input.cmn-toggle-round + label.cb.small {
        height: 25px;
        width: 60px;
    }

    input.cmn-toggle-round + label.cb:before, input.cmn-toggle-round + label.cb:after {
        display: block;
        position: absolute;
        top: 1px;
        left: 1px;
        bottom: 1px;
        content: "";
    }

    input.cmn-toggle-round + label.cb:before {
        right: 1px;
        background-color: #f1f1f1;
        -webkit-border-radius: 60px;
        -moz-border-radius: 60px;
        -ms-border-radius: 60px;
        -o-border-radius: 60px;
        border-radius: 60px;
        -webkit-transition: background 0.4s;
        -moz-transition: background 0.4s;
        -o-transition: background 0.4s;
        transition: background 0.4s;
    }

    input.cmn-toggle-round + label.cb:after {
        width: 58px;
        background-color: #fff;
        -webkit-border-radius: 100%;
        -moz-border-radius: 100%;
        -ms-border-radius: 100%;
        -o-border-radius: 100%;
        border-radius: 100%;
        /*-webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
        -moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);*/
        -webkit-transition: margin 0.4s;
        -moz-transition: margin 0.4s;
        -o-transition: margin 0.4s;
        transition: margin 0.4s;
    }

input.cmn-toggle-round:checked + label.cb:before {
    background-color: #8ce196;
}

input.cmn-toggle-round:checked + label.cb:after {
    margin-left: 60px;
}

input.cmn-toggle-round:checked + label.cb.small::after {
    margin-left: 33px;
}

/* ============================================================
  SWITCH 2 - ROUND FLAT
============================================================ */
input.cmn-toggle-round-flat + label.cb {
    padding: 2px;
    width: 120px;
    height: 60px;
    background-color: #dddddd;
    -webkit-border-radius: 60px;
    -moz-border-radius: 60px;
    -ms-border-radius: 60px;
    -o-border-radius: 60px;
    border-radius: 60px;
    -webkit-transition: background 0.4s;
    -moz-transition: background 0.4s;
    -o-transition: background 0.4s;
    transition: background 0.4s;
}

    input.cmn-toggle-round-flat + label.cb:before, input.cmn-toggle-round-flat + label.cb:after {
        display: block;
        position: absolute;
        content: "";
    }

    input.cmn-toggle-round-flat + label.cb:before {
        top: 2px;
        left: 2px;
        bottom: 2px;
        right: 2px;
        background-color: #fff;
        -webkit-border-radius: 60px;
        -moz-border-radius: 60px;
        -ms-border-radius: 60px;
        -o-border-radius: 60px;
        border-radius: 60px;
        -webkit-transition: background 0.4s;
        -moz-transition: background 0.4s;
        -o-transition: background 0.4s;
        transition: background 0.4s;
    }

    input.cmn-toggle-round-flat + label.cb:after {
        top: 4px;
        left: 4px;
        bottom: 4px;
        width: 52px;
        background-color: #dddddd;
        -webkit-border-radius: 52px;
        -moz-border-radius: 52px;
        -ms-border-radius: 52px;
        -o-border-radius: 52px;
        border-radius: 52px;
        -webkit-transition: margin 0.4s, background 0.4s;
        -moz-transition: margin 0.4s, background 0.4s;
        -o-transition: margin 0.4s, background 0.4s;
        transition: margin 0.4s, background 0.4s;
    }

input.cmn-toggle-round-flat:checked + label.cb {
    background-color: #8ce196;
}

    input.cmn-toggle-round-flat:checked + label.cb:after {
        margin-left: 60px;
        background-color: #8ce196;
    }

/* ============================================================
  SWITCH 3 - YES NO
============================================================ */
input.cmn-toggle-yes-no + label.cb {
    padding: 2px;
    width: 100px;
    height: 40px;
}

    input.cmn-toggle-yes-no + label.cb:before, input.cmn-toggle-yes-no + label.cb:after {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        color: #9D9DA2;
        font-family: Tahoma;
        font-size: 15px;
        text-align: center;
        line-height: 40px;
        border: 1px solid #1b7d9a;
        font-weight: bold;
    }

    input.cmn-toggle-yes-no + label.cb:before {
        background-color: #dddddd;
        content: attr(data-off);
        border: solid 1px;
        -webkit-transition: -webkit-transform 0.5s;
        -moz-transition: -moz-transform 0.5s;
        -o-transition: -o-transform 0.5s;
        transition: transform 0.5s;
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        -ms-backface-visibility: hidden;
        -o-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    input.cmn-toggle-yes-no + label.cb.warning:before {
        background-color: #f0ad4e;
        border: solid 1px #E0952B;
        color: white;
    }

    input.cmn-toggle-yes-no + label.cb:after {
        background-color: #5bc0de;
        content: attr(data-on);
        -webkit-transition: -webkit-transform 0.5s;
        -moz-transition: -moz-transform 0.5s;
        -o-transition: -o-transform 0.5s;
        transition: transform 0.5s;
        -webkit-transform: rotateY(180deg);
        -moz-transform: rotateY(180deg);
        -ms-transform: rotateY(180deg);
        -o-transform: rotateY(180deg);
        transform: rotateY(180deg);
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        -ms-backface-visibility: hidden;
        -o-backface-visibility: hidden;
        backface-visibility: hidden;
    }

input.cmn-toggle-yes-no:checked + label.cb:before {
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    -ms-transform: rotateY(180deg);
    -o-transform: rotateY(180deg);
    transform: rotateY(180deg);
    color: white;
}

input.cmn-toggle-yes-no:checked + label.cb:after {
    -webkit-transform: rotateY(0);
    -moz-transform: rotateY(0);
    -ms-transform: rotateY(0);
    -o-transform: rotateY(0);
    transform: rotateY(0);
    color: white;
}

input.cmn-toggle-round.small + label.cb, input.cmn-toggle-round-flat.small + label.cb {
    height: 30px;
    width: 55px;
}

input.cmn-toggle-round.small:checked + label.cb::after, input.cmn-toggle-round-flat.small:checked + label.cb::after {
    margin-left: 24px;
}

input.cmn-toggle-round + label.cb.small::after {
    width: 25px;
}

input.cmn-toggle-round-flat.small + label.cb::after {
    width: 24px;
}


input.cmn-toggle-round.b-square + label.cb::before, input.cmn-toggle-round-flat.b-square + label.cb::before {
    -webkit-border-radius: 0px;
    -moz-border-radius: 0px;
    -ms-border-radius: 0px;
    -o-border-radius: 0px;
    border-radius: 0px;
}

input.cmn-toggle-round.b-square + label.cb:after, input.cmn-toggle-round-flat.b-square + label.cb:after {
    height: 25px;
    margin-top: 1px;
    width: 25px;
    -webkit-border-radius: 0px;
    -moz-border-radius: 0px;
    -ms-border-radius: 0px;
    -o-border-radius: 0px;
    border-radius: 0px;
}



input.cmn-toggle-round.b-square + label.cb, input.cmn-toggle-round-flat.b-square + label.cb {
    border-radius: 0px;
}

.switch[disabled='disabled'], .switch[disabled='disabled'] label.cb {
    cursor: not-allowed;
}

.non-switch {
    position: relative;
    width: 25px;
}

    .non-switch label.cb {
        background: #eee none repeat scroll 0 0;
        border: 1px solid #ddd;
        cursor: pointer;
        left: 0;
        position: absolute;
        top: 0;
        height: 25px;
        width: 25px;
        transition: background 0.4s;
        margin-top: 2px;
    }

        .non-switch label.cb.small {
            height: 15px;
            width: 15px;
        }

            .non-switch label.cb.small::after {
                height: 5px;
                left: 1px;
                top: 2px;
                width: 10px;
            }

        .non-switch label.cb.b-round {
            border-radius: 0.25rem;
            border: 1px solid #b1b1b1;
            box-shadow: 0 0.125rem 0.125rem rgba(0, 0, 0, 0.1) inset;
        }

        .non-switch label.cb::after {
            -moz-border-bottom-colors: none;
            -moz-border-left-colors: none;
            -moz-border-right-colors: none;
            -moz-border-top-colors: none;
            background: transparent none repeat scroll 0 0;
            border-image: none;
            border-style: none none solid solid;
            border-width: medium medium 3px 3px;
            height: 8px;
            left: 5px;
            opacity: 0.5;
            position: absolute;
            top: 5px;
            transform: rotate(-51deg);
            width: 14px;
        }

        .non-switch label.cb:hover::after {
            opacity: 1;
        }

    .non-switch input[type="checkbox"]:checked + label.cb::after {
        content: "";
        border-color: #5bc0de  #5bc0de;
        transition: background 0.4s;
    }

    .non-switch.default input[type="checkbox"]:checked + label.cb::after {
        border-color: #585857 #585857;
    }

    .non-switch.violet input[type="checkbox"]:checked + label.cb {
        background-color: #4e148f;
        box-shadow: none;
        border: solid 1px #430984;
    }


    .non-switch input[type="checkbox"]:checked + label.cb::after {
        opacity: 1;
    }

    .non-switch.default input[type="checkbox"]:checked + label.cb {
        transition: background 0.4s;
    }

    .non-switch.success input[type="checkbox"]:checked + label.cb {
        background: #14c328 none repeat scroll 0 0;
        border: 1px solid #2bc145;
        transition: background 0.4s;
    }

    .non-switch.warning input[type="checkbox"]:checked + label.cb {
        background: #f39c12 none repeat scroll 0 0;
        border: 1px solid #e08e0b;
        transition: background 0.4s;
    }

    .non-switch input[type='checkbox'], .non-switch input[type='radiobox'] {
        position: absolute;
        opacity: 0;
        height: 100%;
        z-index: 100;
        width: 100%;
        cursor: pointer;
        margin: 0px;
    }

        .non-switch input[type='checkbox']:disabled, .non-switch input[type='radiobox']:disabled {
            cursor: not-allowed;
        }

    .non-switch label.text {
        font-weight: 100;
        left: 28px;
        position: absolute;
        margin-top: 2px;
    }

    .non-switch.violet label.text {
        left: 20px;
        margin-top: 1px;
    }

    .non-switch + .non-switch {
        margin-top: 10px;
    }

    .non-switch input.error + label.cb {
        background-color: #fde1e1;
        border: 1px solid #d27f74 !important;
    }

    .non-switch input.violet:focus + label.cb {
        border-color: #4e148f !important;
        outline: none;
        box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(70, 20, 143, 0.6) !important;
    }

.cmn-toggle-yes-no:focus + label.cb,
.cmn-toggle-yes-no:active + label.cb {
    outline: 1px dotted;
}

.non-switch[tristate='1'] label.cb {
    background: #6D419E none repeat scroll 0 0;
}

.non-switch.violet label.text {
    /*width: 220px;*/
}

.non-switch.violet {
    /*position: absolute;
    left: 20px;*/
    margin-right: 5px;
}
