.popup {
    box-sizing: border-box;
    border: 2px solid black;
    padding: 0.4em 0.4em 0.4em 1em;
    border-radius: 1.2em;
    width: calc(96vw - (100vw - 100%));
    max-width: 872px;
    position: fixed;
    z-index: 1;
    top: 50%;
    transform: translate(0%, -50%);
    margin: auto;
    visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4em;
    overflow-y: auto;
    overflow-x: auto;
    background: white;
}

.show {
    animation: fadeIn 0.5s;
    animation-fill-mode: forwards;
}

.hide {
    animation: fadeOut 0.5s;
    animation-fill-mode: forwards;
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
        visibility: visible;
    }
    to {
        opacity: 0;
        visibility: hidden;
        }
}

.popup::-webkit-scrollbar {
    width: 30px;
    height: 30px;
}

.popup::-webkit-scrollbar-track {
    background: transparent;
}

.popup::-webkit-scrollbar-thumb {
    background-color: grey;
    border-radius: 16px;
    border: 12px solid white;
}

.popup .close-icon {
    position: absolute;
    top: 0.3em;
    right: 0.3em;
    width: 1.8em;
}

.popup .caption {
    font-weight: bold;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: var(--header-size);
}

.error-popup {
    box-sizing: border-box;
    border-bottom: 2px solid var(--error-red);
    padding: 0.4em 0.4em 0.4em 0.4em;
    width: 100vw;
    position: fixed;
    z-index: 1;
    top: 0;
    visibility: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background: var(--error-red-light);
}

.error-popup span.error-message {
    color: var(--error-red);
}

@media (max-width: 1000px) {
    .popup {
        max-height: 80vh;
        left: 2vw;
    }
}

@media (min-width: 1001px) {
    .popup {
        max-height: calc(100vh - 4vw);
        left: calc(50vw - 450px);
    }
}