/* PureDFC Sport API Dashboard - Modern Dark Theme */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1E40AF;
  --primary-hover: #1D4ED8;
  --secondary: #10B981;
  --accent: #F59E0B;
  --bg: #0F172A;
  --surface: #1E293B;
  --surface-2: #273548;
  --border: #334155;
  --text: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --danger: #EF4444;
  --success: #22C55E;
  --warning: #F59E0B;
  --live: #EF4444;
  --sidebar-w: 240px;
  --header-h: 60px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html { font-size: 14px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: rgba(30, 64, 175, 0.15);
  color: #60A5FA;
}

.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.health-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s;
}

.health-dot.healthy { background: var(--success); box-shadow: 0 0 6px var(--success); }
.health-dot.unhealthy { background: var(--danger); box-shadow: 0 0 6px var(--danger); }

/* Main Content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left { display: flex; align-items: center; gap: 12px; }

.top-header h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.header-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sync-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.sync-label { color: var(--text-muted); }
.sync-value { color: var(--text-secondary); font-family: var(--mono); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-refresh {
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-refresh:hover { background: var(--border); color: var(--text); }

/* Content Area */
.content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: #4B5563; }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.live-icon { background: rgba(239, 68, 68, 0.12); color: var(--live); }
.today-icon { background: rgba(59, 130, 246, 0.12); color: #3B82F6; }
.total-icon { background: rgba(16, 185, 129, 0.12); color: var(--secondary); }
.error-icon { background: rgba(245, 158, 11, 0.12); color: var(--warning); }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  font-family: var(--font);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .content-grid { grid-template-columns: 1fr; }
}

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.panel-body { padding: 0; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-secondary);
}

.badge-live {
  background: rgba(239, 68, 68, 0.15);
  color: var(--live);
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 12px;
  color: var(--text-muted);
}

.empty-state p { font-size: 13px; }

/* Match Cards */
.match-card {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.match-card:last-child { border-bottom: none; }
.match-card:hover { background: rgba(255,255,255,0.02); }

.match-card.live {
  background: rgba(239, 68, 68, 0.03);
}

.match-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  min-width: 48px;
  text-align: center;
}

.match-time.live-time {
  color: var(--live);
  font-weight: 600;
}

.match-teams {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

.match-team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.match-team img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.match-team-score {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  min-width: 24px;
  text-align: right;
}

.match-status {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  min-width: 60px;
}

.match-status.live-status {
  color: var(--live);
  font-weight: 600;
}

/* Page Controls */
.page-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.select-control, .input-control {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.15s;
}

.select-control:focus, .input-control:focus {
  border-color: var(--primary);
}

.input-control::placeholder { color: var(--text-muted); }

/* Standings Table */
.standings-container { overflow-x: auto; }

.standings-table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.standings-table thead {
  background: var(--surface-2);
}

.standings-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.th-pos { width: 40px; text-align: center !important; }
.th-team { min-width: 180px; }
.th-num { width: 40px; text-align: center !important; }
.th-points { color: var(--primary) !important; }
.th-form { width: 120px; text-align: center !important; }

.standings-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.standings-table tbody tr {
  transition: background 0.1s;
}

.standings-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.standings-table tbody tr:last-child td { border-bottom: none; }

.pos-cell {
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}

.pos-cell.top-4 { color: #3B82F6; }
.pos-cell.relegation { color: var(--danger); }

.team-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.team-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.team-name { font-weight: 500; }

.num-cell {
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.points-cell {
  text-align: center;
  font-weight: 800;
  color: var(--text);
  font-size: 13px;
}

.form-cell {
  display: flex;
  gap: 3px;
  justify-content: center;
}

.form-badge {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-W { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.form-D { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.form-L { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* Sync Actions */
.sync-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.sync-action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all 0.15s;
}

.sync-action-card:hover {
  border-color: var(--primary);
  background: rgba(30, 64, 175, 0.05);
}

.sync-action-card:active { transform: scale(0.98); }

.sac-icon {
  width: 40px;
  height: 40px;
  background: rgba(30, 64, 175, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60A5FA;
  margin-bottom: 10px;
}

.sac-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.sac-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }

.sync-stats-grid {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mini-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ms-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.ms-value { font-size: 18px; font-weight: 700; color: var(--text); }

/* Jobs List */
.jobs-list { display: flex; flex-direction: column; }

.job-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.job-item:last-child { border-bottom: none; }

.job-type {
  font-weight: 600;
  color: var(--text);
  min-width: 120px;
  font-family: var(--mono);
}

.job-status {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.job-status.pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.job-status.running { background: rgba(59,130,246,0.15); color: #3B82F6; }
.job-status.done { background: rgba(34,197,94,0.15); color: var(--success); }
.job-status.failed { background: rgba(239,68,68,0.15); color: var(--danger); }

.job-time { color: var(--text-muted); margin-left: auto; font-family: var(--mono); }
.job-error { color: var(--danger); font-size: 11px; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-overlay.active { display: flex; }

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 15px; font-weight: 700; }

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: var(--border); color: var(--text); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* Match Detail in Modal */
.match-detail-score {
  text-align: center;
  padding: 20px;
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.match-detail-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.mds-team { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mds-logo { width: 48px; height: 48px; object-fit: contain; }
.mds-name { font-weight: 600; font-size: 14px; }
.mds-score { font-size: 36px; font-weight: 800; font-family: var(--font); }

.mds-vs {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.mds-info {
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.mds-clock {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--live);
  font-weight: 700;
}

/* Stats Comparison */
.stats-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  margin-bottom: 20px;
}

.stats-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 50px 1fr;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.stats-row:last-child { border-bottom: none; }

.stat-home {
  text-align: right;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding-right: 12px;
}

.stat-label {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-away {
  text-align: left;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding-left: 12px;
}

/* Events Timeline */
.events-timeline { display: flex; flex-direction: column; gap: 6px; }

.event-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.event-minute {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text-muted);
  min-width: 32px;
  font-size: 11px;
}

.event-type-badge {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.event-type-badge.goal { background: rgba(34,197,94,0.2); color: var(--success); }
.event-type-badge.yellow_card { background: rgba(245,158,11,0.2); color: var(--warning); }
.event-type-badge.red_card { background: rgba(239,68,68,0.2); color: var(--danger); }
.event-type-badge.substitution_on { background: rgba(59,130,246,0.2); color: #3B82F6; }
.event-type-badge.substitution_off { background: rgba(100,116,139,0.2); color: var(--text-muted); }

.event-text { flex: 1; font-weight: 500; }
.event-team { font-size: 11px; color: var(--text-muted); }

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
  min-width: 280px;
}

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

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.info { border-color: #3B82F6; }

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast.success .toast-dot { background: var(--success); }
.toast.error .toast-dot { background: var(--danger); }
.toast.info .toast-dot { background: #3B82F6; }

/* Loading Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--text); }
.pagination button.active { background: var(--primary); border-color: var(--primary); color: white; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Responsive */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .content-grid { grid-template-columns: 1fr; }
}

/* ========== CRAWL SEASON PAGE ========== */
.crawl-hero {
  text-align: center;
  padding: 48px 24px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.crawl-hero-icon {
  width: 72px;
  height: 72px;
  background: rgba(30, 64, 175, 0.1);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: #60A5FA;
}

.crawl-hero-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 10px;
}

.crawl-hero-desc {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

.crawl-options {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.crawl-option-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.crawl-option-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 80px;
  padding-top: 6px;
}

.crawl-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.crawl-mode-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.crawl-mode-radio:hover {
  border-color: var(--primary);
  color: var(--text);
}

.crawl-mode-radio input:checked + span {
  color: #60A5FA;
}

.crawl-mode-radio input[type="radio"] {
  accent-color: var(--primary);
  cursor: pointer;
}

.crawl-option-hint {
  font-size: 11px;
  color: var(--text-muted);
  width: 100%;
  margin-left: 92px;
  margin-top: -8px;
}

.crawl-action-area {
  text-align: center;
  margin-bottom: 24px;
}

.btn-crawl-main {
  background: linear-gradient(135deg, #1E40AF, #7C3AED);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 16px 40px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(30, 64, 175, 0.4);
}

.btn-crawl-main:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(30, 64, 175, 0.5);
}

.btn-crawl-main:active {
  transform: translateY(0);
}

.btn-crawl-main:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-crawl-stop {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  margin-left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-crawl-stop:hover { background: rgba(239, 68, 68, 0.2); }

/* Progress */
#crawlProgressSection {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.crawl-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

#crawlStatusLabel {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.crawl-pct {
  font-size: 13px;
  font-weight: 700;
  color: #60A5FA;
  font-family: var(--mono);
}

.crawl-progress-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.crawl-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1E40AF, #7C3AED);
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

.crawl-progress-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cps-item {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cps-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.cps-value { font-size: 18px; font-weight: 800; color: var(--text); font-family: var(--mono); }
.cps-item.success .cps-value { color: var(--success); }
.cps-item.error .cps-value { color: var(--danger); }

/* Crawl Log */
.crawl-log {
  background: #0D1117;
  border: 1px solid #21262D;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.crawl-log-header {
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #8B949E;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #161B22;
  border-bottom: 1px solid #21262D;
  font-family: var(--mono);
}

.crawl-log-entries {
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 0;
  font-family: var(--mono);
  font-size: 12px;
}

.crawl-log-entry {
  padding: 2px 14px;
  color: #C9D1D9;
  line-height: 1.6;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.crawl-log-entry:last-child { border-bottom: none; }
.crawl-log-entry.success { color: #3FB950; }
.crawl-log-entry.error { color: #F85149; }
.crawl-log-entry.info { color: #58A6FF; }
.crawl-log-entry.progress { color: #D29922; }

/* Crawl Result */
#crawlResultSection { margin-top: 16px; }

.crawl-result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.crawl-result-card.success {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.05);
}

.crawl-result-card.error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.05);
}

.crawl-result-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.crawl-result-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.crawl-result-card.success .crawl-result-title { color: var(--success); }
.crawl-result-card.error .crawl-result-title { color: var(--danger); }

.crawl-result-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.crawl-result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.crawl-result-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  font-family: var(--mono);
}

.crawl-result-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

/* ========== MATCH DETAIL MODAL (XL) ========== */
.modal-xl {
  max-width: 900px;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0 16px;
}

.modal-tab {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
  white-space: nowrap;
}

.modal-tab:hover { color: var(--text); }

.modal-tab.active {
  color: #60A5FA;
  border-bottom-color: #60A5FA;
}

.modal-tabs-body {
  padding: 0;
  overflow: hidden;
}

.tab-panel {
  display: none;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

.tab-panel.active { display: block; }

/* Match Modal Header */
.match-modal-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, #1a2744, #0f172a);
  border-bottom: 1px solid var(--border);
}

.match-modal-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.mmt-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mmt-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  padding: 6px;
}

.mmt-name {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.mmt-score-area {
  text-align: center;
}

.mmt-score {
  font-size: 42px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -1px;
}

.mmt-score-sep {
  font-size: 24px;
  color: var(--text-muted);
  margin: 0 6px;
  font-weight: 400;
}

.mmt-clock {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--live);
  font-weight: 700;
  margin-top: 6px;
  animation: pulse-badge 2s infinite;
}

.mmt-meta {
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Stats Tab */
.stats-tab-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
}

.stats-tab-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-tab-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
}

.stat-bar-home {
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.stat-bar-away {
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.stat-value-right {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-left: auto;
}

.stat-value-left {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.stat-name-center {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
  min-width: 80px;
}

/* Lineups Tab */
.lineup-team-section {
  margin-bottom: 24px;
}

.lineup-team-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.lineup-team-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.lineup-team-name {
  font-size: 14px;
  font-weight: 700;
}

.lineup-formation {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: #60A5FA;
  background: rgba(96, 165, 250, 0.1);
  padding: 3px 10px;
  border-radius: 10px;
}

.lineup-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-top: 12px;
}

.lineup-players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}

.lineup-player-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.lineup-player-num {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 13px;
  color: var(--text-muted);
  min-width: 20px;
}

.lineup-player-name {
  font-weight: 500;
  flex: 1;
}

.lineup-player-captain {
  font-size: 10px;
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}

/* Commentary Tab */
.commentary-timeline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 500px;
  overflow-y: auto;
}

.commentary-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: background 0.1s;
}

.commentary-entry:hover { background: var(--surface-2); }

.commentary-minute {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 40px;
  padding-top: 1px;
}

.commentary-badge {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-goal { background: rgba(34,197,94,0.2); color: var(--success); }
.badge-yellow_card { background: rgba(245,158,11,0.2); color: var(--warning); }
.badge-red_card { background: rgba(239,68,68,0.2); color: var(--danger); }
.badge-substitution_on { background: rgba(59,130,246,0.2); color: #3B82F6; }
.badge-substitution_off { background: rgba(100,116,139,0.2); color: var(--text-muted); }
.badge-attempt_missed { background: rgba(148,163,184,0.2); color: var(--text-secondary); }
.badge-corner, .badge-free_kick_won, .badge-offside { background: rgba(96,165,250,0.1); color: #60A5FA; }
.badge-match_start, .badge-half_time, .badge-full_time, .badge-added_time { background: rgba(139,148,158,0.1); color: var(--text-muted); font-style: italic; }
.badge-default { background: var(--surface-2); color: var(--text-secondary); }

.commentary-text {
  flex: 1;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
}

/* Events Tab (Timeline) */
.events-full-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.event-timeline-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}

.event-timeline-entry::before {
  content: '';
  position: absolute;
  left: 70px;
  top: 28px;
  bottom: -8px;
  width: 2px;
  background: var(--border);
}

.event-timeline-entry:last-child::before { display: none; }

.et-min {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 48px;
  text-align: right;
  padding-top: 3px;
}

.et-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  z-index: 1;
}

.et-content {
  flex: 1;
  font-size: 12px;
}

.et-type {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  margin-bottom: 2px;
}

.et-desc { font-weight: 500; color: var(--text); }
.et-team { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Match Info (Overview Tab) */
.match-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.match-info-card {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.mic-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.mic-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Spin animation for loading */
@keyframes spin {
  to { transform: rotate(360deg); }
}
