@import "bourbon/bourbon";
@import "variables";

.extract-plugin {
    height: 100%;
}

.extract-plugin * {
    @include user-select(none);
}

.extract-plugin input,
.extract-plugin textarea {
    @include user-select(text);
    border: 1px solid $input-border;
}

.psd-preview-view {
    position: absolute;
    left: 0px;
    right: 312px;
    top: 40px;  /* see height of .psd-header */
    bottom: 0px;
    overflow: auto;
    @include backface-visibility(hidden);

    .center-helper {
        float: left;
        height: 50%;
    }

    .preview-container {
        clear: both;
        position: relative;
        left: 0px;
        right: 0px;
        margin: auto;
        padding: $preview-spacing 0 $preview-spacing 0;
        @include transition-property(width);
        @include transition-duration(380ms);
        @include transition-timing-function(ease-out);
    }

    &.has-error {
        .preview-container {
            display: none;
        }
    }
}

#psdpreview_root {
    background: url('../images/light_checker_bg.png');
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.24);
    overflow: hidden;
    position: relative;
    @include transition-property(transform);
    @include transition-duration(380ms);
    @include transition-timing-function(ease-out);
}

#selection-overlay {
    position: absolute;
    overflow: hidden;
    top: $preview-spacing;
}

#tempPreview {
    position: absolute;
    overflow: hidden;
    top: $preview-spacing;
}

.psd-layer,
.psd-layer-group {
    position: absolute;
    pointer-events: none;
}

.psd-layer {
    // Works around an issue found with some elements getting culled
    // incorrectly when there is a transform on the preview root.
    will-change: transform;
}

.defocused {
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.75);
    pointer-events: none;
}

.psd-preview-view {
    .spinner {
        position: fixed;
        top: 50%;
        left: 50%;
        margin: -16px 0 0 -166px;
        display: none;
        width: 32px;
        height: 32px;
        background-image: url("../images/files-item-spinner.gif");
    }

    &.worker-progress-shown {
        .spinner {
            visibility: hidden;
        }
    }

    &.preview-rendered {
        #tempPreview {
            display: none;
        }
    }
}

#workerProgress {
    background-color: $cc-white;
    box-shadow: 0px 0px 9px 0px rgba(0, 0, 0, 0.36);
    width: 194px;
    min-height: 91px;
    padding: 20px;
    position: fixed;
    top: 50%;
    left: 50%;
    margin: -64px 0 0 -267px;

    .worker-status {
        color: $cc-black;
        font-size: 13px;
        font-weight: 400;
        position: relative;
    }

    .worker-status-tip {
        color: $cc-text;
        font-size: 13px;
        font-weight: 400;
        position: relative;
        margin: 0 4px;
    }
}

#workerProgress .worker-progress-base {
    position: relative;
    margin: 10px 0;
    width: 100%;
    height: 19px;
    background: #eee;
}

#workerProgress .worker-progress-bar {
    position: relative;
    width: 0;
    height: 100%;
    background-color: #5bc0de;
    background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
    background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    -webkit-background-size: 40px 40px;
    -moz-background-size: 40px 40px;
    -o-background-size: 40px 40px;
    background-size: 40px 40px;
    -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15);
    -moz-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15);
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-transition: width 0.6s ease;
    -moz-transition: width 0.6s ease;
    -ms-transition: width 0.6s ease;
    -o-transition: width 0.6s ease;
    transition: width 0.6s ease;
    -webkit-animation: progress-bar-stripes 2s linear infinite;
    -moz-animation: progress-bar-stripes 2s linear infinite;
    -o-animation: progress-bar-stripes 2s linear infinite;
    -ms-animation: progress-bar-stripes 2s linear infinite;
    animation: progress-bar-stripes 2s linear infinite;
}


/**************************************
/* HOVER
/**************************************/

.hover {
    outline: 1px solid #000;
    position: absolute;
    @include transform(translate3d(0, 0, 0));
    @include filter(drop-shadow(0px 0px 0.5px rgba(255, 255, 255, 0.75)));
}


/**************************************
/* SELECTION
/**************************************/

.selection {
    outline: 1px solid #00A2FF;
    position: absolute;
    @include transform(translate3d(0, 0, 0));
}


.selectionBorder {
    position: absolute;
}


/**************************************
/* STYLE INSPECTION
/**************************************/

#inspectStyleOverlay {
    position: absolute;
    top: $preview-spacing;
}

.style-callout {
    background-clip: content-box !important;
    display: inline-block;
    min-width: $style-callout-size;
    height: $style-callout-size;
    position: absolute;
    margin-left: -5px;
    border: 2px solid $cc-black;
    border-radius: 0;
    box-sizing: content-box;
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.12), inset 0 -1px 0 rgba(255, 255, 255, 0.12);
    @include filter(drop-shadow(0px 0px 1px rgba(255, 255, 255, 0.7)));

    .callout-notch {
        position: absolute;
        top: -2px;
        right: -9px;
        width: 0px;
        height: 0px;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-left: 7px solid $cc-black;
    }

    &.invisible {
        border: 2px solid $invisible-callout-color;

        .callout-notch {
            border-left: 7px solid $invisible-callout-color;
        }
    }
}

.font-callout {
    @extend .style-callout;
    font-size: 11px;
    font-weight: bold;
    background-color: $cc-black;

    p {
        margin: 0px;
        line-height: 13px;
        text-align: center;
        color: $cc-white;
    }
}

.color-callout {
    @extend .style-callout;

    .alpha-value {
        color: $cc-white;
        font-size: 11px;
        line-height: 13px;
        margin: 0px;
        padding: 0 3px 0 2px;
        text-align: right;
        text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.69);
    }

    &.defocused {
        opacity: .6;
    }
}

#inspectStyleOverlay canvas.inspectable-layer {
    display: none;
    position: absolute;
}


/**************************************
/* MEASUREMENT INSPECTION
/**************************************/

#measurementOverlay {
    position: absolute;
    top: $preview-spacing;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    background: rgba(0,0,0,0.01); // IE10 mousemove requirement
}

/**************************************
/* CURSORS
/**************************************/
.extract-plugin.dropper-tool,
.extract-plugin.dropper-tool .dropper-item .color-chip {
    cursor: url("../images/dropper.png") 2 15, auto;
    cursor: -webkit-image-set(url("../images/dropper.png") 1x, url("../images/dropper@2.png") 2x) 2 15, auto;
}

.extract-plugin.dropper-tool .psd-preview-view {
    cursor: none !important;
}

.psd-preview-view.measure-pending {
    cursor: url("../images/measure.png") 1 1, auto;
    cursor: -webkit-image-set(url("../images/measure.png") 1x, url("../images/measure@2x.png") 2x) 1 1, auto;
}

/**************************************
/* ERROR NOTIFICATION
/**************************************/
.error-notification {
    position: absolute;
    width: 100%;
    height: 100%;

    .centered-wrapper {
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        margin: auto;
        vertical-align: middle;
        position: absolute;
        height: 200px;
        width: 506px;
    }

    .error-icon {
        position: absolute;
        width: 68px;
        height: 64px;
        top: 3px;
        background: url("../images/notify.png") no-repeat;
        background: -webkit-image-set(url("../images/notify.png") 1x, url("../images/notify@2x.png") 2x) no-repeat;
    }

    .error-msg {
        position: absolute;
        left: 85px;
        width: 440px;
        height: auto;
        color: #8a8f91;
    }
}

/**************************************
/* DROPPER
/**************************************/

.lens {
    position: absolute;
    width: 70px;
    height: 70px;
    margin-top: -45px;
    margin-left: -45px;
    border-radius: 50%;
    border: 10px solid rgba(0,0,0,.5);
    overflow: hidden;
    box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.36);
    pointer-events: none;
}

.lens .center {
    border: black 1px solid;
    width: 10px;
    height: 10px;
    box-sizing: border-box;
    position: absolute;
    top: 30px;
    left: 30px;
}

.lens .inner {
    border-radius: 50%;
    position: absolute;
    overflow: hidden;
    width: 70px;
    height: 70px;
}

/**************************************
/* TRANSITIONS
/**************************************/
.notransition {
    transition: none !important
}


.font-callout,
.color-callout {
    @include animation(popup 300ms cubic-bezier(.61, .02, .95, .73) 1);
    @include transform-origin(100% 50%);
}

@include keyframes(popup) {
    0% {
        opacity: 0.6;
        @include transform(translate3d(0, 0, 0) scale(0));
    }

    100% {
        opacity: 1;
        @include transform(translate3d(0, 0, 0) scale(1));
    }
}

@include keyframes(progress-bar-stripes) {
    from {
      background-position: 0 0;
    }
    to {
      background-position: 40px 0;
    }
}
