/* Loading Animations and Skeleton Screens */

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(204, 85, 0, 0.1);
    border-left: 4px solid var(--burnt-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, #1a1a1a 25%, #2d2d2d 50%, #1a1a1a 75%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Skeleton Card */
.skeleton-card {
    background: var(--dark-gray);
    border: 1px solid rgba(204, 85, 0, 0.2);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.skeleton-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.skeleton-title {
    height: 16px;
    width: 120px;
}

.skeleton-badge {
    height: 20px;
    width: 60px;
    border-radius: 10px;
}

.skeleton-value {
    height: 48px;
    width: 100px;
    margin-bottom: 12px;
}

.skeleton-text {
    height: 14px;
    width: 150px;
}

/* Skeleton Player Card */
.skeleton-player-card {
    background: var(--dark-gray);
    border: 1px solid rgba(204, 85, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.skeleton-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
}

.skeleton-player-name {
    height: 18px;
    width: 120px;
    margin: 0 auto 8px;
}

.skeleton-player-position {
    height: 14px;
    width: 80px;
    margin: 0 auto 15px;
}

.skeleton-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 15px;
    border-top: 1px solid rgba(204, 85, 0, 0.1);
}

.skeleton-stat {
    text-align: center;
}

.skeleton-stat-value {
    height: 20px;
    width: 30px;
    margin-bottom: 8px;
}

.skeleton-stat-label {
    height: 12px;
    width: 25px;
}

/* Skeleton Game Card */
.skeleton-game-card {
    background: var(--dark-gray);
    border: 1px solid rgba(204, 85, 0, 0.2);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.skeleton-teams {
    display: flex;
    align-items: center;
    gap: 30px;
}

.skeleton-team {
    display: flex;
    align-items: center;
    gap: 12px;
}

.skeleton-team-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.skeleton-team-name {
    height: 18px;
    width: 80px;
}

.skeleton-vs {
    height: 16px;
    width: 20px;
}

.skeleton-game-info {
    text-align: right;
}

.skeleton-game-date {
    height: 14px;
    width: 120px;
    margin-bottom: 8px;
}

.skeleton-game-status {
    height: 24px;
    width: 80px;
    border-radius: 6px;
}

/* Page Loading Overlay */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.page-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-logo {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--burnt-orange);
}

.loading-text {
    color: var(--white);
    font-size: 18px;
    margin-bottom: 30px;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(204, 85, 0, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--burnt-orange), var(--light-burnt-orange));
    width: 0%;
    animation: loading-progress 2s ease-in-out infinite;
}

@keyframes loading-progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Button Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

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

/* Fade In Animation */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stagger Animation for Lists */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease-in-out forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }

/* Pulse Animation for Live Data */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Shimmer Effect */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(204, 85, 0, 0.1),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Loading States for Mobile */
@media (max-width: 768px) {
    .loading-spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }
    
    .skeleton-game-card {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .skeleton-teams {
        flex-direction: column;
        gap: 15px;
    }
    
    .loading-text {
        font-size: 16px;
    }
    
    .loading-bar {
        width: 150px;
    }
}