
@media (aspect-ratio < 0.7) {
    .dialog-container {
        font-size: 3.3vw;
        input, select, label {
            font-size: 3.0vw;
        }
    }
}

dialog.dialog-container[open] {
    overflow: hidden;
    box-sizing: border-box;
    max-width: 95%;
    padding: 4px;
    color: var(--fg-color);
    background-color: var(--bg-color);
    border: 2px solid var(--dialog-border-color);
    filter: drop-shadow(1px 1px 10px var(--dialog-shadow-color));
    display: flex;
    flex-direction: column;
}

::backdrop {
    background-color: var(--dialog-bg-dim-color);
}
  
.dialog-header {
    width: 100%;
    box-sizing: border-box;
    background-color: var(--dialog-title-bg-color);
    padding: 4px;
    height: 2.2lh;
    min-height: 2.2lh;
    line-height: 100%;
    text-align: center;
    margin-bottom: 5px;
    .dialog-title {
        display: inline-block;
        vertical-align: middle;
        text-align: center;
        padding-top: 0.35lh;
        margin-left: 1.8lh;
        font-size: larger;
        font-weight: bold;
        color: var(--dialog-title-fg-color);
    }
    .close-button {
        float: inline-end;
        background-color: var(--dialog-title-bg-color);
        color: var(--dialog-title-fg-color);
        border: none;
        padding: 0.3lh !important;
        height: 100%;
        box-sizing: border-box;
        &:hover, &:focus {
            background-color: red;
            color: white;
            border: none;
        }
        .svg-icon {
            padding: 0 4px;
            fill: var(--dialog-title-fg-color);
            vertical-align: middle;
        }
    }
}

.dialog-main {
    overflow: auto;
    box-sizing: border-box;
    width: 100%;
    padding: 6px;
}

#dialog-about .dialog-main {
    padding: 25px;
    line-height: 150%;
}

#dialog-set-selector {
    min-width: min(50ch, 95%);
    max-width: 95%;
    max-height: 95%;
    .dialog-main {
        overflow-y: scroll;
        height: 100%;
    }
    table {
        width: 100%;
        user-select: none;
        th, td {
            &:first-child {
                width: 12ch;
                text-align: center;
            }
        }
        span {
            text-wrap: nowrap;
        }
    }
    #input-set-filter-name {
        appearance: none;
        color: var(--input-fg-color);
        background-color: var(--input-bg-color);
        border-color: var(--input-border-color);
        border-style: solid;
        width: 99%;
        padding: 2px 0.5ch;
    }
}

#dialog-config {
    width: 80%;
    min-width: min(90ch, 95%);
    max-width: 95%;
    max-height: 95%;
    .dialog-main {
        font-size: 90%;
        select {
            font-size: 90%;
        }
        table {
            user-select: none;
            th, td {
                &:first-child {
                    width: 17ch;
                    text-align: center;
                    font-weight: 500;
                }
                &:last-child {
                    line-height: 200%;
                }
                span {
                    text-wrap: nowrap;
                    margin-right: 10px;
                }
            }
            .keyboard-shortcut {
                font-size: smaller;
                font-weight: 300;
                color: var(--fg-dim-color);
            }
        }
    }
}

@media (aspect-ratio >= 1.2) {
    #dialog-export-image .dialog-main {
        flex-direction: row;
    }
    #dialog-export-options {
        margin-left: 8px;
        padding-left: 7px;
        border-left: 3px solid var(--table-alternate-color);
    }
}

@media (aspect-ratio < 1.2) {
    #dialog-export-image .dialog-main {
        flex-direction: column-reverse;
    }
    #dialog-export-preview {
        max-height: 50vh;
    }
    #dialog-export-options {
        margin-bottom: 8px;
        padding-bottom: 7px;
        border-bottom: 3px solid var(--table-alternate-color);
    }
}

#dialog-export-image {
    width: 80%;
    min-width: min(110ch, 95%);
    max-width: 95%;
    max-height: 95%;
    .dialog-main {
        display: flex;
        overflow: hidden;
    }
    #dialog-export-preview {
        flex: 1 0;
        aspect-ratio: 1;
        margin: 2px;
        padding: 8px;
        box-sizing: border-box;
        overflow: hidden;
    }
    #dialog-export-options {
        overflow-y: auto;
        flex: 1.7 1;
        max-height: fit-content;
        min-width: 54ch;
        table {
            th, td {
                &:first-child {
                    width: 8ch;
                    text-align: center;
                    font-weight: 500;
                }
                &:last-child {
                    line-height: 200%;
                }
                span {
                    text-wrap: nowrap;
                    margin-right: 10px;
                }
            }
        }
        #input-export-file-png-size {
            margin-left: 0.5ch;
        }
    }
}

dialog {
    user-select: none;
}

#midi-connection-status {
    display: inline;
    padding: 3px 8px;
    border-radius: 4px;
    &[status="0"] {
        background-color: #7773;
    }
    &[status="1"] {
        background-color: #00f3;
    }
    &[status="2"] {
        background-color: #0f03;
    }
    &[status="3"] {
        background-color: #f003;
    }
    font-size: 90%;
}
