/* NSK Identity Colors */
:root {
    --nsk-blue: #003E7E;
    --nsk-light-blue: #00A3E0;
    --nsk-silver: #C0C0C0;
    --nsk-white: #FFFFFF;
}

/* Bearing Spinner Container */
.bearing-spinner-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none;
    /* Toggled via JS */
}

.bearing-spinner-container.active {
    opacity: 1;
    display: block;
    transform: translate(-50%, -50%) scale(1);
}

/* Outer Ring (Stator) - Dark Blue */
.bearing-outer-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 12px solid var(--nsk-blue);
    border-top-color: transparent;
    border-left-color: rgba(0, 62, 126, 0.4);
    box-shadow: 0 0 20px rgba(0, 62, 126, 0.3);
    animation: spin-clockwise 1.2s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

/* Inner Ring (Rotor) - Light Blue */
.bearing-inner-ring {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    border: 8px solid var(--nsk-light-blue);
    border-bottom-color: transparent;
    border-right-color: rgba(0, 163, 224, 0.4);
    animation: spin-counter-clockwise 0.8s linear infinite;
}

/* Rolling Elements (Balls) - Silver/Chrome effect */
.bearing-balls {
    position: absolute;
    top: 15%;
    left: 15%;
    width: 70%;
    height: 70%;
    animation: spin-clockwise 2s linear infinite;
}

.ball {
    position: absolute;
    width: 14px;
    height: 14px;
    background: radial-gradient(circle at 30% 30%, #ffffff, var(--nsk-silver));
    border-radius: 50%;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

/* Ball positions */
.ball:nth-child(1) {
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ball:nth-child(2) {
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
}

.ball:nth-child(3) {
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
}

.ball:nth-child(4) {
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
}

.ball:nth-child(5) {
    top: 14.6%;
    left: 14.6%;
    transform: translate(-50%, -50%);
}

.ball:nth-child(6) {
    top: 14.6%;
    right: 14.6%;
    transform: translate(50%, -50%);
}

.ball:nth-child(7) {
    bottom: 14.6%;
    right: 14.6%;
    transform: translate(50%, 50%);
}

.ball:nth-child(8) {
    bottom: 14.6%;
    left: 14.6%;
    transform: translate(-50%, 50%);
}


/* Center Branding - Pulsing */
.bearing-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 0 15px var(--nsk-light-blue);
    animation: pulse-center 1s ease-in-out infinite alternate;
}

/* Animations */
@keyframes spin-clockwise {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes spin-counter-clockwise {
    0% {
        transform: rotate(360deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

@keyframes pulse-center {
    0% {
        box-shadow: 0 0 5px var(--nsk-light-blue);
        opacity: 0.7;
    }

    100% {
        box-shadow: 0 0 20px var(--nsk-light-blue);
        opacity: 1;
    }
}

/* Loading Text under spinner */
.spinner-label {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    letter-spacing: 2px;
    white-space: nowrap;
    text-transform: uppercase;
    animation: fade-pulse 2s infinite;
}

@keyframes fade-pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}