/* ── Event Hub: Phase 1 visual foundation ─────────────────────────────────── */
/* Redesign branch — safe to remove entirely to revert                         */

/* ── Hero Banner ── */
.hub-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  padding: 2.5rem 0 2rem;
}
.hub-hero-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}
.hub-hero h1 {
  font-weight: 800;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.hub-hero-badges {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.hub-hero-meta {
  color: rgba(255,255,255,.7);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.hub-hero-meta a {
  color: rgba(255,255,255,.85);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,.3);
}
.hub-hero-meta a:hover {
  color: #fff;
  text-decoration-color: rgba(255,255,255,.6);
}
.hub-hero.crown-event { border-bottom: 3px solid #ffc107; }

/* Org-tinted hero backgrounds */
.hub-hero.org-bad { background: linear-gradient(135deg, #1a1a2e 0%, #2a1f00 50%, #3d2b00 100%); }
.hub-hero.org-srs { background: linear-gradient(135deg, #1a1a2e 0%, #2e1218 50%, #3d1520 100%); }

/* ── Sub-navigation (sticky tab bar) ── */
.hub-subnav-wrap {
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  position: sticky;
  top: 0;
  z-index: 40;
}
.hub-subnav {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hub-subnav::-webkit-scrollbar { display: none; }
.hub-subnav .nav-item { flex-shrink: 0; }
.hub-subnav .nav-link {
  font-weight: 600;
  color: #495057;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 0.75rem 1.25rem;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  font-size: 0.95rem;
}
.hub-subnav .nav-link:hover { color: var(--sdh-primary); }
.hub-subnav .nav-link.active {
  color: var(--sdh-primary);
  border-bottom-color: var(--sdh-primary);
}

/* ── Tab Panes ── */
.hub-pane { display: none; }
.hub-pane.active { display: block; }

/* ── Section Headers (org-aware accent) ── */
.hub-section-header {
  font-weight: 700;
  font-size: 1.25rem;
  color: #1a1a2e;
  border-bottom: 3px solid var(--sdh-primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}
[data-org="bad"] .hub-section-header { border-bottom-color: #ffc107; }
[data-org="srs"] .hub-section-header { border-bottom-color: #dc3545; }

/* ── Quick Stats Row ── */
.hub-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}
.hub-stat {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  padding: 1.15rem 0.75rem;
  text-align: center;
}
.hub-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--sdh-primary);
  line-height: 1.2;
}
.hub-stat-value.green { color: #198754; }
.hub-stat-value.gold  { color: #e0a800; }
.hub-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  margin-top: 0.15rem;
}

/* ── Link Cards (scoring/results tab placeholders) ── */
.hub-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.hub-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  border: 2px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}
.hub-link-card:hover {
  border-color: var(--sdh-primary);
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.hub-link-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.hub-link-title { font-weight: 700; font-size: 1.05rem; }
.hub-link-desc { font-size: 0.82rem; color: #6c757d; margin-top: 0.25rem; }

/* ── Hub Info Box ── */
.hub-info-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
}

/* ── Run Selector Pills ── */
.hub-run-pills {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}
.hub-run-pills::-webkit-scrollbar { display: none; }
.hub-run-pills .nav-link {
  font-weight: 600;
  color: #495057;
  border-radius: 8px;
  padding: 0.45rem 1rem;
  white-space: nowrap;
  background: transparent;
  border: 2px solid #dee2e6;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.9rem;
}
.hub-run-pills .nav-link:hover { border-color: var(--sdh-primary); color: var(--sdh-primary); }
.hub-run-pills .nav-link.active { background: var(--sdh-primary); color: #fff; border-color: var(--sdh-primary); }
.hub-run-pills .nav-link.locked { opacity: 0.6; }
.hub-run-pills .nav-link.locked::after { content: ' \1F512'; font-size: 0.7rem; }

/* ── Inline Scoreboard Table ── */
.hub-score-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.hub-score-table th {
  background: #1a1a2e;
  color: #fff;
  padding: 0.55rem 0.75rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
}
.hub-score-table th:first-child { border-radius: 8px 0 0 0; }
.hub-score-table th:last-child { border-radius: 0 8px 0 0; }
.hub-score-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}
.hub-score-table tr:hover td { background: #f8f9ff; }
.hub-score-table .rank-cell { font-weight: 800; font-size: 1.05rem; text-align: center; width: 44px; }
.hub-score-table .score-cell {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.88rem;
  color: #495057;
}
.hub-score-table .best-cell {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-weight: 700;
  font-size: 0.95rem;
}
.hub-score-table .nj-cell { color: #dc3545; font-size: 0.78rem; font-style: italic; }
.hub-score-table .dog-name { font-weight: 600; }
.hub-score-table .handler-cell { color: #6c757d; font-size: 0.88rem; }
.hub-score-table .unscored td { color: #adb5bd; }

/* ── Score Progress Bar ── */
.hub-score-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}
.hub-score-progress .progress {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: #e9ecef;
}
.hub-score-progress .progress-bar {
  border-radius: 4px;
  transition: width 0.5s ease;
}
.hub-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #198754;
  animation: hubPulse 2s infinite;
  flex-shrink: 0;
}
@keyframes hubPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── Inline Results ── */
.hub-results-disc {
  margin-bottom: 1.5rem;
}
.hub-results-disc-header {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-left: 5px solid #198754;
  background: #f8f9fa;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 0 8px 8px 0;
  transition: background 0.15s;
}
.hub-results-disc-header:hover { background: #e9ecef; }
.hub-results-disc-header .chevron { transition: transform 0.2s; }
.hub-results-disc-header.collapsed .chevron { transform: rotate(-90deg); }
.hub-results-disc-header.pending { border-left-color: #6c757d; opacity: 0.7; }
.hub-results-group {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}
.hub-results-group-header {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #dee2e6;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hub-results-table { width: 100%; border-collapse: collapse; }
.hub-results-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  padding: 0.4rem 0.5rem;
  border-bottom: 2px solid #dee2e6;
}
.hub-results-table td { padding: 0.45rem 0.5rem; border-bottom: 1px solid #eee; }
.hub-results-table .rank-cell { font-weight: 800; text-align: center; width: 50px; }
.hub-results-table .dog-cell { font-weight: 600; }
.hub-results-table .handler-cell { color: #6c757d; }
.hub-results-table .score-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  text-align: right;
}
.hub-results-table tr.podium-1 { background: #fff8e1; }
.hub-results-table tr.podium-2 { background: #f5f5f5; }
.hub-results-table tr.podium-3 { background: #fef3e8; }

/* Floating group cards (BAD payouts) */
.hub-float-group {
  border: 1px solid #dee2e6;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.hub-float-group-header {
  padding: 0.6rem 0.85rem;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hub-float-group table { width: 100%; }
.hub-float-group td { padding: 0.4rem 0.75rem; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.hub-float-group tr.winner-row { background: #d4edda; }

/* ── Scoring toolbar ── */
.hub-scoring-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hub-hero h1 { font-size: 1.5rem; }
  .hub-hero { padding: 2rem 0 1.5rem; }
  .hub-subnav .nav-link { padding: 0.6rem 0.9rem; font-size: 0.88rem; }
  .hub-stat-row { grid-template-columns: repeat(2, 1fr); }
  .hub-stat-value { font-size: 1.4rem; }
  .hub-links-grid { grid-template-columns: 1fr; }
  .hub-score-table td, .hub-score-table th { padding: 0.4rem 0.5rem; font-size: 0.82rem; }
  .hub-score-table .rank-cell { width: 36px; font-size: 0.95rem; }
  .hub-score-table .score-cell { font-size: 0.78rem; }
}

/* ── Sun Mode overrides ── */
body.sun-mode .hub-hero { background: #0A1628; }
body.sun-mode .hub-subnav-wrap { background: #1E293B; border-bottom-color: rgba(255,255,255,.1); }
body.sun-mode .hub-subnav .nav-link { color: #94A3B8; }
body.sun-mode .hub-subnav .nav-link:hover { color: #F59E0B; }
body.sun-mode .hub-subnav .nav-link.active { color: #F59E0B; border-bottom-color: #F59E0B; }
body.sun-mode .hub-stat { background: #1E293B; color: #F1F5F9; }
body.sun-mode .hub-stat-value { color: #F59E0B; }
body.sun-mode .hub-stat-label { color: #94A3B8; }
body.sun-mode .hub-link-card { background: #1E293B; color: #F1F5F9; border-color: rgba(255,255,255,.1); }
body.sun-mode .hub-link-card:hover { border-color: #F59E0B; }
body.sun-mode .hub-section-header { color: #F1F5F9; }
body.sun-mode .hub-info-box { background: #1E293B; color: #F1F5F9; }
body.sun-mode .hub-score-table th { background: #0A1628; }
body.sun-mode .hub-score-table td { border-bottom-color: rgba(255,255,255,.1); color: #F1F5F9; }
body.sun-mode .hub-score-table tr:hover td { background: #162035; }
body.sun-mode .hub-score-table .score-cell { color: #94A3B8; }
body.sun-mode .hub-score-table .best-cell { color: #F59E0B; }
body.sun-mode .hub-score-table .handler-cell { color: #94A3B8; }
body.sun-mode .hub-run-pills .nav-link { color: #94A3B8; border-color: rgba(255,255,255,.15); }
body.sun-mode .hub-run-pills .nav-link.active { background: #F59E0B; color: #0A1628; border-color: #F59E0B; }
body.sun-mode .hub-results-disc-header { background: #162035; color: #F1F5F9; }
body.sun-mode .hub-results-disc-header:hover { background: #1E293B; }
body.sun-mode .hub-results-group { background: #1E293B; border-color: rgba(255,255,255,.1); }
body.sun-mode .hub-results-table td { border-bottom-color: rgba(255,255,255,.1); color: #F1F5F9; }
body.sun-mode .hub-results-table .handler-cell { color: #94A3B8; }
body.sun-mode .hub-results-table .score-cell { color: #F59E0B; }
body.sun-mode .hub-float-group { border-color: rgba(255,255,255,.1); }
body.sun-mode .hub-float-group td { border-bottom-color: rgba(255,255,255,.1); color: #F1F5F9; }
