body:has(dialog.modal[open]) {
    overflow: hidden;
}

dialog.modal[open] {
    all: unset;
    z-index: 3;
    margin: 0;
    padding: 0;
    border: none;
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

dialog.modal::backdrop {
    width: 100%;
    background: 100%;
    background: rgba(0, 0, 0, 0.5);
}

dialog.modal[open] {
    display: flex;
}

dialog.modal div.modal-container {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    user-select: text;
}

dialog.modal.alert div.modal-container {
    max-width: 350px;
}

dialog.modal.fullwidth div.modal-container {
    width: 100vw;
    height: 100vh;
    min-width: 100vw;
    min-height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
}

dialog.modal div.modal-container div.modal-header,
dialog.modal div.modal-container div.modal-content,
dialog.modal div.modal-container div.modal-footer {
    padding: 16px;
}

dialog.modal div.modal-container div.modal-header {
    font-size: 1.25rem;
    font-weight: bold;
}

/* dialog.modal.alert div.modal-container div.modal-header {
    text-align: center;
} */

dialog.modal:not(.alert) div.modal-container div.modal-header {
    border-bottom: 1px solid #ddd;
}

dialog.modal div.modal-container div.modal-header button.close {
    float: right;
    padding: 5px;
    margin-top: -5px;
    margin-right: -5px;
}

dialog.modal.alert div.modal-container div.modal-content.alert {
    justify-content: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    font-size: 1.3em;
    color: var(--color-gray-600);
}

dialog.modal.alert div.modal-container div.modal-content.alert svg {
    width: 64px;
    height: 64px;
}

dialog.modal.alert div.modal-container div.modal-content.alert svg path {
    stroke-width: 2;
}

dialog.modal.alert div.modal-container div.modal-content.alert.success svg path {
    color: var(--color-success);
}

dialog.modal.alert div.modal-container div.modal-content.alert.error svg path {
    color: var(--color-error);
}

dialog.modal.alert div.modal-container div.modal-content.alert.warning svg path {
    color: var(--color-warning);
}

dialog.modal:not(.alert) div.modal-container div.modal-footer {
    text-align: right;
    border-top: 1px solid #ddd;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 15px;
}

dialog.modal.alert div.modal-container div.modal-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

dialog.modal.fullwidth div.modal-container div.modal-footer {
    margin-top: auto;
}

dialog.modal div.modal-container div.modal-footer button.btn {
    display: inline-flex;
}

/* prettier-ignore */
dialog.modal div.modal-container div.modal-footer form button.fullwidth {
    width: 100%;
}
