/* !
 * Created by Henry Yang @ 2017/04/24
 * MIT License
 */


@font-face {font-family: "iconfont";
    src: url('./../fonts/iconfont.eot?t=1493125550931'); /* IE9*/
    src: url('./../fonts/iconfont.eot?t=1493125550931#iefix') format('embedded-opentype'), /* IE6-IE8 */
    url('./../fonts/iconfont.woff?t=1493125550931') format('woff'), /* chrome, firefox */
    url('./../fonts/iconfont.ttf?t=1493125550931') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
    url('./../fonts/iconfont.svg?t=1493125550931#iconfont') format('svg'); /* iOS 4.1- */
}

.iconfont {
    font-family:"iconfont" !important;
    font-size:16px;
    font-style:normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.icon-clock:before { content: "\e6c2"; }



$dts: '.datetime-selector';
$selectorBasicColor: #ccc;
$selectorBorder: 1px solid $selectorBasicColor;

%clearfix{
    &:before,
    &:after{
        content: '';
        display: table;
        line-height: 0;
    }
    &:after{
        clear:both;
    }
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#{$dts}{
    position: relative;
    &-wrapper{
        @extend %clearfix;
    }
    &-item{
        @extend %clearfix;
        float: left;
        width: 100%;
        height: 36px;
        border: $selectorBorder;
        border-radius: 2px;
    }
    &-input{
        float: left;
        width: calc(100% - 36px);
        height: 100%;
        padding-left: 13px;
        border: none;
        outline: none;
        font-size: 14px;
        color: #333;
    }
    &-tools{
        float: right;
        width: 36px;
        height: 100%;
        border-left: $selectorBorder;
    }
    &-scrollers{
        position: absolute;
        top: 36px;
        width: 100%;
        border: 1px solid #e5e5e5;
        border-radius: 2px;
        background-color: #fff;
        box-shadow: 1px 1px 1px 1px rgba(232, 232, 232, 0.6);
        color: #666;
        z-index: 9999;
        &:before{
            content: "";
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: transparent;
        }
        .dts-scrollers-wrapper{
            @extend %clearfix;
            position: relative;
            .dts-scrollers-mask{
                position: absolute;
                top: 42px;
                left: 0;
                width: 100%;
                height: 42px;
                background-color: #f3f3f3;
                z-index: -1;
            }
        }
        .dts-scrollers-list,
        .dts-scrollers-seperator{
            list-style: none;
            color: #ccc;
            & > li{
                height: 42px;
                line-height: 42px;
                &.active{
                    color: #666;
                    cursor: pointer;
                }
            }
        }
        .dts-scrollers{
            &-item{
                float: left;
            }
            &-time{
                width: calc((100% - 10px) / 3);
                li{
                    text-align: center;
                }
            }
            &-header{
                @extend %clearfix;
                border-bottom: 1px solid #e5e5e5;
                z-index: 10;
                &-item{
                    float: left;
                    width: 50%;
                    padding: 7px 0;
                    text-align: center;
                }
            }
            &-body{
                @extend %clearfix;
                height: 126px;
                overflow-y: hidden;
                z-index: 10;
                .dts-scrollers-wrapper{

                }
            }
        }
        &.dts-scrollers-combined{
            .dts-scrollers-wrapper{
                float: left;
                width: 50%;
                &:first-child{
                    border-right: 1px solid #e5e5e5;
                }
            }
        }
    }
    &.t-basic{
        .datetime-selector-item{
            width: calc(96% / 3);
            & + .datetime-selector-item{
                margin-left: 2%;
            }
        }
        #{$dts}-input{
            width: calc(100% - 20px);
            text-align: center;
        }
        #{$dts}-tools{
            width: 20px;
            i{
                position: relative;
                height: 50%;
                &:after{
                    content: '';
                    position: absolute;
                    top: 50%;
                    left: 50%;
                    transform: translate(-50%, -50%);
                    border-left: 5px solid transparent;
                    border-right: 5px solid transparent;
                }
            }
            #{$dts}-add{
                &:after{
                    border-bottom: 6px solid $selectorBasicColor;
                }
            }
            #{$dts}-minus{
                &:after{
                    border-top: 6px solid $selectorBasicColor;
                }
            }
        }
    }
    &.t-simple{
        #{$dts}-item{
            width: 100%;
        }
    }
    &.t-range{
        #{$dts}-item{
            width: 49%;
            &:first-child{
                margin-right: 1%;
            }
            &:last-child{
                margin-left: 1%;
            }
        }
    }
    #{$dts}-tools{
        i{
            display: block;
            width: 100%;
            cursor: pointer;
            &:hover{
                background-color: #f5f5f5;
            }
        }
    }
    #{$dts}-clock{
        height: 100%;
        color: #999;
        font-size: 24px;
        text-align: center;
        line-height: 34px;
    }
    .hidden{
        display: none;
    }
}
