/* 赛事实时更新 - 动画和样式 */

/* ==================== 比分更新动画 ==================== */
.score-updating {
    animation: scoreFlash 0.5s ease;
}

.goal-scored {
    animation: goalCelebration 3s ease;
    color: #22c55e !important;
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.8);
}

@keyframes scoreFlash {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes goalCelebration {
    0% { transform: scale(1); color: inherit; }
    10% { transform: scale(1.5); color: #22c55e; }
    20% { transform: scale(1.2); }
    30% { transform: scale(1.4); }
    40% { transform: scale(1.1); }
    100% { transform: scale(1); color: inherit; }
}

/* ==================== 分钟数脉冲动画 ==================== */
.match-minute.pulse {
    animation: minutePulse 1s ease;
}

@keyframes minutePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==================== 新事件高亮 ==================== */
.event-item.new-event {
    animation: newEventSlide 0.5s ease, newEventGlow 3s ease;
    background: rgba(34, 197, 94, 0.15) !important;
    border-left-color: #22c55e !important;
}

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

@keyframes newEventGlow {
    0% { box-shadow: 0 0 10px rgba(34, 197, 94, 0.5); }
    100% { box-shadow: none; }
}

/* ==================== 新直播项动画 ==================== */
.strip-item.new-live {
    animation: newLiveSlide 1s ease;
    background: rgba(34, 197, 94, 0.2);
}

@keyframes newLiveSlide {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==================== 刷新提示条 ==================== */
.refresh-hint-bar {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1050;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.4);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.refresh-hint-bar .hint-message {
    font-size: 0.9rem;
    font-weight: 500;
}

.refresh-hint-bar .hint-refresh-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.refresh-hint-bar .hint-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.refresh-hint-bar .hint-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.refresh-hint-bar .hint-close-btn:hover {
    color: white;
}

/* ==================== WebSocket 连接状态 ==================== */
.ws-connection-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 1040;
    animation: fadeIn 0.3s ease;
}

.ws-connection-status.warning {
    background: rgba(234, 179, 8, 0.9);
    color: #422006;
}

.ws-connection-status.danger {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

/* ==================== 比赛卡片状态变化 ==================== */
.match-card.live {
    border-left: 3px solid #ef4444;
}

.match-card.live .match-time {
    color: #ef4444;
    font-weight: 600;
}

.match-card.finished {
    opacity: 0.8;
}

.match-card.finished .match-status {
    color: #64748b;
}

/* 状态样式 */
.match-status.status-live {
    color: #ef4444;
    font-weight: 600;
}

.match-status.status-ft {
    color: #64748b;
}

/* ==================== 进球特效覆盖层 ==================== */
.goal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(34, 197, 94, 0.3) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    animation: goalOverlay 2s ease forwards;
}

@keyframes goalOverlay {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0; }
}

/* ==================== 实时数据更新指示器 ==================== */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 20px;
    font-size: 0.8rem;
    color: #ef4444;
}

.live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: livePulse 1.5s infinite;
}

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

/* ==================== 统计数据动画 ==================== */
.stat-bar-home,
.stat-bar-away {
    transition: width 0.5s ease;
}

.stat-home,
.stat-away {
    transition: color 0.3s ease;
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 768px) {
    .refresh-hint-bar {
        width: 90%;
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .refresh-hint-bar .hint-message {
        font-size: 0.8rem;
    }
    
    .refresh-hint-bar .hint-refresh-btn {
        padding: 0.3rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .ws-connection-status {
        bottom: 70px; /* 避开移动端底部导航 */
        left: 10px;
        font-size: 0.75rem;
    }
}

/* ==================== 比赛通知卡片 ==================== */
.match-notification-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 380px;
    max-width: 90vw;
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    padding: 0;
    z-index: 10000;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 0 60px rgba(59, 130, 246, 0.15);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.match-notification-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ef4444, #f97316, #eab308);
    animation: gradientMove 2s ease infinite;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.match-notification-card.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 通知头部 */
.match-notification-card .notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
}

.match-notification-card .notif-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.match-notification-card .notif-badge.live {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.match-notification-card .notif-badge.ended {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
}

.match-notification-card .notif-badge .pulse-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: livePulse 1.5s infinite;
}

.match-notification-card .notif-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.match-notification-card .notif-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 通知主体 */
.match-notification-card .notif-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.25rem;
    gap: 0.5rem;
}

.match-notification-card .notif-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    max-width: 100px;
}

.match-notification-card .notif-team img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.match-notification-card .notif-team .team-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e2e8f0;
    text-align: center;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 通知卡片比分布局 - 独立样式 */
.match-notification-card .notif-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.match-notification-card .notif-score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    min-width: 100px;
}

.match-notification-card .notif-score-home,
.match-notification-card .notif-score-away {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    min-width: 40px;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.match-notification-card .notif-score-home:not(:empty),
.match-notification-card .notif-score-away:not(:empty) {
    animation: scoreGlow 0.5s ease;
}

.match-notification-card .notif-score-sep {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
    margin: 0 0.25rem;
}

@keyframes scoreGlow {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #fbbf24; }
    100% { transform: scale(1); }
}

.match-notification-card .notif-status {
    font-size: 0.75rem;
    color: #22c55e;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.75rem;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 50px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    width: max-content;
}

.match-notification-card .notif-status.ended {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

/* 联赛信息 */
.match-notification-card .notif-league {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.match-notification-card .notif-league img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.match-notification-card .notif-league span {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* 操作按钮 */
.match-notification-card .notif-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.15);
}

.match-notification-card .notif-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.match-notification-card .notif-btn.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.match-notification-card .notif-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.match-notification-card .notif-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.match-notification-card .notif-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* 背景遮罩 */
.match-notification-card::after {
    content: '';
    position: fixed;
    top: -50vh;
    left: -50vw;
    width: 200vw;
    height: 200vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: -1;
    backdrop-filter: blur(4px);
}

/* 移动端适配 */
@media (max-width: 480px) {
    .match-notification-card {
        width: 95vw;
        border-radius: 16px;
    }
    
    .match-notification-card .notif-team img {
        width: 44px;
        height: 44px;
    }
    
    .match-notification-card .notif-team .team-name {
        font-size: 0.75rem;
    }
    
    .match-notification-card .score-display .home-score,
    .match-notification-card .score-display .away-score {
        font-size: 2rem;
    }
    
    .match-notification-card .notif-btn {
        padding: 0.65rem 0.75rem;
        font-size: 0.8rem;
    }
}
