/* css/stat-card.css
   Styles for the reusable stat card component and profile tab layout. */

/* ── Topic headers ─────────────────────────────────────────────────── */
.wm-stat-topic-header {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin: 1rem 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #e5e7eb;
}
.wm-stat-topic-header:first-child {
  margin-top: 0;
}

/* ── Stat card grid ────────────────────────────────────────────────── */
.wm-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (max-width: 480px) {
  .wm-stat-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Individual stat card ───────────────────────────────────���──────── */
.wm-stat-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem;
  transition: border-color 0.15s;
}
.wm-stat-card:hover {
  border-color: #d1d5db;
}
.wm-stat-card--derived {
  background: #f0f4ff;
  border-color: #dbeafe;
}

/* Primary value — big, bold */
.wm-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
}

/* Label — smaller, muted */
.wm-stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.125rem;
  line-height: 1.3;
}

/* ── Comparison rows ───────────────────────────────────────────────── */
.wm-stat-comparisons {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e5e7eb;
}

.wm-stat-comp-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.7rem;
  color: #6b7280;
  line-height: 1.6;
}

.wm-stat-comp-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wm-stat-comp-value {
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.wm-stat-comp-indicator {
  font-size: 0.6rem;
  width: 1em;
  text-align: center;
}
.wm-stat-comp-indicator--above {
  color: #059669;
}
.wm-stat-comp-indicator--below {
  color: #dc2626;
}

/* ── Profile tab container ─────────────────────────────────────────── */
.wm-profile-container {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.25rem;
}

.wm-profile-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  color: #6b7280;
}

.wm-profile-empty {
  text-align: center;
  padding: 2rem;
  color: #9ca3af;
  font-size: 0.875rem;
}

/* ── Comparison legend (shown once at top of profile) ──────────────── */
.wm-profile-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.7rem;
  color: #9ca3af;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
}
.wm-profile-legend span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Year badge */
.wm-profile-year {
  display: inline-block;
  font-size: 0.65rem;
  background: #e5e7eb;
  color: #6b7280;
  border-radius: 4px;
  padding: 0.125rem 0.375rem;
  margin-left: 0.5rem;
  font-weight: 500;
}
