*, *::after, *::before {
    box-sizing: border-box;
}

.spinner {
    margin: 25%;
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    overflow: hidden;
    position: relative;
    animation: text-color 2s ease-in-out infinite alternate;
}

.spinner-sector {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 15px solid;
    mix-blend-mode: overlay;
    pointer-events: none;
    /* Use CSS variables for animation duration/timing */
    animation: rotate var(--duration, 2s) var(--timing, linear) infinite;
}

/* Sector-specific colors and custom properties */
.spinner-sector-red {
    border-top-color: #be1515;
    --duration: 1.5s;
    --timing: ease-in-out;
}
.spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}
 
.spinner-sector-blue {
    border-left-color: #1b8fb5;
    --duration: 2s;
    --timing: ease-in;
}

.spinner-sector-green {
    border-right-color: #097a09;
    --duration: 2.5s;
    --timing: ease-out;
}

@keyframes rotate {
    0% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes text-color {
    0% {
        color: rgba(0, 0, 0, 1);
    }

    50% {
        color: rgba(0, 0, 0, 0.5);
    }

    100% {
        color: rgba(0, 0, 0, 0.1);
    }
}
