/* ============================================================================
 * github-activity.css — GitHub Activity Widget (Startseite)
 *
 * Contribution-Heatmap (Portfolio-Lila statt GitHub-Grün) + Repo-Statistiken
 * + Top-Sprachen-Leiste. Build-gebackene Daten, statisch gerendert.
 * ========================================================================= */

.github-section {
  position: relative;
  padding: 100px 0;
}

.github-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.github-head .section-title {
  margin-bottom: 12px;
}

.github-sub {
  color: var(--text-2);
  font-size: 1.02rem;
  line-height: 1.6;
  margin: 0;
}

/* Panel-Container */
.github-widget {
  max-width: 940px;
  margin: 0 auto;
  background: color-mix(in srgb, var(--surface-1) 72%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 34px;
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.5);
}

/* ── CONTRIBUTION-GRAPH ───────────────────────────────────────────────────── */

.gh-contrib-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.gh-contrib-total {
  font-size: 1.05rem;
  color: var(--text-1);
  font-weight: 600;
}

.gh-contrib-total b {
  color: var(--primary-color, #9d00ff);
  font-weight: 800;
}

/* Scroll-Container (Mobile: horizontal scrollbar statt Quetschen) */
.gh-graph-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(157, 0, 255, 0.3) transparent;
}
.gh-graph-scroll::-webkit-scrollbar { height: 6px; }
.gh-graph-scroll::-webkit-scrollbar-thumb { background: rgba(157, 0, 255, 0.25); border-radius: 3px; }

.gh-graph {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  min-width: min-content;
}

/* Monats-Labels oben (absolut positioniert; left wird vom Renderer gesetzt) */
.gh-months {
  position: relative;
  height: 14px;
}

.gh-month-label {
  font-size: 0.68rem;
  color: var(--text-3);
  white-space: nowrap;
  position: absolute;
  top: 0;
}

/* Untere Reihe: Wochentage + Grid */
.gh-graph-body {
  display: flex;
  gap: 8px;
}

.gh-weekdays {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 22px;
  flex-shrink: 0;
}

.gh-weekday {
  height: 11px;
  font-size: 0.62rem;
  line-height: 11px;
  color: var(--text-3);
  text-align: right;
}

.gh-grid {
  display: flex;
  gap: 4px;
}

.gh-week {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gh-day {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: transform 0.12s ease;
  cursor: default;
}

.gh-day.pad {
  background: transparent;
  border-color: transparent;
}

/* Lila-Intensitätsstufen (gebrandet) */
.gh-day.l1 { background: rgba(157, 0, 255, 0.28); border-color: transparent; }
.gh-day.l2 { background: rgba(157, 0, 255, 0.48); border-color: transparent; }
.gh-day.l3 { background: rgba(157, 0, 255, 0.72); border-color: transparent; }
.gh-day.l4 {
  background: rgba(157, 0, 255, 1);
  border-color: transparent;
  box-shadow: 0 0 6px rgba(157, 0, 255, 0.5);
}

.gh-day:not(.pad):hover {
  transform: scale(1.35);
  outline: 1px solid var(--border-strong);
}

/* Reveal-Animation (gestaffelt) */
.gh-day.gh-reveal { opacity: 0; transform: scale(0.4); }
.gh-day.gh-reveal.in { opacity: 1; transform: scale(1); transition: opacity 0.4s ease, transform 0.4s ease; }

/* Legende */
.gh-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.7rem;
  color: var(--text-3);
}

.gh-legend-cells { display: flex; gap: 3px; }
.gh-legend .gh-day { cursor: default; }
.gh-legend .gh-day:hover { transform: none; outline: none; }

/* Tooltip */
.gh-tooltip {
  position: fixed;
  z-index: 100;
  background: var(--surface-2);
  border: 1px solid rgba(157, 0, 255, 0.3);
  color: var(--text-1);
  font-size: 0.74rem;
  padding: 6px 10px;
  border-radius: 7px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 0.12s ease;
  box-shadow: var(--shadow-1);
}
.gh-tooltip.show { opacity: 1; }
.gh-tooltip b { color: var(--primary-color, #c77dff); }

/* ── DIVIDER ──────────────────────────────────────────────────────────────── */

.gh-divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* ── STAT-TILES ───────────────────────────────────────────────────────────── */

.gh-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.gh-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.gh-stat:hover {
  border-color: rgba(157, 0, 255, 0.25);
  background: rgba(157, 0, 255, 0.03);
  transform: translateY(-2px);
}

.gh-stat-icon {
  color: rgba(157, 0, 255, 0.7);
  width: 18px;
  height: 18px;
}

.gh-stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-1);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
  line-height: 1;
}

.gh-stat-label {
  font-size: 0.74rem;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

/* ── TOP-SPRACHEN ─────────────────────────────────────────────────────────── */

.gh-langs { margin-top: 30px; }

.gh-langs-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}

.gh-lang-bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-2);
}

.gh-lang-seg {
  height: 100%;
  transition: filter 0.2s;
}
.gh-lang-seg:hover { filter: brightness(1.25); }

.gh-lang-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 16px;
}

.gh-lang-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--text-2);
}

.gh-lang-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gh-lang-pct {
  color: var(--text-3);
  font-size: 0.74rem;
  font-family: var(--font-mono);
}

/* ── EMPTY STATE ──────────────────────────────────────────────────────────── */

.gh-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
  font-size: 0.9rem;
}

/* ── RTL (Arabisch) ───────────────────────────────────────────────────────── */
/* Die Heatmap selbst bleibt bewusst LTR (Kalender liest man chronologisch —
   genau wie GitHub bei arabischer Sprache). Nur die Text-Umgebung spiegelt. */

[dir="rtl"] .gh-contrib-head { flex-direction: row-reverse; }
[dir="rtl"] .gh-legend { justify-content: flex-start; flex-direction: row-reverse; }
[dir="rtl"] .gh-lang-legend { flex-direction: row-reverse; }

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .github-widget { padding: 22px 18px; border-radius: 16px; }
  .gh-stats { grid-template-columns: repeat(2, 1fr); }
  .gh-stat-value { font-size: 1.45rem; }
  .gh-contrib-head { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .gh-day.gh-reveal { opacity: 1; transform: none; }
  .gh-day.gh-reveal.in { transition: none; }
}
