/* ===== Heatmap Wall ===== */
.heatmap-section {
  margin-top: 2.5rem;
}

.heatmap-section h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--text-color, #2c3e50);
}

/* Stats cards */
.heatmap-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.heatmap-stat-card {
  flex: 1;
  background: var(--board-bg, #f6f8fa);
  border: 1px solid var(--card-border, #e1e4e8);
  border-radius: 6px;
  padding: 0.6rem 1rem;
  text-align: center;
}

.heatmap-stat-number {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--link-color, #0366d6);
  line-height: 1.2;
}

.heatmap-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted, #6a737d);
  margin-top: 0.15rem;
}

/* Heatmap */
.heatmap-wrap {
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.heatmap-grid {
  display: flex;
  gap: 3px;
  align-items: flex-start;
}

.heatmap-labels-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 20px;
  margin-right: 4px;
}

.heatmap-day-label {
  font-size: 0.65rem;
  color: var(--text-muted, #6a737d);
  height: 12px;
  line-height: 12px;
  width: 28px;
  text-align: right;
  white-space: nowrap;
}

.heatmap-grid-area {
  display: flex;
  flex-direction: column;
}

.heatmap-months {
  display: flex;
  gap: 3px;
  margin-bottom: 4px;
  height: 16px;
}

.heatmap-month-label {
  font-size: 0.65rem;
  color: var(--text-muted, #6a737d);
  overflow: visible;
  white-space: nowrap;
}

.heatmap-weeks {
  display: flex;
  gap: 3px;
}

.heatmap-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Cells */
.heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  position: relative;
  cursor: default;
  background-color: var(--cell-0, #ebedf0);
}

.heatmap-cell[data-level="1"] { background-color: var(--cell-1, #9be9a8); }
.heatmap-cell[data-level="2"] { background-color: var(--cell-2, #40c463); }
.heatmap-cell[data-level="3"] { background-color: var(--cell-3, #30a14e); }
.heatmap-cell[data-level="4"] { background-color: var(--cell-4, #216e39); }

/* Tooltip */
.heatmap-cell::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(36, 41, 47, 0.92);
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 99;
}

.heatmap-cell:hover::after {
  opacity: 1;
}

/* Legend */
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.6rem;
  justify-content: flex-end;
}

.heatmap-legend-label {
  font-size: 0.65rem;
  color: var(--text-muted, #6a737d);
}

.heatmap-legend-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background-color: var(--cell-0, #ebedf0);
}

.heatmap-legend-cell[data-level="1"] { background-color: var(--cell-1, #9be9a8); }
.heatmap-legend-cell[data-level="2"] { background-color: var(--cell-2, #40c463); }
.heatmap-legend-cell[data-level="3"] { background-color: var(--cell-3, #30a14e); }
.heatmap-legend-cell[data-level="4"] { background-color: var(--cell-4, #216e39); }

/* Dark mode */
html[data-user-color-scheme="dark"] {
  --cell-0: #161b22;
  --cell-1: #0e4429;
  --cell-2: #006d32;
  --cell-3: #26a641;
  --cell-4: #39d353;
  --board-bg: #21262d;
  --card-border: #30363d;
  --text-muted: #8b949e;
}

/* Responsive */
@media (max-width: 480px) {
  .heatmap-cell {
    width: 10px;
    height: 10px;
  }

  .heatmap-week { gap: 2px; }
  .heatmap-weeks { gap: 2px; }
  .heatmap-grid { gap: 2px; }
  .heatmap-months { gap: 2px; }
}
