/* =============================================================
   scorecard_components.css — shared visual components
   Cards, badges, status pills, section labels, live indicators,
   empty states, common button patterns.
   Depends on scorecard.css for tokens.
   ============================================================= */

/* ── PULSE ANIMATION (live dot, status pulse) ─────────────── */
@keyframes sc-pulse {
  0%,100% { opacity: 1;    transform: scale(1); }
  50%     { opacity: 0.55; transform: scale(0.8); }
}

/* ── LIVE BADGE ───────────────────────────────────────────── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25);
}
.live-badge.square {
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.10em;
  padding: 2px 7px;
  border-color: rgba(34,197,94,0.30);
}
.live-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: sc-pulse 2s ease-in-out infinite;
}
.live-dot.lg { width: 6px; height: 6px; }
.live-dot.static {
  /* Used in scorecard_matches header — same colored dot, no animation */
  width: 9px; height: 9px;
  background: var(--green);
  animation: none;
}

/* ── STATUS PILL (live / finished / generic) ──────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  flex-shrink: 0;
}
.status-pill.live {
  color: var(--green);
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.30);
}
.status-pill.finished {
  color: var(--text2);
  background: rgba(255,255,255,0.04);
}
.status-pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: sc-pulse 2s ease-in-out infinite;
}

/* ── SECTION LABEL (h2-style divider) ─────────────────────── */
.section-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text2);
  padding: 6px 4px 8px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border2);
}
.section-label .count {
  color: var(--text3);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: none;
}

/* ── PAGE HEADER ── */
.page-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface); border-bottom: 1px solid var(--border2);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
  /* No flex-wrap: header is always a single row */
}
.back-link {
  font-size: 13px; color: var(--text2); text-decoration: none;
  display: flex; align-items: center; gap: 4px;
  transition: color 0.15s; flex-shrink: 0; font-weight: 600;
  padding: 6px 4px; min-height: 32px;
  white-space: nowrap;
}
.back-link:hover { color: var(--home); }
.header-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin: 0; flex: 1; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
/* Spacer mirrors back-link so the title stays centred when there's no
   right-hand element (e.g. about.html). Pages with a right element (live
   badge, buttons) don't need the spacer — the right element provides the
   balance naturally. */
.header-spacer {
  flex-shrink: 0;
  width: 44px;
}
.header-right {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}

/* Card header — pale strip used as a card title bar */
.card-titlebar {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text2);
  font-weight: 700;
  padding: 7px 12px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.card-titlebar.home    { border-left: 3px solid var(--home); }
.card-titlebar.away    { border-left: 3px solid var(--away); }
.card-titlebar.neutral { border-left: 3px solid var(--border2); }

/* ── PLAYER NAME COLOR HELPERS ────────────────────────────── */
.text-home { color: var(--home); }
.text-away { color: var(--away); }
.text-neutral { color: var(--text); }

/* In commentary / log entries */
.hn { color: var(--home); font-weight: 700; }
.an { color: var(--away); font-weight: 700; }
.nn { color: var(--text);  font-weight: 700; }

/* ── EMPTY / STATE MESSAGES ───────────────────────────────── */
.state-msg {
  text-align: center;
  padding: 60px 20px;
  color: var(--text2);
  font-size: 14px;
  line-height: 1.8;
}
.state-msg .icon {
  font-size: 36px;
  margin-bottom: 14px;
  opacity: 0.5;
  display: block;
}
.empty-state {
  text-align: center;
  padding: 14px 12px;
  color: var(--text3);
  font-size: 12px;
}

/* ── OFFLINE BANNER ───────────────────────────────────────── */
.offline-banner {
  display: none;
  background: rgba(239,68,68,0.15);
  border-bottom: 1px solid rgba(239,68,68,0.3);
  padding: 6px;
  text-align: center;
  font-size: 12px;
  color: #fca5a5;
  flex-shrink: 0;
}
.offline-banner.show { display: block; }

/* ── DIVIDERS ────────────────────────────────────────────── */
.section-divider {
  height: 1px;
  background: var(--border);
}
