@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-modal.hidden {
    display: none !important;
}

#loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    margin: 0;
}

#loading-modal #loading-modal-container {
    margin: auto;

    color: white;
    text-shadow: 0 1px 2px rgb(0, 0, 0);
    font-size: calc(var(--global--font-size-base) * 1.25);
}

#loading-modal :not(#loading-modal-container) {
    flex-grow: 1;
    flex-basis: 0;
}

#loading-modal #loading-modal-container #loading-modal-spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;

    aspect-ratio: 1;
    max-height: 20vh;
    height: 100px;
    margin: auto;
}

#loading-modal #loading-modal-container #loading-modal-spinner.spin {
    animation: spin 2s linear infinite;
}

body:has(#loading-modal:not(.hidden)) {
    overflow: hidden;
}