/* Loading Animations for Match Scheduling */

/* Spinner Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

.loading-spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse Animation */
.loading-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #007bff;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-pulse:nth-child(2) { animation-delay: -1.1s; }
.loading-pulse:nth-child(3) { animation-delay: -1.0s; }
.loading-pulse:nth-child(4) { animation-delay: -0.9s; }

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

/* Match Generation Loading Overlay */
.match-generation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.match-generation-overlay.show {
    opacity: 1;
    visibility: visible;
}

.match-generation-content {
    background: #2c3e50;
    padding: 3rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease-in-out;
}

.match-generation-overlay.show .match-generation-content {
    transform: translateY(0);
}

.match-generation-icon {
    font-size: 4rem;
    color: #3498db;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.match-generation-title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.match-generation-subtitle {
    color: #bdc3c7;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.progress-bar-container {
    width: 300px;
    height: 6px;
    background-color: #34495e;
    border-radius: 3px;
    overflow: hidden;
    margin: 1rem auto;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 3px;
    width: 0%;
    animation: indeterminateProgress 2s linear infinite;
}

@keyframes indeterminateProgress {
    0% {
        width: 0%;
        margin-left: 0%;
    }
    50% {
        width: 50%;
        margin-left: 25%;
    }
    100% {
        width: 0%;
        margin-left: 100%;
    }
}

/* Button Loading States */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading .btn-text {
    opacity: 0;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Calendar Loading Animation */
.calendar-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #6c757d;
}

.calendar-loading-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}



/* Responsive Design */
@media (max-width: 768px) {
    .match-generation-content {
        margin: 1rem;
        padding: 2rem;
    }
    
    .match-generation-icon {
        font-size: 3rem;
    }
    
    .progress-bar-container {
        width: 250px;
    }
}

/* Success Animation */
.success-checkmark {
    display: inline-block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #2ecc71;
    position: relative;
    animation: scaleIn 0.5s ease-in-out;
}

.success-checkmark::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 25px;
    width: 10px;
    height: 18px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    animation: checkmark 0.5s ease-in-out 0.3s both;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes checkmark {
    0% {
        height: 0;
    }
    100% {
        height: 18px;
    }
}