/* ========================
   CSS Variables
   ======================== */
.eval-manage {
  --accent-cyan: #00d4ff;
  --accent-cyan-dim: rgba(0, 212, 255, 0.15);
  --accent-cyan-glow: rgba(0, 212, 255, 0.4);
  --bg-elevated: #0f1117;
  --bg-card: #161920;
  --bg-hover: #1c2029;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 212, 255, 0.3);
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  padding: 28px 32px;
}

/* ========================
   Header
   ======================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}

.header-left {
  position: relative;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 6px 0 0;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.create-btn {
  background: var(--accent-cyan) !important;
  border: none !important;
  color: #030407 !important;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  box-shadow: 0 0 20px var(--accent-cyan-dim);
  transition: all 0.2s ease;
}

.create-btn:hover {
  box-shadow: 0 0 35px var(--accent-cyan-glow);
  transform: translateY(-1px);
}

/* ========================
   Stats Grid
   ======================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s ease;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
  cursor: pointer;
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px var(--accent-cyan-dim);
}

.stat-card.active::before {
  opacity: 1;
}

.stat-card.active .stat-glow {
  opacity: 0.5;
}

.stat-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.stat-card:hover .stat-glow {
  opacity: 0.5;
}

/* Stat variations */
.stat-total {
  --stat-color: #818cf8;
}

.stat-total::before {
  background: linear-gradient(90deg, #6366f1, #818cf8);
}

.stat-total .stat-glow {
  background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.3), transparent 50%);
}

.stat-completed {
  --stat-color: var(--success);
}

.stat-completed::before {
  background: linear-gradient(90deg, #16a34a, var(--success));
}

.stat-completed .stat-glow {
  background: radial-gradient(circle at 30% 30%, rgba(34, 197, 94, 0.3), transparent 50%);
}

.stat-processing {
  --stat-color: var(--warning);
}

.stat-processing::before {
  background: linear-gradient(90deg, #d97706, var(--warning));
}

.stat-processing .stat-glow {
  background: radial-gradient(circle at 30% 30%, rgba(245, 158, 11, 0.3), transparent 50%);
}

.stat-failed {
  --stat-color: var(--danger);
}

.stat-failed::before {
  background: linear-gradient(90deg, #dc2626, var(--danger));
}

.stat-failed .stat-glow {
  background: radial-gradient(circle at 30% 30%, rgba(239, 68, 68, 0.3), transparent 50%);
}

.stat-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  z-index: 1;
}

.stat-icon-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  color: var(--stat-color);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  line-height: 1.1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========================
   Tabs
   ======================== */
.eval-tabs {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.eval-container,
.blind-test-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
}

/* ========================
   Empty State
   ======================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  min-height: 450px;
}

.empty-illustration {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 28px;
}

.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(0, 212, 255, 0.2);
}

.orbit-1 {
  inset: 10px;
  animation: orbit-rotate 20s linear infinite;
}

.orbit-2 {
  inset: 30px;
  border-color: rgba(0, 212, 255, 0.15);
  animation: orbit-rotate 15s linear infinite reverse;
}

.orbit-3 {
  inset: 50px;
  border-color: rgba(0, 212, 255, 0.1);
  animation: orbit-rotate 10s linear infinite;
}

@keyframes orbit-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.empty-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--accent-cyan);
  box-shadow: 0 0 40px var(--accent-cyan-dim);
}

.empty-title {
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 8px;
}

.empty-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 20px;
  text-align: center;
}

.empty-btn {
  background: var(--accent-cyan) !important;
  border: none !important;
  color: #030407 !important;
  font-weight: 600;
}

/* ========================
   Eval Table
   ======================== */
.eval-table-wrapper {
  display: flex;
  flex-direction: column;
  min-width: 800px;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.table-select .select-all {
  --el-checkbox-text-color: var(--text-secondary);
}

.selected-text {
  color: var(--accent-cyan);
  font-weight: 500;
}

.batch-delete-btn {
  background: transparent !important;
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}

.batch-delete-btn:hover {
  background: var(--danger) !important;
  color: white !important;
}

.batch-clear-btn {
  background: transparent !important;
  border-color: var(--text-muted) !important;
  color: var(--text-secondary) !important;
}

.batch-clear-btn:hover {
  background: var(--bg-hover) !important;
  border-color: var(--text-secondary) !important;
  color: #ffffff !important;
}

.eval-table {
  display: flex;
  flex-direction: column;
}

.eval-row {
  display: grid;
  grid-template-columns: 40px 50px 1fr 80px 80px 100px 90px;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
  cursor: pointer;
}

.eval-row.row-animated {
  animation: row-in 0.3s ease backwards;
  animation-delay: var(--delay);
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
}

.eval-row:hover {
  background: var(--bg-hover);
}

.eval-row.is-selected {
  background: rgba(0, 212, 255, 0.05);
}

/* Column styles */
.col-select {
  display: flex;
  justify-content: center;
}

.col-icon {
  display: flex;
  justify-content: center;
}

.eval-type-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--type-color) 15%, transparent);
  border-radius: var(--radius-sm);
  color: var(--type-color);
}

.col-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.eval-name-text {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-count {
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'SF Mono', monospace;
}

.col-date {
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'SF Mono', monospace;
}

/* Status Pill */
.col-status {
  min-width: 80px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-running {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.status-running .status-dot {
  background: var(--warning);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-completed {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.status-completed .status-dot {
  background: var(--success);
}

.status-failed {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.status-failed .status-dot {
  background: var(--danger);
}

.status-pending {
  background: rgba(107, 114, 128, 0.1);
  color: var(--text-muted);
}

.status-pending .status-dot {
  background: var(--text-muted);
}

/* Actions */
.col-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  min-width: 90px;
}

.action-btn {
  color: var(--text-muted) !important;
  transition: all 0.15s ease;
}

.action-btn:hover {
  color: var(--accent-cyan) !important;
  background: var(--accent-cyan-dim) !important;
}

.action-btn.run:hover {
  color: var(--success) !important;
  background: rgba(34, 197, 94, 0.1) !important;
}

.action-btn.delete:hover {
  color: var(--danger) !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

/* ========================
   Blind Test Tasks Grid
   ======================== */
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.task-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-base);
  animation: cardIn 0.4s ease backwards;
  animation-delay: var(--delay);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(15px); }
}

.task-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-3px);
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.task-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.task-icon.running {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
  animation: pulse 2s infinite;
}

.task-icon.completed {
  background: var(--success-muted);
  color: var(--success);
}

.task-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.task-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 12px 0;
}

.task-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ========================
   Dialog
   ======================== */
.eval-dialog,
.blind-dialog {
  --el-dialog-bg-color: var(--bg-elevated);
  --el-dialog-border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.model-check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ========================
   Responsive
   ======================== */
@media (max-width: 900px) {
  .eval-manage {
    padding: 20px;
  }

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

  .page-header {
    flex-direction: column;
    gap: 16px;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .el-button {
    flex: 1;
  }

  .eval-row {
    grid-template-columns: 40px 40px 1fr 60px;
    gap: 8px;
  }

  .col-date,
  .col-status {
    display: none;
  }

  .col-actions {
    min-width: 50px;
  }
}
