/* Pickleball Loading Animation */
.pickleball-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    color: white;
}

.pickleball-court {
    position: relative;
    width: 240px;
    height: 140px;
    border: 3px solid white;
    border-radius: 8px;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Court lines */
.court-line {
    position: absolute;
    background: white;
}

.net {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.service-line {
    width: 100%;
    height: 1px;
    left: 0;
}

.service-line.left {
    top: 25%;
}

.service-line.right {
    top: 75%;
}

.center-line {
    width: 1px;
    height: 50%;
    left: 50%;
    top: 25%;
    transform: translateX(-50%);
}

/* Paddles */
.paddle {
    position: absolute;
    width: 8px;
    height: 24px;
    background: #1f2937;
    border-radius: 2px;
    z-index: 8;
}

.paddle.left {
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    animation: paddleLeft 2s ease-in-out infinite;
}

.paddle.right {
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    animation: paddleRight 2s ease-in-out infinite;
}

/* Paddle handles */
.paddle::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 16px;
    background: #8b5cf6;
    border-radius: 2px;
    bottom: -16px;
    left: 2px;
}

/* Animated pickleball */
.pickleball {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fbbf24;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
}

/* Holes in the ball */
.pickleball::before,
.pickleball::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: #d97706;
    border-radius: 50%;
}

.pickleball::before {
    top: 2px;
    left: 2px;
}

.pickleball::after {
    top: 6px;
    right: 2px;
}

/* Ball rally animation */
.ball-bounce {
    animation: ballRally 2s ease-in-out infinite;
}

@keyframes ballRally {
    0% {
        left: 30px;
        transform: translateY(-50%) scale(1);
    }
    20% {
        left: 80px;
        transform: translateY(-70%) scale(0.9);
    }
    25% {
        left: 90px;
        transform: translateY(-50%) scale(1);
    }
    45% {
        left: 140px;
        transform: translateY(-65%) scale(0.9);
    }
    50% {
        left: 150px;
        transform: translateY(-50%) scale(1);
    }
    70% {
        left: 100px;
        transform: translateY(-65%) scale(0.9);
    }
    75% {
        left: 90px;
        transform: translateY(-50%) scale(1);
    }
    95% {
        left: 40px;
        transform: translateY(-70%) scale(0.9);
    }
    100% {
        left: 30px;
        transform: translateY(-50%) scale(1);
    }
}

/* Paddle animations */
@keyframes paddleLeft {
    0%, 100% {
        transform: translateY(-50%) rotate(-5deg);
    }
    25% {
        transform: translateY(-50%) rotate(15deg);
    }
    50% {
        transform: translateY(-50%) rotate(-5deg);
    }
    75% {
        transform: translateY(-50%) rotate(10deg);
    }
}

@keyframes paddleRight {
    0%, 100% {
        transform: translateY(-50%) rotate(5deg);
    }
    25% {
        transform: translateY(-50%) rotate(-10deg);
    }
    50% {
        transform: translateY(-50%) rotate(5deg);
    }
    75% {
        transform: translateY(-50%) rotate(-15deg);
    }
}

/* Loading text animation */
.loading-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Progress dots */
.loading-dots {
    display: flex;
    space-x: 0.5rem;
    margin-top: 1rem;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: dot-bounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes dot-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Fade out transition */
.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Loading progress bar */
.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.loading-progress-bar {
    height: 100%;
    background: white;
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: 200px 0;
    }
}

/* Responsive design */
@media (max-width: 640px) {
    .pickleball-court {
        width: 160px;
        height: 96px;
    }
    
    .loading-text {
        font-size: 1.25rem;
    }
}