
::backdrop {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px);
}

dialog {
    --dialog-fade-time: 0.3s;
    overflow: hidden;
    padding: 0;
    border-radius: 10px;
    border-color: var(--gradient-color-1);
    box-shadow: 0 0 5px var(--gradient-color-1);
    background-color: var(--color-card-bg);

    &.transparent {
        background-color: var(--color-card-bg-80);
    }

    color: var(--color-fg);

    transition: display var(--dialog-fade-time) allow-discrete, overlay var(--dialog-fade-time) allow-discrete;
    animation: closeDlg var(--dialog-fade-time) forwards;

    &[open] {
        animation: openDlg var(--dialog-fade-time) forwards;
    }

    & .dialogTitle {
        user-select: none;
        position: relative;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        height: 30px;

        & h4 {
            padding: 0 5px;
        }

        & .closeBtn {
            user-select: none;
            position: absolute;
            z-index: 1;
            top: 0;
            right: 0;
            height: 30px;
            width: 40px;
            background: var(--gradient-color-2);
            border: none;
            border-left: 1px solid var(--gradient-color-1);
            border-bottom-left-radius: 10px;
            color: var(--color-headline-on-gradient);
            cursor: pointer;
            transition: background 0.2s ease-in-out;

            &:hover {
                background: var(--gradient-color-1);
            }
        }
    }

    & .dialogContent {
        position: relative;
        width: fit-content;
        height: fit-content;
        overflow: auto;
    }
}


dialog:not([open]) {
    pointer-events: none;
    opacity: 0;
}

@keyframes openDlg {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes closeDlg {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}