/*
 * Copyright (c) 2014 Adobe Systems Incorporated. All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 *
 */

@dialog-radius: 0.6rem;
@dialog-padding: 0;
@dialog-margin: 1rem;

.dialog__center {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

dialog {
    color: @item-active;
    left: inherit;
    z-index: 10000;
    position: absolute;
    font-size: 100%;
    display: flex;
    justify-content: flex-start;
    width: @panel-column-width - (@dialog-margin*2) - (@dialog-padding*2);
    max-height: 25rem;
    height: auto;
    border-radius: @dialog-radius;
    background: @bg-dialog;
    border: @hairline solid @underlines;
    padding: @dialog-padding;
    margin: @dialog-margin;
    overflow: hidden;
    box-sizing: border-box;
}

dialog:not([open]) {
    display: none;
}

dialog::backdrop {
    position: inherit;
    top: inherit;
    right: inherit;
    bottom: inherit;
    left: inherit;
}

.column-28 + .dialog-blendmodes{
    width: 28.8rem;
    left: 5.2rem;
}

.column-14 + .dialog-blendmodes{
    width: 14.9rem;
    left: 5.2rem;
    margin-top: -0.1rem;
}

.column-8 + .dialog-blendmodes{
    width: 9.2rem;
}

.column-4 + .dialog-blendmodes{
    width: 5.2rem;
}

.dialog-blendmodes {
    width: 20rem;
    left: 5.2rem;
    margin-top: -1px;
}

.dialog-search-bar {
    position: relative;
    width: 47rem;
    max-height: 50rem;
    background-color: @bg-dialog;
    color: @item-active;
    border-radius: @dialog-radius;
    box-shadow: none;
    border: @hairline solid @underlines;
    margin-left: -1.6rem;
    margin-top: -2.8rem;
    margin-bottom: 5.3rem;
    -webkit-animation: fadeIn 400ms;
}

.dialog-stroke-alignment {
    right: 4rem;
    margin-top: 0px;
    height: auto;
}

.dialog-type-typefaces, .dialog-type-weights {
    margin-top: -0.1rem;
}

.dialog-type-typefaces {
    overflow-y: scroll;
    width: 30rem;
    left: 0rem;    
}

.dialog-type-weights {
    overflow-y: scroll;
    width: 23.2rem;
    left: 6.8rem;    
}

.dialog-effects-popover, .dialog-export-popover {
    width: 12rem;
    margin-right: 0.8rem;
}

.dialog-export-popover .popover-list:before {
    left: 6.65rem;
}

.dialog-export-scale{
    width: 5.0rem;
    left: 1.1rem;
    margin: -0.1rem 0 0 0;
}

.dialog-export-format {
    width: 9.2rem;
    left: 17.5rem;
    margin: -0.1rem 0 0 0;
}

.dialog-search-bar {
    overflow-y: scroll;
}

.dialog-libraries {
    overflow-y: scroll;
}

.dialog-libraries {
    width: 20.6rem;
    left: 1.1rem;
    margin: -0.1rem 0 0 0;
    box-shadow: none;
    background: @bg-dialog;
    
    .select__header {
        padding: 0;
        padding-bottom: 0.4rem;
        margin: 0;
        margin-top: 0.4rem;
    }
}

.section-title.dialog-header {
    opacity: .9;
}

.dialog-header {
    font-weight: 400;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: @text-xxlarge;
    letter-spacing: .05rem;
    overflow: hidden;
    flex-shrink: 1;
    color: @item;
    text-transform: capitalize;
}

.select {
    width: 100%;
}

.pointerMixin (@atTop) when (@atTop) {
    top: -0.9rem;
    transform: rotate(45deg);
}

.pointerMixin (@atTop) when (default()) {
    bottom: -0.9rem;
    transform: rotate(-135deg);
}

.dialog-pointer(@left, @atTop) {
    .pointerMixin(@atTop);
    content: "";
    position: absolute;
    left: @left;
    width: 1.5rem;
    height: 1.5rem;
    background: @bg-dialog;
    border: none;
    border-left: @hairline*1.5 solid @underlines;
    border-top: @hairline*1.5 solid @underlines;
    border-top-left-radius: 0.2rem;
    -webkit-clip-path: polygon(0% 0%, 1.8rem 0%, 0% 1.8rem);
}

// LANGUAGE SPECIFIC STYLES //

/**** JAPANESE *****/

:lang(ja) .dialog-effects-popover {
    width: 13rem;

    ul:before {
        left: 6.4rem;
    }
}
