#loading-spinner {
    display: none; /* hidden by default */
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--overlay-bg);
    z-index: 9999;

    justify-content: center;
    align-items: center;
}

#loading-spinner.active {
    display: flex;
}

.spinner-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 32px;
    border-radius: 16px;
    background: var(--base-title-box-bg);
    border: 1px solid var(--color-main);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.dots-loader {
    display: flex;
    gap: 12px;
}

.dots-loader div {
    width: 14px;
    height: 14px;
    background-color: var(--color-main);
    border-radius: 50%;
    animation: pulse 1.2s infinite ease-in-out;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.dots-loader div:nth-child(2) {
    animation-delay: 0.2s;
}
.dots-loader div:nth-child(3) {
    animation-delay: 0.4s;
}
.dots-loader div:nth-child(4) {
    animation-delay: 0.6s;
}

.spinner-text {
    font-size: 0.95rem;
    color: var(--color-main);
    font-weight: 500;
    text-align: center;
    margin-top: 8px;
}

/* Hide text if empty */
.spinner-text:empty {
    display: none;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}
