// (C) 2007-2020 GoodData Corporation
@import "mixins";

$column-gutter: 30px;

.gd-dialog,
.overlay.gd-dialog {
    position: relative;
    z-index: 2;
    padding: 20px;
    outline: 0;
    max-width: $modalDialog-maxWidth;

    /**
     * Row inside a row has negative margin.
     * Dialog can be inserted anywhere to the DOM,
     * we have to set default value to be consistent
     * across all applications
     */
    .row {
        width: auto;
        margin-left: -$column-gutter/2;
        margin-right: -$column-gutter/2;
    }

    .gd-dialog-close,
    .gd-dialog-close.gd-button-link {
        position: absolute;
        z-index: 5;
        top: 14px;
        right: 4px;
        outline: none;

        &::before {
            color: $gd-color-link;
        }

        @include active-states {
            box-shadow: none;
            border-color: transparent;

            &::before {
                color: $gd-color-highlight;
            }
        }
    }
}

.gd-dialog.gd-confirm {
    max-width: 350px;

    .gd-dialog-close,
    .gd-dialog-close.gd-button-link {
        top: 10px;
    }
}

.gd-dialog-header {
    @include text-overflow();

    margin: 0 30px 20px 0;

    h2,
    h3 {
        @include text-overflow();

        line-height: 1.2;
    }

    h2 {
        @include gd-heading-2;
    }

    h3 {
        @include gd-heading-3;
    }
}

.gd-dialog-icon {
    @include gd-heading-1;

    display: inline-block;
    width: 35px;
    vertical-align: middle;

    &::before {
        color: $gd-color-highlight;
    }
}

.gd-dialog-section {
    margin-bottom: 20px;

    & + .gd-dialog-footer {
        margin-top: 30px;
    }
}

.gd-dialog-section-separated {
    @extend .gd-dialog-section;

    padding-bottom: 20px;
    border-bottom: 1px solid $gd-border-color;

    & + & {
        margin-top: 20px;
    }
}

.gd-dialog-warning {
    width: 100%;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 4px;
    background-color: #fff3f2;
    color: $gd-color-negative;
}

.gd-dialog-content,
.gd-dialog-section,
.gd-dialog-section-separated {
    p {
        &:first-of-type {
            margin-top: 0;
        }

        &:last-of-type {
            margin-bottom: 0;
        }
    }
}

.gd-dialog-footer {
    margin-top: 20px;
    text-align: right;
}

/* Export Dialog
   ========================================================================== */

.gd-export-dialog {
    min-width: 350px;

    .gd-dialog-header h3 {
        margin: 0;
        padding: 0;
    }

    h6 {
        margin: 0;
        padding: 12px 0 0;
    }

    h6:first-child {
        padding-top: 0;
    }

    .input-label-text {
        margin-left: 3px;
    }
}
