@import '../styles/z-index';

.Dialog {
    &.dialog-back {
        @include z-index(dialog-back);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    &.size--small {
        .dialog {
            max-width: 512px;
            width: 100%;
            height: max-content;
        }
    }

    .dialog-title {
        margin: 0;
        font-weight: 600;
        font-size: 22px;
        line-height: 28px;
    }

    .dialog-subtitle {
        font-size: 12px;
        margin-top: 8px;
    }

    .backdrop {
        @include z-index(dialog-backdrop);
        position: fixed;
        width: 100%;
        height: 100%;
        background-color: rgba(var(--center-channel-color-rgb), 0.5);
    }

    .wrapper {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .dialog {
        position: relative;
        display: flex;
        flex-direction: column;
        background-color: rgb(var(--center-channel-bg-rgb));
        box-shadow: rgba(var(--center-channel-color-rgb), 0.1) 0 0 0 1px,
            rgba(var(--center-channel-color-rgb), 0.1) 0 2px 4px;
        border-radius: var(--modal-rad);
        padding: 0;
        -webkit-overflow-scrolling: touch;
        overflow-x: hidden;
        overflow-y: auto;

        @media not screen and (max-width: 975px) {
            margin: 72px auto;
            max-width: 975px;
            height: calc(100% - 144px);

            .hideOnWidescreen {
                /* Hide elements on larger screens */
                display: none !important;
            }
        }

        > * {
            flex-shrink: 0;
        }

        > .banner {
            background-color: rgba(230, 220, 192, 0.9);
            text-align: center;
            padding: 10px;
            color: #222;
        }

        > .banner.error {
            background-color: rgba(230, 192, 192, 0.9);
        }

        .IconButton {
            color: rgba(var(--center-channel-color-rgb), 0.56);

            &:hover {
                color: rgba(var(--center-channel-color-rgb), 0.72);
                background-color: rgba(var(--center-channel-color-rgb), 0.08);
            }

            &:active {
                background-color: rgba(var(--button-bg-rgb), 0.08);
                color: rgba(var(--button-bg-rgb), 1);
            }
        }

        .toolbar {
            display: flex;
            flex-direction: row;
            padding: 24px 32px;
            justify-content: space-between;
            align-items: flex-start;
        }

        .toolbar--right {
            display: flex;
            gap: 8px;
            align-items: center;
            height: 28px;
            margin-right: -14px;
        }
    }

    .cardToolbar {
        width: 100%;
        margin: 0 16px;
    }
}
