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

.modal {
    display: block;
    position: fixed;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    z-index: -10000;
    left: 50%;
    top: 5%;
    translate: -50%;
    background-color: var(--gray-700);
    border-radius: var(--border-radius-small);
    padding: 2em;
    min-width: 20%;
}

.modal[data-visible] {
    visibility: visible;
    z-index: 10000000000;
    animation: fadeIn 0.2s ease-in-out forwards;
    pointer-events: all;
}

body[modal-opened]:after {
    content: "";
    position: fixed;
    z-index: 100000000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

body[modal-opened] {
    overflow: hidden;
}

.modal > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2em;
    margin-bottom: 2em;
}

.modal > header > span {
    font-size: 1.5em;
    font-weight: 500;
}

.modal > header > button {
    margin-left: auto;
    background-color: transparent;
    border: none;
    cursor: pointer;
}

.modal > header > button:hover {
    filter: brightness(0.7);
}

.modal > header > button > img {
    width: 2em;
    aspect-ratio: 1;
}

.modal > main {
    max-height: 60vh;
    overflow-y: auto;
}

.modal > footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 3em;
    gap: 1rem;
}

/* Prompt Modal */
.input__wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
}

.input__wrapper > label {
    opacity: var(--text-opacity-convergence);
}

.input__wrapper .simple_input {
    background-color: var(--gray-300);
}

.prompt-modal--template:not(:first-child) {
    margin-top: 1em;
}