/* 3D Sports Loading Animation Styles */
.sports-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: all 0.8s ease-out;
    perspective: 1000px;
    overflow: hidden;
}

.sports-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: white;
}

/* Modern Sport Images Loading Animation */
.basketball-container {
    position: relative;
    width: 300px;
    height: 200px;
    margin: 0 auto 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.sports-carousel {
    display: flex;
    width: 500%;
    animation: carouselSlide 2s infinite ease-in-out;
}

.sport-slide {
    width: 20%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sport-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255,255,255,0.3);
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.3),
        inset 0 0 0 2px rgba(255,255,255,0.1);
    transition: all 0.5s ease;
    filter: brightness(0.9) contrast(1.1);
}

.sport-image:hover {
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.5);
    filter: brightness(1.1) contrast(1.2);
}

/* Fallback for missing images */
.sport-icon-fallback {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    border: 4px solid rgba(255,255,255,0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.basketball-fallback { background: linear-gradient(135deg, #ff8800, #ff6600); }
.tennis-fallback { background: linear-gradient(135deg, #98ff98, #66cc66); }
.volleyball-fallback { background: linear-gradient(135deg, #ffffff, #f0f0f0); }
.badminton-fallback { background: linear-gradient(135deg, #4CAF50, #2196F3); }
.tabletennis-fallback { background: linear-gradient(135deg, #f44336, #ff5722); }

.sport-slide::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 1.5s linear infinite;
    pointer-events: none;
}

@keyframes carouselSlide {
    0%, 20% { transform: translateX(0%); }
    25%, 45% { transform: translateX(-20%); }
    50%, 70% { transform: translateX(-40%); }
    75%, 95% { transform: translateX(-60%); }
    100% { transform: translateX(-80%); }
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress bar under carousel */
.carousel-progress {
    position: absolute;
    bottom: 10px;
    left: 20px;
    right: 20px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}

.carousel-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 20%;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff);
    border-radius: 2px;
    animation: progressMove 2s infinite ease-in-out;
}

@keyframes progressMove {
    0%, 20% { transform: translateX(0%); }
    25%, 45% { transform: translateX(100%); }
    50%, 70% { transform: translateX(200%); }
    75%, 95% { transform: translateX(300%); }
    100% { transform: translateX(400%); }
}

/* Loading Text - Modern Carousel Sync */
.loading-text {
    margin-top: 30px;
}

.loading-text h2 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: modernTextFlow 2s ease-in-out infinite;
    letter-spacing: 2px;
    background: linear-gradient(45deg, #ffffff, #e3f2fd, #ffffff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes modernTextFlow {
    0% {
        opacity: 1;
        transform: translateY(0px);
        background-position: 0% 50%;
    }
    
    25% {
        opacity: 0.9;
        transform: translateY(-2px);
        background-position: 100% 50%;
    }
    
    50% {
        opacity: 1;
        transform: translateY(0px);
        background-position: 200% 50%;
    }
    
    75% {
        opacity: 0.9;
        transform: translateY(-2px);
        background-position: 100% 50%;
    }
    
    100% {
        opacity: 1;
        transform: translateY(0px);
        background-position: 0% 50%;
    }
}

/* Loading Dots - Modern Carousel Sync */
.loading-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: modernDotFlow 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.4s; }
.loading-dots span:nth-child(3) { animation-delay: 0.8s; }
.loading-dots span:nth-child(4) { animation-delay: 1.2s; }

@keyframes modernDotFlow {
    0%, 80% {
        transform: scale(1);
        opacity: 0.6;
        background: rgba(255, 255, 255, 0.6);
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
    }
    
    20% {
        transform: scale(1.4);
        opacity: 1;
        background: rgba(100, 181, 246, 0.9);
        box-shadow: 0 0 16px rgba(100, 181, 246, 0.6);
    }
}

/* Sports Icons */
.sports-icons {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.sport-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    animation: iconFloat 3s ease-in-out infinite;
    backdrop-filter: blur(10px);
}

.sport-icon:nth-child(1) { animation-delay: 0s; }
.sport-icon:nth-child(2) { animation-delay: 0.5s; }
.sport-icon:nth-child(3) { animation-delay: 1s; }
.sport-icon:nth-child(4) { animation-delay: 1.5s; }

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-10px) rotate(180deg);
        opacity: 1;
    }
}

/* Tennis Ball Animation */
.tennis-container {
    position: relative;
    width: 120px;
    height: 200px;
    margin: 0 auto 30px;
}

.tennis-ball {
    width: 70px;
    height: 70px;
    background: #ffe135;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    animation: tennisBounce 0.8s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 225, 53, 0.8);
}

.tennis-ball::before,
.tennis-ball::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 2px;
    background: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 2px;
}

.tennis-ball::before {
    transform: translate(-50%, -50%) rotate(-30deg);
}

.tennis-ball::after {
    transform: translate(-50%, -50%) rotate(30deg);
}

@keyframes tennisBounce {
    0%, 100% {
        top: 130px;
        animation-timing-function: ease-out;
        transform: translateX(-50%) scaleY(1);
    }
    50% {
        top: 30px;
        animation-timing-function: ease-in;
        transform: translateX(-50%) scaleY(0.9);
    }
}

/* Volleyball Animation */
.volleyball-container {
    position: relative;
    width: 120px;
    height: 200px;
    margin: 0 auto 30px;
}

.volleyball {
    width: 75px;
    height: 75px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    animation: volleyballBounce 1s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6), inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.volleyball-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.volleyball-lines::before,
.volleyball-lines::after {
    content: '';
    position: absolute;
    background: #333;
    border-radius: 1px;
}

.volleyball-lines::before {
    width: 2px;
    height: 75px;
    left: 50%;
    transform: translateX(-50%);
}

.volleyball-lines::after {
    height: 2px;
    width: 75px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes volleyballBounce {
    0%, 100% {
        top: 125px;
        animation-timing-function: ease-out;
    }
    50% {
        top: 25px;
        animation-timing-function: ease-in;
    }
}

/* Progress Bar */
.progress-container {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    margin: 20px auto;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    border-radius: 3px;
    animation: progressFill 3s ease-in-out infinite;
}

@keyframes progressFill {
    0% {
        width: 0%;
        transform: translateX(-100%);
    }
    50% {
        width: 100%;
        transform: translateX(0%);
    }
    100% {
        width: 100%;
        transform: translateX(100%);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .loading-text h2 {
        font-size: 1.5rem;
    }
    
    .basketball-container {
        width: 250px;
        height: 160px;
        margin: 0 auto 30px;
    }
    
    .sport-image,
    .sport-icon-fallback {
        width: 90px;
        height: 90px;
    }
    
    .sport-icon-fallback {
        font-size: 2rem;
    }
    
    .sport-slide {
        height: 120px;
    }
    
    .tennis-container,
    .volleyball-container {
        width: 100px;
        height: 150px;
    }
    
    .tennis-ball {
        width: 55px;
        height: 55px;
    }
    
    .volleyball {
        width: 58px;
        height: 58px;
    }
    
    .sport-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .sports-icons {
        gap: 20px;
    }
    
    .progress-container {
        width: 150px;
    }
}

/* Hide page content during loading */
body.loading {
    overflow: hidden;
}

body.loading .page-content {
    opacity: 0;
    visibility: hidden;
}

.page-content {
    opacity: 1;
    visibility: visible;
    transition: all 0.5s ease-in-out;
}

/* Alternative loading animations that can be toggled */
.sports-loader.basketball-theme .basketball-container {
    display: block;
}

.sports-loader.tennis-theme .tennis-container {
    display: block;
}

.sports-loader.volleyball-theme .volleyball-container {
    display: block;
}

/* Hide non-active animations */
.tennis-container,
.volleyball-container {
    display: none;
}

/* Particle effects */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: particleFloat 4s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 0.5s; }
.particle:nth-child(3) { left: 30%; animation-delay: 1s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1.5s; }
.particle:nth-child(5) { left: 50%; animation-delay: 2s; }
.particle:nth-child(6) { left: 60%; animation-delay: 0.3s; }
.particle:nth-child(7) { left: 70%; animation-delay: 0.8s; }
.particle:nth-child(8) { left: 80%; animation-delay: 1.3s; }
.particle:nth-child(9) { left: 90%; animation-delay: 1.8s; }

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}
