/**
 * WebSocket Live Score Animations
 * ================================
 * CSS animations for real-time score updates
 *
 * File: static/css/websocket_animations.css
 */

/* ==========================================
   WEBSOCKET STATUS INDICATOR
   ========================================== */

#ws-status-indicator {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 9999;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.ws-status-connecting {
    background: #fbbf24;
    color: #78350f;
}

.ws-status-connected {
    background: #34d399;
    color: #065f46;
}

.ws-status-disconnected {
    background: #f87171;
    color: #7f1d1d;
}

.ws-status-error {
    background: #f59e0b;
    color: #78350f;
}

.ws-status-failed {
    background: #dc2626;
    color: #ffffff;
}

/* ==========================================
   LIVE MATCH INDICATORS
   ========================================== */

.live-match {
    position: relative;
    border-left: 3px solid #ef4444 !important;
}

.live-match::before {
    content: "🔴";
    position: absolute;
    top: 10px;
    left: -12px;
    font-size: 10px;
    animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* ==========================================
   SCORE CHANGE ANIMATIONS
   ========================================== */

.score-flash {
    animation: flash-score 1s ease;
}

@keyframes flash-score {
    0%, 100% {
        background-color: transparent;
        transform: scale(1);
    }
    25%, 75% {
        background-color: #34d399;
        color: #ffffff;
        transform: scale(1.1);
    }
    50% {
        background-color: #10b981;
        color: #ffffff;
        transform: scale(1.15);
    }
}

/* ==========================================
   GOAL CELEBRATION ANIMATION
   ========================================== */

.goal-celebration {
    animation: celebrate-goal 2s ease;
}

@keyframes celebrate-goal {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(52, 211, 153, 0);
    }
    10% {
        transform: scale(1.03);
    }
    20% {
        transform: scale(0.97);
    }
    30% {
        transform: scale(1.02);
    }
    40% {
        transform: scale(0.98);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 0 40px rgba(52, 211, 153, 0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(52, 211, 153, 0);
    }
}

/* ==========================================
   LIVE PULSE EFFECT
   ========================================== */

.live-pulse {
    animation: pulse-match 3s ease-in-out infinite;
}

@keyframes pulse-match {
    0%, 100% {
        box-shadow: 0 0 0 rgba(239, 68, 68, 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    }
}

/* ==========================================
   CARDS INDICATORS
   ========================================== */

.yellow-card {
    background: #fbbf24;
    color: #78350f;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 4px;
}

.red-card {
    background: #ef4444;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
}

/* ==========================================
   UPDATE SHIMMER EFFECT
   ========================================== */

.ws-updating {
    position: relative;
    overflow: hidden;
}

.ws-updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

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

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */

@media (max-width: 768px) {
    #ws-status-indicator {
        top: 60px;
        right: 10px;
        font-size: 11px;
        padding: 6px 12px;
    }
}
