/*!
 * Copyright 2020 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Dialog
.k-dialog {
    min-width: 90px;
    min-height: 3em;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    position: fixed;
    overflow: hidden;

    // Centered
    &.k-dialog-centered {
        transform: translate(-50%, -50%);
        top: 50%;
        left: 50%;
    }
}


// Titlebar
.k-dialog-titlebar {
    padding: 12px;
}
.k-dialog-title {
    font-size: 1.4em;
}


// Titlebar actions
.k-dialog-titlebar .k-dialog-actions {
    top: 9px;
}
.k-dialog-titlebar .k-dialog-close {}
.k-dialog-titleless .k-dialog-titlebar .k-dialog-close {
    position: absolute;
    top: (@window-titlebar-padding-y / 2);
    right: (@window-titlebar-padding-x / 2);
}


// Content
.k-dialog .k-content {
    padding: (@window-inner-padding-y * 1.75) @window-inner-padding-x;
    height: auto;
}
.k-dialog.k-dialog-titleless .k-content {
    padding: 2.4em;
}


// Buttons
.k-dialog-buttongroup {
    margin: 0;
    padding: @window-inner-padding-y @window-inner-padding-x;
    width: 100%;
    border-radius: 0;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-end;

    .k-button {
        flex: 0 0 auto;
        display: inline-block;
        text-overflow: ellipsis;
        box-sizing: border-box;
    }
    .k-button + .k-button {
        margin-left: 0.5em;
    }

    &.k-dialog-button-layout-stretched {
        padding: 0;

        .k-button {
            margin: 0;
            border-radius: 0;
            border-bottom: 0;
            border-width: 1px 0 0 1px;
            flex: 1 0 0;
            white-space: nowrap;
        }
        .k-button:first-child {
            border-radius: 0;
            border-left-width: 0;
        }
        .k-button:last-child {
            border-radius: 0;
            border-right-width: 0;
        }
    }
}
.k-no-flexbox .k-dialog-buttongroup {
    display: block;
    text-align: right;
}
.k-no-flexbox .k-rtl .k-dialog-button-group {
    text-align: left;
}


// Predefined dialogs
.k-dialog.k-alert,
.k-dialog.k-prompt,
.k-dialog.k-confirm {

    .k-dialog-titlebar {
        border-width: 0;
        color: inherit;
        background: none;
    }

    .k-dialog-content {
        padding: (@window-inner-padding-y * 2) (@window-inner-padding-x * 2);
    }
}
.k-dialog.k-prompt {

    .k-dialog-content,
    .k-prompt-container {
        padding: @window-inner-padding-y (@window-inner-padding-x * 2);
    }
}
