/* Modern Loading Screen and Ball Spinner */

/* Base spinner overlay */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    background: rgba(14, 15, 22, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.spinner-overlay::after {
    content: "Loading...";
    display: block;
    margin-top: 30px;
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #ffffff;
    letter-spacing: 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

.spinner-overlay::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0),
        rgba(13, 102, 233, 0.7),
        rgba(0, 0, 0, 0)
    );
    animation: loading-bar 2s ease-in-out infinite;
    z-index: 1051;
}

/* Enhanced 3D Box container */
.box {
    margin: 0 auto;
    width: 60px;
    height: 140px;
    position: relative;
    perspective: 600px;
}

/* Stylish shadow with gradient */
.shadow {
    position: absolute;
    width: 100%;
    height: 10px;
    background: radial-gradient(
        ellipse at center,
        rgba(13, 102, 233, 0.5) 0%,
        rgba(0, 0, 0, 0) 80%
    );
    bottom: 0;
    border-radius: 100%;
    transform: scaleX(0.8);
    opacity: 0.6;
    filter: blur(2px);
    animation: shadowScale 1s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}

/* 3D gravity container */
.gravity {
    width: 60px;
    height: 60px;
    position: absolute;
    bottom: 10px;
    animation: bounce 1.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
    transform-style: preserve-3d;
    will-change: transform;
}

/* Modern ball with glass effect and glow */
.ball {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-image: linear-gradient(
            135deg,
            #1d1f29 0%,
            #2a2d3a 50%,
            #1d1f29 100%
        ),
        url("https://cdn2.iconfinder.com/data/icons/activity-5/50/26BD-soccer-ball-128.png");
    background-size: cover;
    background-blend-mode: overlay;
    box-shadow: 0 0 20px rgba(13, 102, 233, 0.4),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    animation: roll 1s linear infinite, glow 2s ease-in-out infinite;
    will-change: transform;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Glass reflection effect */
.ball::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0) 70%
    );
    animation: shine 2s linear infinite;
    pointer-events: none;
}

/* Progress circles */
.progress-circles {
    display: flex;
    margin-top: 20px;
}

.progress-circle {
    width: 8px;
    height: 8px;
    margin: 0 4px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    animation: progress-pulse 1.5s infinite ease-in-out;
}

.progress-circle:nth-child(1) {
    animation-delay: 0s;
}
.progress-circle:nth-child(2) {
    animation-delay: 0.2s;
}
.progress-circle:nth-child(3) {
    animation-delay: 0.4s;
}

/* Animation Keyframes */
@keyframes shine {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%,
    100% {
        transform: translateY(0) rotateX(0deg);
    }
    50% {
        transform: translateY(30px) rotateX(5deg);
    }
}

@keyframes shadowScale {
    0%,
    100% {
        transform: scaleX(0.8);
        opacity: 0.6;
    }
    50% {
        transform: scaleX(1.4);
        opacity: 0.8;
    }
}

@keyframes roll {
    0% {
        transform: rotateZ(0deg);
    }
    100% {
        transform: rotateZ(360deg);
    }
}

@keyframes glow {
    0%,
    100% {
        box-shadow: 0 0 20px rgba(13, 102, 233, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(13, 102, 233, 0.7);
    }
}

@keyframes loading-bar {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

@keyframes progress-pulse {
    0%,
    100% {
        transform: scale(1);
        background-color: rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: scale(1.5);
        background-color: rgba(13, 102, 233, 0.8);
    }
}

/* Media Queries */
@media (max-width: 768px) {
    .ball {
        width: 50px;
        height: 50px;
    }

    .gravity {
        width: 50px;
        height: 50px;
    }

    .spinner-overlay::after {
        font-size: 14px;
    }
}
