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

/**************************************
/* BASE
/**************************************/

.popup {
    width: 260px;
    background-color: $cc-white;
    border: 1px solid rgba(0, 0, 0, 0.24);
    position: absolute;
    padding: 12px 15px;
    border-radius: 0;
    pointer-events: auto;
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.12);
    @include backface-visibility(hidden);

    .popup-footer {
        display: block;
        margin: 0;
    }

    .notch {
        position: absolute;
        width: $popup-notch-width;
        height: $popup-notch-height;
        overflow: hidden;

        &:after {
            content: "";
            background-color: $cc-white;
            width: 20px;
            height: 20px;
            display: block;
            @include transform(rotate(45deg));
            border: 1px solid rgba(0, 0, 0, 0.24);
        }
    }

    &.bottom {
        margin-top: 0px;

        & > .notch {
            top: -1 * $popup-notch-height;

            &:after {
                margin-top: 7.5px;
            }
        }
    }

    &.top {
        margin-top: -1 * $popup-notch-height;

        & > .notch {
            bottom: -1 * $popup-notch-height;

            &:after {
                margin-top: -14px;
            }
        }
    }

    .title {
        color: $cc-text;
        margin: 0 0 4px;
        font-size: 14px;
        font-weight: 400;
        text-shadow: 0 1px 0 $cc-white;
    }

    .subtitle {
        color: $cc-text;
        margin: 10px 0 0 0;
        font-size: 12px;
        font-weight: 400;
    }

    .close-button {
        display: none;

        &:hover {
            background-color: #E6E6E6;
            border-radius: 0;
        }
    }

    .textarea-holder {
        margin-right: 10px;
    }

    .action-button,
    .action-button:hover {
        border: 1px solid $btn-border;
        border-radius: 0;
        color: $cc-text;
        font-size: 12px;
        float: right;
        min-width: 60px;
        margin-top: 10px;
        margin-bottom: 0px;
        text-shadow: 0 1px $cc-white;
    }

    .action-button:active {
        background: $btn-bg;
        @include background-image( linear-gradient($btn-gradient-stop-1 0, $btn-gradient-stop-2 100%) );
        // box-shadow: inset 0 1px rgba(0,0,0,0.12);
    }

}


/**************************************
/* EXTRACT CODE POPUP
/**************************************/

.extract-code-popup {
    width: 235px;

    &.expanded {
        width: 460px;
    }

    textarea,
    .topcoat-textarea {
        font-size: 12px;
        line-height: 18px;
        width: 100%;
        height: 50px;
        max-height: 200px;
        padding: 2px 4px;
        resize: none;
        margin-bottom: 0px;
    }

    .all-code {
        float: left;
        margin-top: 13px;
        margin-bottom: 0px;
        font-size: 12px;

        &:hover {
            color: #1397D0;
        }
    }

    .action-button {
        &.zeroclipboard-is-hover {
            @include background-image( linear-gradient($btn-hover-gradient-stop-1 0, $btn-hover-gradient-stop-2 100%) );
        }

        &.copied {
            background-image: linear-gradient(to bottom, #2da1e4, #0080cf);
            border-color: rgba(30, 30, 30, 0.25);
            pointer-events: none;
        }
    }
}


/**************************************
/* EXTRACT ASSET POPUP
/**************************************/

.extract-asset-popup {
    width: 230px;
    pointer-events: auto;

    &.popup .notch:after {
        background-color: $cc-white;
        border: 1px solid rgba(0, 0, 0, 0.24);
    }
    .popup-contents .notch {
        display: none;
        visibility: hidden;
    }
    label {
        color: $cc-text;
        display: block;
        float: right;
        font-size: 12px;
        margin: 0 7px 0 0;
    }

    .file-name {
        margin: 0px;
        width: 96%;
        font-size: 12px;
    }

    .quality {
        width: 100%;
        min-height: 43px;
        margin: 3px 0 10px 0;
    }

    .quality-description {
        background-color: #eef0f0;
        border-radius: 0;
    }

    .format-description {
        height: 100%;
        font-size: 11px;
        margin: 5px;
        color: $cc-text;
        white-space: normal;
    }

    .svg-warning {
        background: #fff193;
        font-size: 11px;
        background-image: url('../images/warning.svg');
        background-size: 20px 20px;
        background-position: 5px 5px;
        background-repeat: no-repeat;
        color: $cc-text;
        border: 1px solid #e8e69d;
        min-height: 14px;
        font-weight: 400;
        padding: 8px 0 7px 30px;
    }

    .quality-range {
        width: 75%;
        float: left;
        margin-top: 10px;
    }

    .quality-percentage {
        margin: 1px 0px 0 3px;
        width: 37px;
        font-size: 12px;
        float: right;
    }

    .scale-factor {
        width: 37px;
        float: left;
        margin-top: -3px;
    }

    .scale-enable-checkbox {
        float: left;
    }

    input.scale-enable {
        left: 0;
    }

    .scale label {
        float: left;
        margin: 0 7px;
        font-weight: 400;
    }

    .scale-enable-checkbox:before {
        background-color: $cc-white;
        border: 1px solid $cc-grey;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
        width: 15px;
        height: 15px;
    }

    .scale-enable-checkbox:after {
        border-color: $cc-blue;
        left: 5px;
        top: 1px;
        width: 13px;
        height: 4px;
    }

    .scale {
        float: right;
        margin: 4px 0 0;
        position: relative;
        &.disabled {
            .scale-factor {
                opacity: .4;
                pointer-events: none;
            }
        }
        &.incompatible {
            opacity: .4;
            pointer-events: none;
        }
    }

    .popup-footer {
        clear: right;
        padding-top: 10px;

        #downloadBtn {
            float: right;
            margin-right: 10px;
            padding: 1px 10px;
        }
    }

    .extract-size {
        float: left;
        font-size: 12px;
        line-height: 24px;

        #extract-size-value {
            color: $cc-grey-light;
            font-size: 12px;
        }
    }

    .btn-primary {
        float: right;
        overflow: visible;
        padding: 1px 10px;
        font-size: 14px;
        text-shadow: 0 -1px rgba(0,0,0,0.36);
        color: #fff;
        padding: 0 15px;
    }

    .select-file-type {
        background-image: url('../images/color_type_arrow.png');
        background-position: right 5px top 10px;
        padding-left: 6px;
        background-repeat: no-repeat;
    }

    .options {
        border-radius: 0;
        display: block;
        margin-top: 10px;
        margin-bottom: 10px;
        margin-right: 4px;
        position: relative;
        white-space: nowrap;
        font-size: 0;

        input[type=radio] {
            width: 100%;
            height: 100%;
            position: absolute;
            cursor: pointer;

            &:checked ~ p {
                background-color: $btn-cta-ie-bg;
                @include background-image( linear-gradient($cc-blue-dark 0, $cc-blue 100%) );
                box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.12);
                color: $cc-white;
            }
        }

        .disabled {
            opacity: 0.3;
        }

        div {
            position: relative;
            display: inline-block;

            p {
                border: 1px solid $btn-border;
                border-right: none;
                display: inline-block;
                background-color: $btn-bg;
                @include background-image( linear-gradient($btn-gradient-stop-1 0, $btn-gradient-stop-2 100%) );
                padding: 3px 10px 2px;
                margin: 0px;
                font-size: 12px;
                color: $cc-text;
                min-width: 24px;
                text-align: center;
            }

            &:first-child {
                p {
                    border-left: 1px solid $btn-border;
                }
            }

            &:last-child {
                p {
                    border-right: 1px solid $btn-border;
                }
            }
        }
    }
}

/**************************************
/* COLOR CHIP POPUP
/**************************************/

.color-chip-popup {
    width: auto;
    padding: 10px;

    textarea,
    .topcoat-textarea {
        font-size: 12px;
        width: 157px;
        height: 23px;
        margin: 1px;
        resize: none;
        white-space: nowrap;
        overflow: hidden;
        padding: 0 2px;
    }

    .color-format {
        display: inline-block;
        font-size: 12px;
        margin-right: 3px;
    }

    .alpha-list {
        .opacities-label {
            display: inline-block;
            width: 67px;
            font-size: 12px;
            margin: 0px;
        }

        ul {
            list-style: none;
            margin: 8px 0px 0px 0px;
            padding: 0px;
            display: inline-block;

            .color-alpha {
                height: $alpha-rect-height;
                background-color: #eee;
                display: inline-block;
                margin: 0px 3px 0px 0px;
                border-radius: 0;
                padding: 0px 5px;
                min-width: 15px;
                cursor: pointer;

                p {
                    text-align: center;
                    line-height: $alpha-rect-height;
                    font-size: 12px;
                    margin: 0px;
                    color: #444;
                }

                &:hover {
                    background-color: $cc-blue-lite;
                }

                &.selected {
                    background-color: #009df5;

                    > p {
                        color: $cc-white !important;
                    }
                }
            }
        }
    }
}


/**************************************
/* MEASUREMENT POPUP
/**************************************/

.measurementTooltip {
    position: absolute;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.76);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.24);
    color: $cc-white;
    width: auto;
    font-size: 12px;
    font-weight: 400;
    border-radius: 0;
    padding: 10px 12px 9px 12px;

    .measurementElementInfoPos {
        border-right: none;
        padding: 0 0 0 10px;
    }
}

.measurementPreferredUnits {
    vertical-align: top;
    display: inline-block;
    white-space: nowrap;
    height: auto;
    overflow: hidden;
    padding-right: 8px;
    cursor: pointer;

    span {
        display: inline-block;
        font-size: 12px;
        color: $cc-blue-darker;
        background-color: #3CB8FD;
        width: 18px;
        text-align: center;
        margin-bottom: 1px;
    }

    span.selectedUnit {
        color: $cc-white;
        background-color: $cc-blue-darker;
    }
}

.measurementElementInfoDim {
    vertical-align: top;
    display: inline-block;
    white-space: nowrap;
    height: auto;
    overflow: hidden;
    padding-right: 8px;
}

.measurementElementInfoPos {
    display: inline-block;
    vertical-align: top;
    height: auto;
    white-space: nowrap;
    overflow: hidden;
    border-width: 1px;
    border-style: none solid none solid;
    padding: 0 8px 0 8px;
    /* Remove space introduced by space characters and newline in the html */
    margin-left: -3px;
}

.measurementElementAssetExtract {
    vertical-align: top;
    margin-top: 6px;
    background-image: url('../images/cc-extract-sprite.svg');
    background-position: -60px 0px;
    background-repeat: no-repeat;
    width: 20px;
    height: 25px;
    display: inline-block;
    overflow: hidden;
    pointer-events: auto;
}

.measurementElementAssetExtract:hover {
    background-image: url('../images/cc-extract-sprite.svg');
    background-position: -60px -40px;
    cursor: pointer;
}

.measurementElementCopyControls {
    height: auto;
    vertical-align: top;
    display: inline-block;
    overflow: hidden;
    padding: 0 0 0 10px;
    pointer-events: auto;
    margin-right: 10px;

    > span {
        color: $cc-white;
        font-size: 12px;
        cursor: pointer;
    }

    .disabled {
        opacity: 0.3;
        pointer-events: none !important;
    }
}

#notificationTooltip {
    position: absolute;
    border: none !important;
    background-color: #004A7E;
    font-size: 12px !important;
    padding: 6px 12px !important;

    // offset
    margin: 0 -1px -6px -13px;

    > span {
        color: $cc-white !important;
    }
}

.measurementPopup,
.interceptBinary {
    background-color: $cc-blue;
    border: 1px solid $cc-blue;
    overflow: visible;

    .notch:after {
        background-color: $cc-blue;
        border: none;
    }

    .measurementElementInfoPos {
        border-color: #007FFF;
    }

    .measurementElementAssetExtract {
        border-color: #007FFF;
    }

    .control-is-hover {
        color: #004A7E;
        cursor: pointer;
    }

    .popup-close {
        position: absolute;
        top: -9px;
        right: -12px;
        font-size: 13px;
        font-weight: bold;
        cursor: pointer;
    }

    .popup-close:hover {
        color: $cc-blue-darker;
    }

    .popup-footer {
        margin-top: 10px;
    }
}

.interceptBinary span {
    color: $cc-white;
}

#interceptPopupBinary {
    margin-right: 5px;
    position: relative;
}

#measurementPopupInfo {
    white-space: nowrap;
    line-height: 1.5em;

    .copyable {
        color: $cc-white;
        font-size: 12px;
        cursor: pointer;
    }

    .zeroclipboard-is-hover {
        color: #004A7E;
        cursor: pointer;
    }
}

.measurementOffsetsBox {
    position: absolute;
    left: 100px;
    top: 200px;
    overflow: visible;
    border: 1px dotted $measurement-offset-color;
    @include transform(translate3d(0,0,0));
    @include filter(drop-shadow(1px 1px 0.5px rgba(255, 255, 255, 0.2)));
    opacity: 1;

    .measurementOffsetsCanvas {
        position: absolute;
        opacity: 1;
    }
}

.measurementOffsetsBanner {
    padding: 6px 10px;
    opacity: 1;
    background-color: $measurement-offset-color;
    border: 1px solid $measurement-offset-color;
    font-size: 10px;
    font-weight: 400;

    > span {
        color: $cc-white;
        font-size: 12px;
    }

    .copyable {
        cursor: pointer;
    }

    .notch {
        height: 5px;
    }

    .notch:after {
        margin-top: 5px;
        background-color: $measurement-offset-color;
    }

    .noWrap {
        white-space: nowrap;
    }
}

.xOffsetIcon,
.yOffsetIcon {
    background: url(../images/measurement-arrows.png) no-repeat;
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 5px;
    position: relative;
    top: 3px;
}

.xOffsetIcon {
    background-position: 0 3px;
}

.yOffsetIcon {
    background-position: 0 -12px;
}


/**************************************
/*   KEYBOARD SHORTCUTS HELP DIALOG
/**************************************/

.modal-window-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    position: absolute;
}

.modal-wrapper {
    background-color: $cc-white;
    position: absolute;
    top: 5%;
    width: 400px;
    max-height: 88%;
    left: 0;
    right: 0;
    overflow-x: hidden;
    overflow-y: auto;
    margin-left: auto;
    margin-right: auto;
    padding: 0px 10px 10px 7px;
    border: 1px solid rgba(0, 0, 0, 0.7);
    border-radius: 0;
    box-shadow: inset 0 1px 0 $cc-white, 0 6px 18px rgba(0, 0, 0, 0.24);

    h1 {
        font-size: 28px;
        font-weight: 300;
        padding-bottom: 30px;
        color: #000;
        line-height: 20px;
        margin: 0px;
    }

    .dialog-footer {
        float: right;

        button {
            margin-left: 7px;
        }
    }

    .btn-primary, .topcoat-button {
        padding: 0 13px;
        font-size: 14px;
        height: 32px;
        font-weight: 400;
    }

    .btn-primary:hover {
       color: #fff;
    }
}

.extract-for-device-dialog {
    padding: 30px;
    width: 530px;

    span.preview-badge {
        padding: 0 0.5em;
        margin-left: 1em;
        font-size: 0.6875rem;
        line-height: 19px;
        font-weight: 700;
        text-transform: uppercase;
        background-color: #FFF38E;
        border: 1px solid #FFA319;
        color: #444;
        display: inline-block;
        position: relative;
        top: -6px;
    }

    .setting-type-checkbox:after {
        border-color: $cc-blue;
        left: 5px;
        top: 1px;
        width: 13px;
        height: 4px;
    }

    .description {
        font-family: "adobe-clean", Helvetica, Arial, sans-serif;
        color: #a9adab;
        font-size: 14px;
        font-weight: 400;
        line-height: 18px;
        padding-bottom: 25px;
        padding-top: 0px;
        margin: 0px;
    }

    .info {
        font-family: "adobe-clean", source-sans-pro, 'Helvetica Neue', Helvetica, Arial, sans-serif;
        color: #454545;
        font-size: 14px;
        font-weight: 600;
        line-height: 24px;
        padding-bottom: 13px;
    }

    input.validation-error {
        border: 1px solid red;
    }

    .device-list {
        width: 530px;
        padding-bottom: 30px;

        .device-list-header {
            color:  #979797;
            font-size: 12px;
            font-weight: normal;
            line-height: 30px;

            .col1 {
                margin-left: 30px;
                margin-right: -30px;
            }
        }

        .extract-settings-item {
            label {
                float: left;
                margin: 5px 7px;
                font-weight: 400;
                color:  #454545;
                font-size: 14px;
            }
        }

        li {
            background: #f9f9f9;
            height: 30px;

            div {
                display: block;
                float: left;
                background: inherit;

                input{
                    margin-top: 5px;
                    height: 18px;
                    line-height: 18px;
                    color: $cc-text;
                }

                div{
                    margin-top: 5px;
                }

                label{
                    margin-top: 5px;
                }
            }

            .setting-type-checkbox {
                margin-left: 8px;
            }

            .extract-setting-type {
                width: 30px;
                left: 0;
            }

            .col1 {
                position: relative;
                width: 190px;

                > {
                    margin-top: 5px
                }
            }

            .col2 {
                position: relative;
                width: 100px;

                input {
                    width: 85px;
                }
            }

            .col3 {
                width: 240px;

                input {
                    width: 220px;
                }
            }
        }

        li:nth-child(even) {
            background: #f0f0f0;
        }
    }
}



.keystroke-header {
    width: 100%;
    padding-top: 20px;
    padding-bottom: 5px;
    padding-left: 20px;
}

.keystroke-header-title {
    color: $cc-text;
    font-size: 21px;
    font-weight: 400;
}

.keystroke-info-icon {
    background-image: url('../images/cc-extract-sprite.svg');
    background-position: 0 -180px;
    display: inline-block;
    width: 18px;
    height: 18px;
    background-size: auto;
    background-repeat: no-repeat;
    margin: 0 3px 0 0;
    position: relative;
    top: 2px;
}

.keystroke-main-col {
    padding: 5px 20px 20px;
}

.keystroke-item {
    margin-top: 5px;
    position: relative;
    display: block;
}

.keystroke-separator {
    border-bottom: 1px solid #dfdfdf;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.keystroke-item-title {
    color: $cc-text;
    font-size: 12px;
    line-height: 1em;
    font-weight: 700;
}

.keystroke-item-text {
    color: $cc-text;
    font-size: 11px;
    font-weight: 400;
    margin-top: 9px;
    margin-right: 55px;
    padding-top: 0px;
}

.keystroke-item-keys {
    display: inline-block;
    margin: 0 5px 0 0;
    color: $cc-text;
    font-size: 12px;
    line-height: 1em;
    font-weight: 700;
}

.keystroke-item img {
    margin-left: -5px;
    height: 24px;
    width: 24px;
}

.keystroke-item-key {
    display: inline;
    background: $cc-white;
    border-radius: 0;
    border: 1px solid $btn-border;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
    color: #000000;
    cursor: default;
    font-size: 12px;
    font-weight: 400;
    padding: 1px 6px 1px 6px;
}


/**************************************
/* THUMB POPUP
/**************************************/

.layer-thumb-popup,
.asset-thumb-popup {
    width: auto;
    height: auto;
    padding: 10px 10px 4px;
    font-size: 12px;

    .layer-thumb {
        max-width: 240px;
    }
}

.sprite_preview {
    background: url('../images/light_checker_bg.png');
    border: 1px solid #c4c4c4;
}


/**************************************
/* Transitions
/**************************************/

.color-chip-popup.top,
.extract-code-popup.top,
.layer-thumb-popup.top,
.asset-thumb-popup.top,
.extract-asset-popup.top,
.measurementPopup.top,
.measurementPopup {
    @include animation(popup 210ms cubic-bezier(.01, .91, 0, .99) 1);
    @include transform-origin(50% 100%);
}

.color-chip-popup.bottom,
.extract-code-popup.bottom,
.layer-thumb-popup.bottom,
.asset-thumb-popup.bottom,
.extract-asset-popup.bottom,
.measurementPopup.bottom {
    @include animation(popup 210ms cubic-bezier(.01, .91, 0, .99) 1);
    @include transform-origin(50% 0);
}

.measurementOffsetsBox {
    @include animation(popup 210ms cubic-bezier(.01, .91, 0, .99) 1);
    @include transform-origin(50% 50%);
}

.modal-window-overlay {
    @include animation(overlay 300ms 1);
    @include transform-origin(50% 50%);
}

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

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

@include keyframes(overlay) {
    0% {
        opacity: 0;
        @include transform(translate3d(0, 0, 0));
    }

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

.popup-button {
    background: $cc-blue-dark;
    color: $cc-white;
    font-size: 12px;
    padding: 2px 7px;
    margin: 0 5px 0 0;
}

.popup-button:hover {
    background: $cc-blue-darker;
    color: $cc-white;
}
