/**
 * Live Updates CSS - Animations and indicators for the event bus system
 * Provides visual feedback for live score updates, goals, cards, and status changes
 */

/* Live Match Indicators */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: bold;
    color: #10b981;
    animation: pulse 2s infinite;
}

.live-indicator::before {
    content: '';
    width: 6px;
    height: 6px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Match Status Styling */
.match-status { 
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    text-align: center;
    transition: all 0.3s ease;
}

.status-live {
    color: #10b981;
    background-color: rgba(16, 185, 129, 0.1);
    animation: pulse 2s infinite;
}

.status-ft {
    color: #6b7280;
    background-color: rgba(107, 114, 128, 0.1);
}

.status-ns {
    color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
}

.status-ht {
    color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.1);
}

.status-aet,
.status-pen {
    color: #8b5cf6;
    background-color: rgba(139, 92, 246, 0.1);
}

/* Score Display */
.score-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 18px;
}

.home-score,
.away-score {
    min-width: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.score-separator {
    color: #6b7280;
    font-weight: normal;
}

.penalty-scores {
    font-size: 14px;
    color: #6b7280;
    margin-left: 8px;
}

/* Live Match Container */
.live-match {
    position: relative;
    border-left: 3px solid #10b981;
    background-color: rgba(16, 185, 129, 0.05);
    transition: all 0.3s ease;
}

.live-match::before {
    content: '';
    position: absolute;
    top: 0;
    left: -3px;
    width: 3px;
    height: 100%;
    background: linear-gradient(45deg, #10b981, #059669);
    animation: pulse 2s infinite;
}

/* Update Flash Animation */
.live-update-flash {
    animation: flash 0.5s ease-in-out;
}

@keyframes flash {
    0% { background-color: transparent; }
    50% { background-color: rgba(16, 185, 129, 0.2); }
    100% { background-color: transparent; }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Goal Events */
.goals-container {
    margin-top: 8px;
}

.goal-event {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 13px;
    animation: slideIn 0.5s ease-out;
}

.goal-icon {
    font-size: 16px;
}

.goal-text {
    color: #374151;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Card Events */
.cards-container {
    margin-top: 8px;
}

.card-event {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 13px;
    animation: slideIn 0.5s ease-out;
}

.card-icon {
    font-size: 14px;
}

.card-text {
    color: #374151;
}

.card-red .card-text {
    color: #dc2626;
}

.card-yellow .card-text {
    color: #d97706;
}

/* Sidebar Widget Styling */
.sidebar-scores-widget {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.sidebar-match {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-match:last-child {
    border-bottom: none;
}

.sidebar-teams {
    flex: 1;
    font-size: 12px;
    color: #ffffff;
}

.sidebar-score {
    font-weight: bold;
    color: #ffffff;
    margin: 0 8px;
}

.sidebar-status {
    font-size: 10px;
    color: #9ca3af;
}

/* Live Scoreboard */
.live-scoreboard {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.live-scoreboard.has-live-matches {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.scoreboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.scoreboard-title {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
}

.scoreboard-match {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.scoreboard-match:last-child {
    border-bottom: none;
}

/* Goals Ticker */
.goals-ticker {
    background: linear-gradient(90deg, #059669, #10b981);
    color: white;
    padding: 8px;
    border-radius: 6px;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.ticker-content {
    display: flex;
    animation: scroll 30s linear infinite;
}

.ticker-item {
    flex-shrink: 0;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 500;
}

@keyframes scroll {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Loading States */
.live-updates-loading {
    opacity: 0.6;
    pointer-events: none;
}

.live-updates-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #10b981;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.live-updates-error {
    border: 1px solid #dc2626;
    background-color: rgba(220, 38, 38, 0.1);
}

.live-updates-error-message {
    color: #dc2626;
    font-size: 12px;
    text-align: center;
    padding: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .score-display {
        font-size: 16px;
        gap: 6px;
    }
    
    .live-scoreboard {
        padding: 12px;
    }
    
    .scoreboard-match {
        padding: 8px 0;
    }
    
    .sidebar-scores-widget {
        padding: 8px;
    }
    
    .goal-event,
    .card-event {
        font-size: 12px;
    }
}

/* Dark Theme Specific */
@media (prefers-color-scheme: dark) {
    .match-status {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .goal-text,
    .card-text {
        color: #d1d5db;
    }
    
    .score-separator {
        color: #9ca3af;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .live-indicator,
    .status-live {
        color: #00ff00;
        border: 1px solid #00ff00;
    }
    
    .live-match {
        border-left-color: #00ff00;
        border-left-width: 4px;
    }
    
    .goal-event,
    .card-event {
        border-left: 2px solid #ffff00;
        padding-left: 8px;
    }
}

/* Print Styles */
@media print {
    .live-indicator,
    .live-updates-loading,
    .goals-ticker {
        display: none;
    }
    
    .live-match {
        border-left: 2px solid #000;
        background-color: transparent;
    }
    
    .match-status {
        background-color: transparent;
        border: 1px solid #000;
    }
}