/* Live Scores Additional CSS Styles */

/* Live Scores Widget Container */
.aifp-live-scores-widget {
    background: linear-gradient(135deg, #FF5722 0%, #FF7043 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.aifp-live-scores-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="20" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="20" cy="90" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    pointer-events: none;
}

/* Controls Section */
.live-scores-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 10px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.refresh-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.refresh-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.refresh-icon {
    transition: transform 0.6s ease;
}

.refresh-icon.spinning {
    animation: spin 1s linear infinite;
}

.last-update {
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.9);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.connection-status.connected .status-dot {
    background: #4CAF50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.connection-status.connecting .status-dot {
    background: #FF9800;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

.connection-status.error .status-dot {
    background: #f44336;
    animation: blink 1s ease-in-out infinite;
}

/* Live Scores Container */
.live-scores-container {
    position: relative;
    z-index: 1;
}

.live-scores-header {
    text-align: center;
    margin-bottom: 20px;
}

.live-scores-header h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 5px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.live-update-time {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    background: rgba(255,255,255,0.1);
    padding: 5px 12px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

/* Live Matches Grid */
.live-matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Live Match Cards */
.live-match-card {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.live-match-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.live-match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4CAF50, #FF5722);
    animation: liveUpdate 2s ease-in-out infinite alternate;
}

/* Match Header */
.live-match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.match-league {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
}

.match-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-live {
    background: #4CAF50;
    color: white;
    animation: pulse 2s infinite;
}

.status-halftime {
    background: #FF9800;
    color: white;
}

.status-finished {
    background: #666;
    color: white;
}

.status-other {
    background: #f0f0f0;
    color: #666;
}

/* Live Match Teams */
.live-match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.live-team {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
}

.live-team.away {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.team-logo-small {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.live-team .team-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.team-score {
    font-size: 1.8rem;
    font-weight: 700;
    color: #FF5722;
    min-width: 30px;
    text-align: center;
}

.live-vs {
    text-align: center;
    font-weight: 700;
    color: #666;
    font-size: 0.9rem;
    padding: 0 10px;
}

/* Live Events */
.live-events {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}

.live-events h5 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.event-time {
    background: #FF5722;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    min-width: 35px;
    text-align: center;
}

.event-icon {
    font-size: 1rem;
}

.event-player {
    color: #555;
    flex: 1;
}

/* No Live Matches */
.no-live-matches {
    text-align: center;
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 40px 20px;
    color: #666;
}

.no-live-matches h4 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: #333;
}

/* Live Score Section in Prediction Cards */
.live-score-section {
    background: linear-gradient(135deg, #FF5722, #FF7043);
    color: white;
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    animation: liveUpdate 2s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
}

.live-score-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: translate(25%, -25%);
}

.live-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.live-indicator {
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
    backdrop-filter: blur(5px);
    animation: blink 1s infinite;
}

.live-time {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 600;
}

.live-score-display {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 15px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.score-events {
    display: flex;
    justify-content: center;
    font-size: 0.8rem;
    margin-top: 10px;
    opacity: 0.9;
}

/* Error Messages */
.live-scores-error {
    background: rgba(255,255,255,0.95);
    border: 1px solid #f44336;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.error-icon {
    font-size: 1.2rem;
}

.error-message {
    flex: 1;
    color: #333;
    font-size: 0.9rem;
}

.retry-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s ease;
}

.retry-btn:hover {
    background: #d32f2f;
}

/* Pull to Refresh Animation */
.aifp-live-scores-widget.pull-refresh {
    animation: pullRefresh 0.3s ease-out;
}

/* Status Classes for Meta */
.status-live {
    color: #FF5722 !important;
    font-weight: 700;
    animation: pulse 1.5s infinite;
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes liveUpdate {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.7);
    }
    100% {
        box-shadow: 0 0 0 8px rgba(255, 87, 34, 0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

@keyframes pullRefresh {
    0% { transform: translateY(-10px); }
    50% { transform: translateY(5px); }
    100% { transform: translateY(0); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .aifp-live-scores-widget {
        margin: 10px;
        padding: 15px;
        border-radius: 12px;
    }
    
    .live-scores-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .refresh-btn {
        justify-content: center;
    }
    
    .live-matches-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .live-match-card {
        padding: 15px;
    }
    
    .live-match-teams {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }
    
    .live-team {
        justify-content: center;
    }
    
    .live-team.away {
        justify-content: center;
        flex-direction: row;
    }
    
    .live-vs {
        order: -1;
        padding: 10px 0;
    }
    
    .team-score {
        font-size: 1.5rem;
    }
    
    .live-score-display {
        font-size: 1.6rem;
    }
    
    .live-events {
        padding: 12px;
    }
    
    .events-list {
        gap: 6px;
    }
    
    .event-item {
        font-size: 0.8rem;
    }
    
    .live-scores-error {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .live-scores-header h3 {
        font-size: 1.3rem;
    }
    
    .live-update-time {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
    
    .live-match-card {
        padding: 12px;
        border-radius: 12px;
    }
    
    .match-league {
        font-size: 0.8rem;
    }
    
    .match-status {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    
    .live-team .team-name {
        font-size: 0.9rem;
    }
    
    .team-score {
        font-size: 1.3rem;
    }
    
    .live-score-section {
        padding: 12px;
    }
    
    .live-score-display {
        font-size: 1.4rem;
    }
    
    .live-indicator {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    
    .live-time {
        font-size: 0.8rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .live-match-card {
        background: rgba(255,255,255,0.95);
        color: #333;
    }
    
    .live-events {
        background: rgba(248,249,250,0.95);
    }
    
    .live-scores-error {
        background: rgba(255,255,255,0.95);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .live-match-card {
        border: 2px solid #333;
    }
    
    .live-score-section {
        border: 2px solid #FF5722;
    }
    
    .refresh-btn {
        border: 1px solid rgba(255,255,255,0.5);
    }
}