/**
 * 实时评测进度 - 北欧风格设计
 * 基于nordic-style.css变量
 * 设计理念：简约、清晰、实时反馈
 */

/* ========================================
   评测进度容器
   ======================================== */
.judging-realtime-container {
    background: var(--nordic-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-2xl);
    margin: var(--spacing-xl) 0;
    animation: slideInUp 0.4s ease-out;
}

/* ========================================
   评测状态头部
   ======================================== */
.judging-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--nordic-yellow);
}

.judging-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--nordic-charcoal);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.judging-status-badge {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

.status-pending {
    background: linear-gradient(135deg, #94A3B8 0%, #64748B 100%);
    color: white;
}

.status-judging {
    background: linear-gradient(135deg, var(--nordic-yellow) 0%, #FFB700 100%);
    color: var(--nordic-charcoal);
}

.status-accepted {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

.status-failed {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
}

/* ========================================
   整体进度条区域
   ======================================== */
.progress-section {
    margin: var(--spacing-xl) 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.progress-label {
    font-size: var(--text-base);
    color: var(--nordic-charcoal);
    font-weight: 500;
}

.progress-count {
    font-size: var(--text-lg);
    color: var(--nordic-dark-gray);
    font-weight: 600;
}

.progress-count .current {
    color: var(--nordic-blue);
    font-size: var(--text-xl);
}

/* 进度条轨道 */
.progress-track {
    height: 32px;
    background: linear-gradient(to right, #E2E8F0 0%, #F1F5F9 100%);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* 进度条填充 */
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg,
        var(--nordic-blue) 0%,
        #0052A3 50%,
        var(--nordic-blue) 100%
    );
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--spacing-md);
    box-shadow: 0 2px 8px rgba(0, 61, 117, 0.3);
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

.progress-text {
    font-size: var(--text-sm);
    font-weight: 700;
    color: white;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ========================================
   测试点网格
   ======================================== */
.testcases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

/* 测试点卡片 */
.testcase-card {
    background: white;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.testcase-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--nordic-gray);
    transition: background 0.3s ease;
}

.testcase-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* 测试点状态 */
.testcase-card.pending::before {
    background: #94A3B8;
}

.testcase-card.running {
    border-color: var(--nordic-yellow);
    animation: cardPulse 1.5s ease-in-out infinite;
}

.testcase-card.running::before {
    background: var(--nordic-yellow);
    animation: progressBar 1.5s ease-in-out infinite;
}

.testcase-card.accepted {
    border-color: #10B981;
}

.testcase-card.accepted::before {
    background: #10B981;
}

.testcase-card.failed {
    border-color: #EF4444;
}

.testcase-card.failed::before {
    background: #EF4444;
}

/* 测试点头部 */
.testcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.testcase-number {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--nordic-charcoal);
}

.testcase-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--text-sm);
    font-weight: 600;
}

.status-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 测试点详情 */
.testcase-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-label {
    font-size: var(--text-xs);
    color: var(--nordic-dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--nordic-charcoal);
}

.detail-value.highlight {
    color: var(--nordic-blue);
}

/* ========================================
   评测统计总结
   ======================================== */
.judging-summary {
    margin-top: var(--spacing-2xl);
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, #F0F4F8 0%, white 100%);
    border-radius: var(--radius-lg);
    border: 2px solid var(--nordic-yellow);
}

.summary-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--nordic-charcoal);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-lg);
}

.summary-stat {
    text-align: center;
    padding: var(--spacing-md);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--nordic-blue);
    display: block;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--nordic-dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   操作按钮
   ======================================== */
.judging-actions {
    margin-top: var(--spacing-xl);
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

.btn-nordic {
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
}

.btn-primary {
    background: var(--nordic-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 61, 117, 0.3);
}

.btn-primary:hover {
    background: #0052A3;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 61, 117, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--nordic-charcoal);
    border: 2px solid var(--nordic-gray);
}

.btn-secondary:hover {
    border-color: var(--nordic-blue);
    color: var(--nordic-blue);
    transform: translateY(-2px);
}

/* ========================================
   动画
   ======================================== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes cardPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 204, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 204, 0, 0);
    }
}

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

/* 旋转动画（加载中） */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    .judging-realtime-container {
        padding: var(--spacing-lg);
    }

    .testcases-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .judging-actions {
        flex-direction: column;
    }

    .btn-nordic {
        width: 100%;
        justify-content: center;
    }
}
