@import "check";

@mixin clearfix{
    &:after {
        clear: both;
        content: "";
        display: block;
    }
}

@mixin for_mobile(){
    @media screen and (max-width: 80em){
        @content;
    }
}

@mixin for_small_mobile(){
    @media screen and (max-width: 560px){
        @content;
    }
}

.cs-hide {
    visibility: hidden;
    height: 0px;
    overflow: hidden;
    display: block;
}
.cs-clear{
    clear: both;
}

.wp-filter {
    display: inline-block;
    position: relative;
    margin: 12px 0 25px;
    padding: 0 10px;
    width: 100%;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    border: 1px solid #e5e5e5;
    background: #fff;
    color: #555;
    font-size: 13px;
    box-sizing: border-box;
}

.filter-count {
    display: inline-block;
    vertical-align: middle;
    min-width: 4em;
}
.filter-count .count {
    display: inline-block;
    position: relative;
    top: -1px;
    padding: 4px 10px;
    border-radius: 30px;
    background: #72777c;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.filter-links {
    display: inline-block;
    margin: 0;
    li {
        display: inline-block;
        margin: 0;
        > a {
            margin: 0 10px;
            padding: 15px 0;
            border-bottom: 4px solid #fff;
            color: #666;
            cursor: pointer;
        }
    }
}

.wp-filter .search-form {
    float: right;
    margin: 10px 0;
    input[type=search] {
        margin: 0;
        padding: 3px 5px;
        width: 280px;
        max-width: 100%;
        font-size: 16px;
        font-weight: 300;
        line-height: 1.5;
        -webkit-appearance: textfield;
    }
}

.theme-browser .themes {
    clear: both;
}

.theme-browser .theme {
    cursor: pointer;
    float: left;
    margin: 0 4% 4% 0;
    position: relative;
    width: 30.6%;
    border: 1px solid #ddd;
    box-shadow: 0 1px 1px -1px rgba(0,0,0,.1);
    box-sizing: border-box;
    .theme-screenshot {
        display: block;
        overflow: hidden;
        position: relative;
        -webkit-backface-visibility: hidden;
        transition: opacity .2s ease-in-out;
        &:after {
            content: "";
            display: block;
            padding-top: 100%;
        }
    }
    .theme-id-container {
        position: relative;
    }
    .theme-name {
        font-size: 15px;
        font-weight: 600;
        height: 18px;
        margin: 0;
        padding: 15px;
        box-shadow: inset 0 1px 0 rgba(0,0,0,.1);
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        background: #fff;
        background: rgba(255,255,255,.65);
    }
    .theme-actions {
        position: absolute;
        top: 50%;
        -webkit-transform: translateY(-50%);
        transform: translateY(-50%);
        right: 0;
        padding: 10px 15px;
        box-shadow: inset 0 1px 0 rgba(0,0,0,.1);

        opacity: 0;
        transition: opacity .1s ease-in-out;
        height: auto;
        background: rgba(244,244,244,.7);
        border-left: 1px solid rgba(0,0,0,.05);
        .button {
            float: none;
            margin-left: 3px;

        }
        .button-primary {
            margin-right: 3px;
        }
    }

    .button-primary {
        background: #0085ba;
        border-color: #0073aa #006799 #006799;
        box-shadow: 0 1px 0 #006799;
        color: #fff;
        text-decoration: none;
        text-shadow: 0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;
    }
    .button-secondary {
        color: #555;
        border-color: #ccc;
        background: #f7f7f7;
        box-shadow: 0 1px 0 #ccc;
        vertical-align: top;

        display: inline-block;
        text-decoration: none;
        font-size: 13px;
        line-height: 26px;
        height: 28px;
        margin: 0;
        padding: 0 10px 1px;
        cursor: pointer;
        border-width: 1px;
        border-style: solid;
        -webkit-appearance: none;
        border-radius: 3px;
        white-space: nowrap;
    }
}

.customify-sites-show-modal {
    #customify-sites-filter, #customify-sites-listing-wrapper, .wrap {
        opacity: 0;
        height: 0px;
        visibility: hidden;
        display: none;
    }
}
.cs-left {
    float: left;
}
.cs-right {
    float: right;
}
.cs-50 {
    width: 50%;
}

.spinner {
    display: none;
}

$cs-box-gutter: 15px;
$cs-box-border: 1px solid #e5e5e5;
$cs-box-bg: #fff;
$border: $cs-box-border;

.customify-sites-modal-wrapper {
    position: relative;
    height: 0px;
    overflow: hidden;
    visibility: visible;
    width: 99%;
    display: block;
    &.cs-show {
        display: block;
        z-index: 999;
        height: auto;
        visibility: visible;
        overflow: initial;
    }
    img {
        max-width: 100%;
    }
    .cs-modal-outer {
        max-width: 960px;
        margin: 6em auto 3em;
        * {
            box-sizing: border-box;
        }
    }
    .cs-modal {
        background: $cs-box-bg;
        @include clearfix();
        display: flex;
        margin-top: ( $cs-box-gutter*2 );
        //border: $cs-box-border;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
        border-radius: 5px;
        overflow: hidden;
        .cs-info {
            width: 40%;
            padding: $cs-box-gutter;
            border-right: $cs-box-border;
        }
        .cs-thumbnail {
            display: block;
            overflow: hidden;
            position: relative;
            -webkit-backface-visibility: hidden;
            transition: opacity .2s ease-in-out;
            border: $cs-box-border;
            border-radius: 4px;
            img {
                height: auto;
                position: absolute;
                left: 0;
                top: 0;
                width: 100%;
                transition: opacity .2s ease-in-out;
            }
            &:after {
                content: '';
                display: block;
                padding-top: 100%;
            }
        }
        .cs-name {
            font-size: 18px;
            font-weight: 600;
            padding: 20px 0 10px;
            display: inline-block;
        }
        .cs-desc {
            clear: both;
            margin-top: 10px;
        }
        .cs-open-preview {
            float: right;
            margin-top: 16px;
        }
        .cs-main {
            width: 60%;
            position: relative;
            padding: ( $cs-box-gutter * 4 ) $cs-box-gutter ;
        }
        .cs-breadcrumb {
            top: 0px;
            left: 0px;
            width: 100%;
            position: absolute;
            padding: $cs-box-gutter;
            background: $cs-box-bg;
            margin: 0px;
            list-style: none;
            border-bottom: $cs-box-border;
            display: flex;
            li {
                flex-basis: 25%;
                margin-bottom: 0px;
                font-weight: 600;
                line-height: 1;
                color: #cccccc;
                cursor: default;
                &.cs-clickable {
                    cursor: pointer;
                    color: #444444;
                }
            }

        }
        .cs-actions {
            bottom: 0px;
            left: 0px;
            width: 100%;
            position: absolute;
            padding: $cs-box-gutter;
            border-top: $cs-box-border;
            @include clearfix();
            background: $cs-box-bg;
        }

        .cs-steps {
            overflow: hidden;
            position: relative;
        }
        .cs-step {
            .cs-step-img {
                width: 50%;
                max-width: 250px;
                margin: 12px auto;
            }
            .cs-installing-plugins, .cs-list-plugins {
                max-width: 280px;
                margin: 0 auto;
            }
            .cs-plugin-name {
                line-height: 1.6;
                margin-left: 5px;
            }
            .icon {
                display: none;
            }
            &.completed {
                .icon {
                    display: block;
                }
                .cs-step-img {
                    img {
                        visibility: hidden;
                        opacity: 0;
                    }
                }
            }
            @include clearfix();
        }

    }

    .cs-action-buttons {
        a {
            &.disabled {
                opacity: 0.6;
                &.pro-only{
                    background: #f96455;
                    border-color: #b64a40;
                    box-shadow: 0 1px 0 #b64a40;
                    text-transform: uppercase;
                    text-shadow: 0 -1px 1px #b64a40, 1px 0 1px #b64a40, 0 1px 1px #b64a40, -1px 0 1px #b64a40;
                    cursor: not-allowed;
                }
            }
            display: none;
            &.current {
                display: inline-block;
            }
        }

    }
}
.cs-text-center {
    text-align: center;
}
.cs-error {
    background-color: #fcf8e3;
    color: #8a6d3b;
    padding: .75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #faf2cc;;
    border-radius: .25rem;
}

// Preview
body.cs-previewing-site{
    overflow: hidden !important;
}
#customify-site-preview {
    position: fixed;
    z-index: 99999999;
    left: 0px;
    right: 0px;
    top: 0px;
    bottom: 0px;
    display: block;
    transition: width .4s linear;
    &.cs-hide {
        display: none;
        z-index: -1;
        height: 0px;

    }
    background: #fff;
    * {
        box-sizing: border-box;
    }
    .cs-iframe-outer {
        position: absolute;
        top: 0px;
        width: 100%;
        bottom: 50px;
        display: block;
        background: #e5e5e5;
        .cs-iframe {
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            height: 100%;

            display: block;
            overflow-x: hidden;
            transition-property: left,right,top,bottom,width,margin, background;
            transition-duration: .2s;

            &[data-device="tablet"] {
                margin: auto 0 auto -360px;
                width: 720px;
                height: 1080px;
                max-height: 100%;
                max-width: 100%;
                left: 50%;
                right: auto;
            }
            &[data-device="phone"] {
                margin: auto 0 auto -207px;
                width: 414px;
                height: 736px;
                max-height: 100%;
                max-width: 100%;
                left: 50%;
                right: auto;
            }
        }
        iframe {
            width: 100%;
            height: 100%;
            display: block;
            margin: 0 auto;
            border: 0px none;
            box-shadow: none;
            position: absolute;
        }
    }
    .cs-preview-bar {
        position: absolute;
        bottom: 0px;
        left: 0px;
        width: 100%;
        display: block;
        @include clearfix();
        padding: 20px;
        height: 60px;
        background: #fff;
        box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
        a {
            text-decoration: none;
            box-shadow: none !important;
        }
        font-size: 24px;
        .dashicons {
            width: 30px;
            text-align: center;
            display: inline-block;
            &:before{
                display: inline-block;
                text-align: center;
            }
        }
        .cs-preview-import {
            margin-left: 10px;
            padding: 3px 8px;
            position: relative;
            top: 0px;
            text-decoration: none;
            border: none;
            border: 1px solid #ccc;
            border-radius: 2px;
            background: #f7f7f7;
            text-shadow: none;
            font-weight: 600;
            font-size: 13px;
            line-height: normal;
            color: #0073aa;
            cursor: pointer;
            outline: 0;
        }
        a {
            color: #333;
            &.current {
                color: #cccccc;
            }
        }
    }

    .cs-demo-name {
        float: left;
        font-weight: 600;
        line-height: 1;
    }
    .cs-view-ports, .cs-preview-close {
        float: right;
    }

    .cs-preview-loading {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate( -50%, -50% );
        z-index: 9999;
    }

    &.cs-iframe-loaded {
        .cs-preview-loading {
            z-index: -1;
            display: none;
        }
    }
}
.theme-pro-bubble {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #f95434;
    padding: 5px 10px;
    border-radius: 3px;
    display: block;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 11px;
    color: #fff;
}

#customify-sites-listing {
    &.themes {
        display: flex;
        box-sizing: border-box;
        flex-flow: row wrap;
        margin: -1em;
        @include for_mobile( ) {
            margin: 0px;
        }
        .theme {
            flex-basis: calc(  33.3333333% - 2em );
            width: calc(  33.3333333% - 2em );
            margin: 1em;
            @include for_mobile(){
                flex-basis: calc(  50% - 2em );
                width: calc( 50% - 2em );
                margin: 1em 0px;
            }

            @include for_small_mobile(){
                flex-basis: 100%;
                width: 100%;
            }
        }
    }
}