/*
 * visualization styles
 */

@import 'visualize/color-selector';

.scrollfix-cont {
    padding-top: 30px;
}

.size-presets {
    position: absolute;
    top: 30px;
    right: 0;
    margin-right: -102px;
    width: 100px;
    border-right: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}

.preset {
    text-align: center;
    background: #fff;
    border-top: 1px solid #ccc;
    cursor: pointer;
    padding: 10px 0px;
}

.preset.selected {
    font-weight: bold;
}

#iframe-wrapper {
    // box-shadow: 1px 1px 64px rgba(0, 0, 0, 0.13),0px 0px 2px #ccc;
    border: 1px solid #fff;
    padding: 10px;
    border-radius: 0px;
    overflow: hidden;
    background: #fff;
    max-width: 98%;
    position: relative;

    .resizer {
        width: 20px;
        height: 20px;
        position:absolute;
        right: 0;
        bottom: 0;
        cursor: e-resize;
    }

    .resizer-both {
        cursor: se-resize;
        transform: rotate(35deg);
        -webkit-transform: rotate(35deg);
        -ie-transform: rotate(35deg);
        -moz-transform: rotate(35deg);
    }

    .info-text {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 10px;
        // background: white;
        text-align: center;
        font-weight: bold;
        color: #0088cc;
        background: mix(white, #0088cc, 90%);
    }
}

#iframe-vis {
    border: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

#iframe-pdf {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    height: 110%;
    width: 100%;
}

.chart-editor.dw-create-visualize {

    &.chart-editor-print {
        .resizer {
            display: none;
        }
    }

    .visualization [contenteditable=true]:hover:after {
      content: ' click to edit';
      font-style: italic;
      font-size: 12px;
      font-family: sans-serif;
      color: #ccc;
    }

    .visualization [contenteditable]:hover,
    .visualization [contenteditable]:focus {
        background: #fff;
        // box-shadow:inset 0 0 3px #999;
    }

    .visualization [contenteditable]:hover {
        padding: 5px;
    }

    .visualization [contenteditable]:focus:after {
      content: '';
    }

    #vis-options, .vis-options {
        position: relative;

        fieldset legend {
            margin-bottom: 10px;
        }

        .vis-options-refine-loading {
            z-index: 100000;
            position:absolute;
            left:-10px;
            top:0;
            width: calc(~"100% + 20px");
            height:100%;
            background: rgba(0,0,0,0.2);
        }

        .vis-options-refine-loading > .fa-spinner {
            position:absolute;
            color: #fff;
            left: calc(~"50% - 22px");
            top: 100px;
            font-size: 44px;
        }

        .vis-option-group {
            margin-bottom: 9px;
            position: relative;

            &.inline {
                display: inline-block;
                vertical-align: top;
                margin-right: 20px;
            }

            .vis-option-help {
                position: absolute;
                top: 0px;
                right: 0px;
                cursor: default;
                padding-left: 15px;
                z-index: 100;

                span {
                    display: block;
                    width: 22px;
                    height: 22px;
                    line-height: 22px;
                    text-align: center;
                    pointer-events: none;
                    border-radius: 11px;
                    background: none;
                    color: #ccc;
                    // text-shadow: 1px 1px 0.2px rgba(0,0,0,0.2), 1px -1px 0.2px rgba(0,0,0,0.2), -1px 1px 0.2px rgba(0,0,0,0.2), -1px -1px 0.2px rgba(0,0,0,0.2);
                    font-weight: 400;
                }

                &:hover {
                    text-decoration: none;
                    span { background: #eee; color: #444; }
                }
            }

            &.vis-option-type-radio-left .vis-option-help {
                top: 32px;
            }

            &.vis-option-type-separator .vis-option-help {
                top: 32px;
            }

            &.vis-option-type-select-axis-column .vis-option-help {
                top: 3px;
            }

            legend + .control-group {
                margin-top: 0;
            }

            &.vis-option-type-select-axis-column {
                .controls { margin-right: 20px; }
            }

            &.vis-option-type-select {
                margin-bottom: 15px;
            }

        } // .vis-option-group

        .vis-option-type-group {
            label.group-title {
                &:hover {
                    background: #f9f9f9;
                    &:after {
                        content: 'Click to expand group';
                        float: right;
                        font-weight: 300;
                        padding-right: 10px;
                        font-size: 12px;
                        color: #bbb;
                    }
                }
                padding: 8px 0;
                margin-bottom: 0;
                font-weight: 500!important;

                font-family: @base-font;
                .fa {
                    font-weight: normal;
                    margin-right: 0.5ex;
                }
                .collapse-group { display: none }
            }
            padding-bottom: 0;
            margin-bottom: 15px;
            border-bottom: 1px solid #ddd;

            .option-group-content {
                position: absolute;
                visibility: hidden;
            }
            &.group-open {
                label.group-title {
                    background: #f2f2f2;
                    padding-left: 10px;
                    padding-right: 10px;
                    .collapse-group { display: inline-block; }
                    .expand-group { display: none; }
                    margin-bottom: 15px;
                    &:hover {
                        background: #f0f0f0;
                        &:after {
                            content: 'Click to collapse group';
                        }
                    }
                }
                .option-group-content {
                    position: static;
                    visibility: visible;
                    padding-left: 10px;
                    padding-right: 10px;
                    padding-bottom: 5px;
                }
                border-bottom: none;
                // border: 1px solid #ddd;
                margin-left: -10px;
                margin-right: -10px;
                border-radius: 5px;
                background: #f9f9f9;
                // box-shadow: inset 2px 2px 5px #eee;

            }
        }

        .control-label {
            display: inline-block;
            text-align: top;
            width: auto;
            float: none;
            margin-right: 1em;
            vertical-align: baseline;
        }

        .vis-option-type-radio .control-label {
            vertical-align: text-top;
        }

        .controls {
            display: inline-block;
            width: auto;
            float: none;
            margin-left: 0;
            vertical-align: baseline;
        }

        .tooltip {
            .tooltip-inner {
                background: #eee;
                border-color: #eee;
                font-size: 14px;
                font-family: @base-font-cd;
                color: #444;
                line-height: 18px;
                // box-shadow: 3px 3px 6px rgba(0,0,0,0.03);
            }
        }

        .tooltip.right .tooltip-arrow {
            border-right-color: #eee;
        }

    } // end #vis-options

    .highlighted-series li {
        margin-bottom: 3px;
        margin-right: 10px;
        float: left;
        display: inline;
    }

    .highlighted-series .badge {
        max-width: 100%;
        display: inline-block;
        overflow: hidden;
        text-overflow:ellipsis;
    }

    .highlighted-series .badge .icon-remove {
        position: relative;
        left: -4px;
        top: 1px;
    }

    @import 'visualize/vis-thumbs';

    @media @viewport-medium {
        .vis-thumb {
            width: 75px;
            height: 75px;
        }

        .vis-thumb img, .vis-thumb svg {
            width: 65px;
            height: 65px;
            left: 5px;
            top: 5px;
        }

        .vis-thumb svg {
            margin-top: 2px;
            margin-left: 5px;
        }

        .navbar .nav > li > a {
            padding-left: 8px;
            padding-right: 8px;
            font-size: 13px;
            line-height: 14px;
        }

        .visualize-nav-tabs.nav-tabs {
            font-size: 13px;
        }

        .visualize-nav-tabs.nav-tabs > li a,
        .visualize-nav-tabs.nav-tabs > li a:hover,
        .visualize-nav-tabs.nav-tabs > li.active a
         {
            padding: 4px 8px;
            line-height: 24px;
        }

        .span4 { width: 300px + 50; }
        .span8 { width: 620px - 50; }

    }

    @media (max-width: 976px) {
        .vis-thumb {
            width: 55px;
            height: 55px;
        }

        .vis-thumb img {
            width: 45px;
            height: 45px;
            left: 5px;
            top: 5px;
        }

    }

    .resize-chart-wrap {
        margin-top: 10px;
    }

    .resize-chart {
        text-align: center;
        margin-left: 10px;
        color: #000;
        font-size: 13px;
        line-height: 28px;
    }

    .resize-chart a {
        padding-left: 1ex;
        color: #666;
    }
    .resize-chart input[type=text] {
        width: 4ex;
        position: relative;
        top: 3px;
    }
    .resize-chart a.active { color: #000; font-weight: bold }

    #ender-overlay-mask {
        top: -60px!important;
    }

    .alert-warning h4 {
        color: #A0711F;
        margin: 2px 0 5px;
    }

    .visualize-nav-tabs {
        margin-bottom: -4px;
        z-index: 4;
        position: relative;
        background: #fff;
    }

    .visualize-nav-tabs li {
        max-width: 33%;
    }
    .visualize-nav-tabs li.active {
        max-width: 47%;
    }

    .visualize-nav-tabs li a {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        // box-shadow: inset 0px -5px 7px rgba(0,0,0,0.05);
        border: 1px solid #e5e5e5;
        background: #f9f9f9;
        border-bottom: 0;
    }

    .visualize-nav-tabs .active a {
        color: #000;
        font-weight: bold;
        // box-shadow: 1px 2px 2px rgba(0, 0, 0, 0.05) inset;
        background: #fff;
    }


    .control-group .pull-left {
        margin-right: 20px;
        margin-bottom: 10px;
    }

    // .control-group .pull-left label,
    // .control-group .row label {
    //     font-size: 11px;
    //     color: #222;
    //     text-transform: uppercase;
    //     margin: 0 0 3px 2px;
    //     font-family: @base-font;
    //     font-weight: bold;
    // }

    .custom-color-selector-body {
        .btn {
            font-family: @base-font-cd;
            font-weight: 300;
        }
        .dataseries {
            li {
                label { font-weight: 400; }
                &.selected { background: #e0eaf0; }
            }
        }
    }

    .visconfig {
        .btn {
            font-weight: 300;
        } 

        label, select, input[type=text], textarea {
            font-size: 14px;
            line-height: 16px;
            font-weight: 300;
            font-family: @base-font-cd;

            @media @viewport-medium { font-size: 13px; line-height: 15px; }
        }

        label.separator {
            font-weight: 500;
            text-align: left;
            margin-top: 10px;
            line-height: 20px;
            font-family: @base-font;
        }

        .vis-option-type-group .vis-option-type-separator label.separator {
            font-weight: 400;
            text-align: left;
            font-size: 11px;
            text-transform: uppercase;
            margin-bottom: 5px;
            line-height: 15px;
            font-family: @base-font;
            margin-top: 10px;
            color: #555;
            // border-top: 1px solid #eee;
            text-shadow: -2px -2px 0px #fff;
            letter-spacing: 1px;
            display: block;
            border-bottom: 2px solid #efefef;
        }

        .vis-option-type-group .vis-option-type-separator:first-child  label.separator {
            margin-top: -5px;
        }

        input[type="radio"],
        input[type="checkbox"] {
            margin: 2px 0 0;
        }

        label.checkbox { padding-left: 17px; }
        label.checkbox input[type="checkbox"] { margin-left: -17px; }

        @import 'visualize/textarea';
        @import 'visualize/custom-range';
    }

    .toolbar {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        width: auto;
        height: 42px;
        margin-top: 70px;
    }

    .toolbar .toolbar-container {
        border: 1px solid rgba(0, 0, 0, 0.1);
        background: #fff;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 20px;
    }

    .toolbar .toolbar-container.hide {
        display: none;
    }

    .toolbar .toolbar-container:last-child {
        margin-right: 0;
    }

    .toolbar .toolbar-container .button {
        cursor: pointer;
        padding: 0px 16px;

        height: 39px;

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 14px;

        border-right: 1px solid rgba(0, 0, 0, 0.1);
    }

    .toolbar .toolbar-container.print .button {
        padding: 0px 14px;
    }

    .toolbar .toolbar-container .button.active {
        background: rgba(0,0,0,0.05);
    }

    .toolbar .toolbar-container > *:last-child {
        border-right: none;
    }

    .toolbar .toolbar-container .button:hover {
        background: rgba(0,0,0,0.05);
    }

    .toolbar .toolbar-container .button .column {
        border-radius: 1px;
        background: rgba(0,0,0,0.05);
        width: 5px;
        height: 10px;
        margin-right: 2px;
        margin-top: -10px;
    }

    .toolbar .toolbar-container .button .column.active {
        background: rgba(0,0,0,0.2);
        height: 20px;
        margin-top: 0;
    }

    .toolbar .toolbar-container .input-resize {
        border: none;
        box-shadow: none;
        border-bottom: 2px dotted #ccc;
        width: 20px;
        text-align: center;
        background: transparent;
        margin-bottom: 4px;
    }

    .toolbar .toolbar-container .input-resize#resize-w,
    .toolbar .toolbar-container .input-resize#resize-mm-w {
        margin-left: 10px;
        margin-right: 5px;
    }

    .toolbar .toolbar-container .input-resize#resize-h,
    .toolbar .toolbar-container .input-resize#resize-mm-h {
        margin-right: 10px;
        margin-left: 5px;
    }

    .toolbar .toolbar-container .btn-ppm .btn {
        font-size: 10px;
        box-shadow: none;
        padding: 2px 10px;

    }
}

.vis-option-type-chart-description {
    input[type="text"], textarea {
        margin-bottom: 5px;
    }
    padding-bottom: 1px;
}

.vis-archive-select {
    margin: 15px 0 0 0px;
    border-top: 1px solid #eee;
    padding-top: 10px;
    padding-left: 12px;
    opacity: 0.7;

    select {
        margin-left: 7px;
        vertical-align: baseline;
        max-width: 180px;
    }
}
