@import 'vars';
@import 'field-repeater';
@import 'field-group';
@import 'field-typography';
@import 'field-file';
@import 'field-textfield';

.tpfw_form_row{
    &{
        padding: 16px 0px 16px 0px;
        border-top: 1px solid #f1f1f1;
    }
    &:first-of-type{
        border-top: none;
        padding-top: 10px;
    }
    .col-label,.col-field{
        float: left;
    }
    .col-label{
        width: 25%;
        color: #777;
    }
    .col-field{
        width: 75%;
    }
    &:after{
        @extend %clearfix;
    }
    .description{
        display: block;
        color: #666;
        font-size: 13px;
        font-style: italic;
        margin-top: 4px;
    }
    .tpfw-checkboxes,.tpfw-radios{
        &{
            padding: 0;
            margin: 0;
        }
        li{
            list-style: none;
            display: block;
            span{
                margin-left: 2px;
            }
        }
        &.inline{
            li{
                display: inline;
                margin-right: 15px;
            }
        }
    }
}

.tpfw-image_picker{

    .attached_images{
        &:after{
            @extend %clearfix;
        }
    }

    .image_list{
        &{
            margin: 0;
            padding: 0;
            cursor: move;
            float: left;
            width: auto;
        }
        &:after{
            @extend %clearfix;
        }
        li{
            &{
                position: relative;
                background: #F5F5F5;
                padding: 0;
                float: left;
                margin: 0 5px 5px 0;
                height: 80px;
                width: 80px;
                line-height: 75px;
                text-align: center;
                border: 1px solid #DFDFDF;
                overflow: hidden;
            }

            .inner{
                width: 80px;
                height: 80px;
                overflow: hidden;
                text-align: center;
            }
            .remove{
                @extend %remove_icon;
                top: 50%;
                left: 50%;
                -webkit-transform: translate(-50%,-50%);
                -ms-transform: translate(-50%,-50%);
                transform: translate(-50%,-50%);
            }

            img{
                max-height: 80px;
                display: inline-block;
                vertical-align: middle;
                width: auto;
                height: auto;
            }
        }

    }

    .add_images{
        color: #C8C8C8;
        border-color: #C8C8C8;
        text-decoration: none;

        margin-top: 0;
        display: block;
        float: left;
        height: 80px;
        width: 80px;
        background: url(../images/add.png) center center no-repeat #F5F5F5;
        border: 1px solid #DFDFDF;
        font-size: 0;
        &:hover{
            color: #C8C8C8;
            border-color: #C8C8C8;
            text-decoration: none;
        }
    }
}

.tpfw-image_background{
    &{
        width: 600px;
        max-width: 100%;
    }
    .attachment-media-view{
        &{
            background-size: cover;
            background-repeat: no-repeat;
            background-position: center;
            position:relative;
        }
        .remove{
            @extend %remove_icon;
            top: 50%;
            left: 50%;
            -webkit-transform: translate(-50%,-50%);
            -ms-transform: translate(-50%,-50%);
            transform: translate(-50%,-50%);
            display: none;

        }
    }

    .placeholder{
        &{
            width: 100%;
            position: relative;
            text-align: center;
            cursor: default;
            border: 1px dashed #b4b9be;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            padding: 40px 0;
            line-height: 20px;
            font-size: 14px;
            background-color: #fbfbfb;
        }
    }

    .added{
        .placeholder{
            opacity: 0;
            visibility: hidden;
        }
        .remove{
            display: block;
        }
    }

    .button {
        float: right;
        margin-top: 10px;
        margin-left: 10px;
    }
}

.tpfw-image_select{
    &{
        margin: -6px 0 0 0;
        padding: 0;
    }
    label{
        &{
            display: inline-block;
            margin-right: 6px;
            margin-top: 6px;
        }
        input{
            display: none;
        }
        span{
            display: block;
            -webkit-box-shadow: inset 0 0 0 0px #fff,inset 0 0 0 1px #DFDFDF;
            box-shadow: inset 0 0 0 0px #fff,inset 0 0 0 1px #DFDFDF;
            padding: 3px;
        }
        input[type="radio"]:checked+span{
            -webkit-box-shadow: inset 0 0 0 0px #fff,inset 0 0 0 3px #0073aa;
            box-shadow: inset 0 0 0 0px #fff,inset 0 0 0 3px #0073aa;
        }
        img{
            display: block;
            max-width: 100%;
        }
        &:hover{
            span{
                -webkit-box-shadow: inset 0 0 0 0px #fff,inset 0 0 0 1px #0073aa;
                box-shadow: inset 0 0 0 0px #fff,inset 0 0 0 1px #0073aa;
            }
        }
    }
}

.tpfw-icon_picker{

    .icons-selector .selector-search i{
        top:12px;
    }

}

.tpfw-link{
    &{
        color: #666;
    }
    .link_label{
        font-weight: 700;
        margin-left: 10px;
        display: inline-block;
        line-height: 28px;
        color: #333;
    }
    .url-label{
        color: #0073aa;
    }
}

.tpfw-map{
    &{
        position: relative;
    }
    .map_search{
        &{
            position: absolute;
            top: 10px;
            right: 10px;
            background: #fff;
            padding: 3px;
            border-radius: 3px;
            opacity: 1;
            z-index:9;
            box-shadow: 1px 1px 1px rgba(0,0,0,.2);
        }

        input{
            width: 260px;
            max-width: 100%;
            border: none;
            box-shadow: none;
            border-right: 1px solid #eee;
            background: transparent;
        }
        i{
            color: #333;
            font-size: 14px;
            margin: 0px 7px 0px 5px;
            position: relative;
            top: -1px;
        }
    }
    .map_canvas{
        height: 350px;
        background-color: #ccc;
    }
}

.tpfw-datetime{
    &{
        display: inline-block;
        border: 1px solid #ddd;
        -webkit-box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
        box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
        background-color: #fff;
        outline: none;
        -webkit-transition: 0.05s border-color ease-in-out;
        transition: 0.05s border-color ease-in-out;
        position: relative;
        cursor: pointer;
    }
    &:hover{
        i{
            opacity: .8;
        }
    }
    i{
        display: inline-block;
        margin: 0px 0px 0px 0px;
        position: absolute;
        top: 3px;
        right: 6px;
        z-index: 0;
        height: 20px;
        border-left: 1px solid #e5e5e5;
        padding-left: 8px;
        line-height: 20px;
        padding-right: 2px;
    }
    input{
        background-color: transparent;
        outline: none;
        border: none!important;
        box-shadow: none;
        position: relative;
        z-index: 1;
        padding-right: 30px;
        cursor: pointer;
        &:focus{
            border: none;
            box-shadow: none;
        }
    }
}

.tpfw-checkbox{
    margin-top: -4px!important;
}

.tpfw-checkbox + .description{
    display: inline;
    margin-left: 5px;
}


#side-sortables,
.widget-inside,
#menu-to-edit{
    .tpfw_form_row{
        &{
            margin: 1em 0;
            padding:0;
            border:none;
        }

        .col-label{
            &{
                float: none;
                width: auto;
            }
            label{
                font-size: 13px;
                line-height: 1.5;
                display: block;
                margin-bottom: 4px;
                color: #333;
            }
        }
        .col-field{
            &{
                width: auto;
                width: 100%;
            }
            select{
                width: 100%;
            }


        }
        .description{
            padding: 0!important;
            font-style: italic;
            font-size: 12px
        }

        .tpfw-checkboxes,
        .tpfw-radios{
            padding: 10px;
            margin: 5px 0px;
            background: #f3f3f3;
            border-radius: 3px;
            box-shadow: 0px 1px 4px rgba(0,0,0,.1) inset;
            width: auto;
        }

        .tpfw-image_background .placeholder{
            font-size: 12px;
            a{
                display: block;
            }
        }

        .tpfw-link{
            font-size: 12px;
            .link_button{
                display: inline-block;
                margin-bottom: 5px;
            }
        }

        .tpfw-image_picker{
            .image_list li,.add_images{
                width: 76px;
                height: 76px;
                outline: none;
            }
        }

        .tpfw-checkbox{
            &+label{
                position: relative;
                top: -2px;
            }
        }

        .tpfw-select{
            display: block;
            width: 100%;
        }
    }

}

#menu-to-edit{
    .tpfw_form_row{
        &{
            margin: 5px 12px 5px 0px;
        }
        &:first-of-type{
            clear: both;
        }
        .col-label{
            &{
                float: none;
                width: auto;
            }
            label{
                font-style: italic;
                margin-bottom: 2px;
                color: #666;
            }
        }
        .description {
            margin-top: 0px;
        }
        &--checkbox{
            padding-top: 9px;
        }
    }
}

#side-sortables,
#menu-to-edit,
.widget-liquid-right,
.customize-control{
    .tpfw-map{

        &:after{
            @extend %clearfix;
        }
        .map_search{
            &{
                position: initial;
                border: 1px solid #ddd;
                padding-right: 32px;
                margin-bottom: 10px;
                border-radius: 0;
                -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
                box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
                padding-top: 2px;
            }
            input{
                width: 100%;
                overflow: hidden;
                height: 21px;
            }
            i{
                display: block;
                position: absolute;
                right: 3px;
                top: 7px;
            }
        }
        .map_canvas {
            width: 100%;
            height: 220px;
        }
    }
}

#addtag,#edittag{
    .tpfw_form_row{
        &{
            padding-top: 10px;
            padding-bottom: 10px;
            padding-right: 5%;
        }
        .col-label,.col-field{
            float: none;
            width: auto;
        }
        .col-label{
            &{
                margin-bottom: 2px;
            }
            label{
                color: #23282d;
            }
        }

    } 
}
/*
Not use this since WP 4.8

#edittag{
    .tpfw_form_row{
        &{
            padding-right: 5%;

        }

        &>td{
            padding-right: 5%;

            &>input[type=text], 
            &>input[type=password], 
            &>input[type=email], 
            &>input[type=number], 
            &>input[type=search], 
            &>input[type=tel], 
            &>input[type=url], 
            &>textarea{
                width: 100%;
            }
        }
    }
}*/

.customize-control{
    .tpfw-icon_picker{
        .icons-selector{
            .selector-popup{
                width: 257px;
            }
            .fip-box{
                width: 55px
            }
        }
    }
    select{
        width: 100%;
    }

    .tpfw-link{
        .link_button{
            margin-bottom: 5px;
        }
    }
}

#advanced-sortables{
    .tpfw-image_background{
        width: 100%;
    }
}

.select2-container{
    .selection{
        .select2-selection.select2-selection--multiple{
            border: 1px solid #ddd;
            -webkit-box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
            box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
            background-color: #fff;
            color: #32373c;
            outline: none;
            border-radius: 0;
            ul{
                &{
                    margin: 0;
                    display: block;
                }
                .select2-selection__choice{
                    &{
                        padding: 3px 10px 3px 6px;
                        margin: 3px 2px 1px 2px;
                        border-radius: 2px;
                        background-color: #ccc;
                        border: none;
                    }

                    .select2-selection__choice__remove{
                        width: 13px;
                        height: 13px;
                        line-height: 11px;
                        border-radius: 6px;
                        background-color: #999;
                        color: #fff;
                        text-align: center;
                        font-size: 11px;
                        box-shadow: 0px 1px 1px #ddd;
                        position: relative;
                        top: -1px;
                        margin-right: 5px;
                        &:hover{
                            background-color: #777;
                        }
                    }
                    &:after{
                        @extend %clearfix;
                    }
                }
            }


        }
    }
}

.select2-container{
    .select2-container--default .select2-search--inline .select2-search__field{
        padding-top: 6px;
    }
    &.select2-container--open{
        .select2-dropdown{
            &{
                border: 1px solid #ddd;
                -webkit-box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
                box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
                border-radius: 0;
            }
            ul{
                li{
                    &{
                        margin: 0;
                        padding-left:10px;
                        padding-right:10px;
                    }
                    &.select2-results__option[aria-selected=true]{
                        background-color: #ccc;
                    }

                }
            }
        }

    }
}

.customize-control{
    .tpfw-datetime{
        input[type="text"]{
            width: auto;
        }
    }
}

.xdsoft_datetimepicker{
    z-index: 9999999!important;
}

.tpfw-field {
    &.selectize-control.multi .selectize-input > div{
        padding: 2px 6px 5px 6px;
    }
    .icons-selector .selector{
        width: 101px;
        &:after{
            @extend %clearfix;
        }
        .selector-button{
            float: right;
            border-left-color:#e9e9e9;
        }
    }
    &.tpfw-icon_picker{
        select{
            height: auto!important;
        }
    }

    .selectize-control.single .selectize-input, .selectize-dropdown.single,.selectize-input{
        border-color: #ddd;
        -webkit-box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
        box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
        background: #fff;
        border-radius: 0;
        padding: 7px 10px;
    }
    &.size-medium{
        width: 500px;
        max-width: 100%;
    }
    &.tpfw-autocomplete{
        select{
            display: none;
        }
    }
}
.customize-pane-child{
    height: 100%!important;
}
.custom_code{
    border-right: 0;
    border-left: 0;
    height: -webkit-calc(100vh - 185px);
    height: calc(100vh - 185px);
    resize: none;
    display: block;
    font-family: Consolas,Monaco,monospace;
    font-size: 12px;
    padding: 6px 8px;
    -moz-tab-size: 4;
    -o-tab-size: 4;
    tab-size: 4;
    direction: ltr;
    unicode-bidi: embed;
}

.form-field{
    .selectize-control{
        width: 95%;
    }
}

.customize-control.customize-control-heading{
    margin-bottom: 0px;
}

.tpfw-controlbox{
    float: left;
    margin: 0;
    font-size: 14px;
    padding: 8px 4px 8px 12px;
    line-height: 1.4;
    font-weight: 500;
    position: relative;
    z-index: 9;
    input{
        margin-left: 3px;
    }
}

.postbox--disabled,
.group-disabled{
    .inside,.tpfw_group{
        &{
            position: relative;
        }
        &:before{
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(255,255,255,.6);
            content: '';
            z-index: 15;
            transition: .3s;
        }
    }
}