/* ============================================================
   GitHub Developer Dashboard — style.css
   Dark, minimal design inspired by GitHub / Vercel / Linear
   ============================================================ */

/* ----- Reset & Base ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Color system — zinc scale */
  --bg:           #09090b;
  --bg-card:      #111113;
  --bg-elevated:  #18181b;
  --border:       #27272a;
  --border-hover: #3f3f46;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted:   #71717a;
  --accent:       #f4f4f5;
  --accent-hover: #e4e4e7;

  /* Typography */
  --font-sans:  'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  ui-monospace, 'Cascadia Code', 'Source Code Pro', 'Fira Code', 'JetBrains Mono', Menlo, Consolas, monospace;

  /* Spacing scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  18px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

input, select, button {
  font-family: inherit;
  font-size: inherit;
}

/* ----- Container ----- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ----- Card ----- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

/* ============================================================
   Navigation
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.logo-accent {
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: var(--space-6);
  font-size: 13px;
  color: var(--text-secondary);
}

.nav-links a {
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text-primary);
}

.nav-links a:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   Hero / Profile Section
   ============================================================ */
.hero-section {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: var(--space-5);
  margin-top: var(--space-8);
}

/* Profile card */
.profile-header {
  display: flex;
  gap: var(--space-5);
  align-items: center;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
}

.profile-name {
  font-size: 32px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-top: var(--space-1);
}

.username {
  color: var(--text-secondary);
  font-size: 14px;
  font-family: var(--font-mono);
  margin-top: 2px;
}

.bio {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-top: var(--space-5);
  max-width: 600px;
}

.profile-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--border);
}

/* ============================================================
   Statistics Cards
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.stat-card {
  padding: var(--space-5);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: var(--space-2);
  font-family: var(--font-mono);
}

/* ============================================================
   Developer Identity
   ============================================================ */
.identity-section {
  margin-top: var(--space-5);
}

.identity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.category-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: var(--bg-elevated);
  white-space: nowrap;
}

/* ============================================================
   Repository Section
   ============================================================ */
.repositories-section {
  margin-top: var(--space-5);
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.section-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.repo-controls {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  color: var(--text-primary);
  font-size: 13px;
  width: 200px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--border-hover);
}

.sort-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: var(--space-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.sort-select:focus {
  border-color: var(--border-hover);
}

/* Repository grid */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.repo-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--bg-elevated);
  transition: border-color var(--transition-base), transform var(--transition-base);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.repo-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.repo-card:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 2px;
}

.repo-name {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.repo-name::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.repo-description {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: var(--space-2);
  flex-grow: 1;
  min-height: 36px;
}

.repo-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.repo-lang {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.repo-stat {
  display: flex;
  align-items: center;
  gap: 3px;
}

.repo-updated {
  margin-left: auto;
  font-size: 10px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-6);
}

.empty-icon {
  font-size: 32px;
  margin-bottom: var(--space-3);
}

.empty-text {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
}

.empty-subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ============================================================
   Two-column layout (Languages & Contributions)
   ============================================================ */
.two-column-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-top: var(--space-5);
}

/* ============================================================
   Top Languages
   ============================================================ */
.languages-bars {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.lang-row {
  display: grid;
  grid-template-columns: 90px 1fr 40px;
  align-items: center;
  gap: var(--space-3);
  font-size: 12px;
}

.lang-name {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
}

.lang-track {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border);
  overflow: hidden;
}

.lang-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.lang-pct {
  text-align: right;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ============================================================
   Contribution Heatmap
   ============================================================ */
.contributions-grid {
  display: grid;
  grid-template-columns: repeat(52, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  margin-top: var(--space-4);
}

.contrib-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--border);
  position: relative;
  cursor: default;
}

.contrib-cell[data-level="1"] { background: #3f3f46; }
.contrib-cell[data-level="2"] { background: #52525b; }
.contrib-cell[data-level="3"] { background: #a1a1aa; }
.contrib-cell[data-level="4"] { background: #e4e4e7; }

.contrib-cell:hover {
  outline: 1px solid var(--text-muted);
  outline-offset: 1px;
}

/* Tooltip for contribution cells */
.contrib-cell::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 10;
}

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

.contributions-note {
  margin-top: var(--space-3);
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.5;
}

.activity-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
}

/* ============================================================
   Recent Activity
   ============================================================ */
.recent-activity-section {
  margin-top: var(--space-5);
}

.activity-list {
  display: grid;
  gap: 0;
}

.activity-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.activity-body {
  min-width: 0;
}

.activity-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.activity-repo {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================================
   Terminal
   ============================================================ */
.terminal-section {
  margin-top: var(--space-5);
  padding: 0;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red    { background: #ef4444; }
.dot-yellow { background: #eab308; }
.dot-green  { background: #22c55e; }

.terminal-title {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-left: auto;
  margin-right: auto;
}

.terminal-body {
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: 13px;
  min-height: 180px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
}

.terminal-output {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: var(--space-3);
}

.terminal-line {
  display: flex;
  gap: var(--space-2);
  line-height: 1.8;
  min-height: 24px;
}

.terminal-prompt {
  color: #4ade80;
  user-select: none;
  flex-shrink: 0;
}

.terminal-text {
  color: var(--text-secondary);
}

.terminal-cmd {
  color: var(--text-primary);
}

.terminal-input-line {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
}

.terminal-input {
  flex-grow: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  caret-color: #4ade80;
}

.terminal-input::placeholder {
  color: var(--text-muted);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  margin-top: var(--space-12);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.footer-links a {
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-secondary);
}

.footer-separator {
  color: var(--border);
}

/* ============================================================
   Loading & Skeleton States
   ============================================================ */
.loading-state {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-muted);
  font-size: 13px;
}

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--border-hover) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-text {
  color: transparent;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Error state */
.error-state {
  text-align: center;
  padding: var(--space-8);
  color: #ef4444;
  font-size: 13px;
}

.error-state .error-detail {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: var(--space-2);
}

/* ============================================================
   Responsive Design
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
  .hero-section {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .identity-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-4);
  }

  .nav-links {
    display: none;
  }

  .hero-section {
    grid-template-columns: 1fr;
    margin-top: var(--space-5);
  }

  .profile-name {
    font-size: 26px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-value {
    font-size: 22px;
  }

  .identity-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }

  .repo-grid {
    grid-template-columns: 1fr;
  }

  .two-column-section {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
  }

  .repo-controls {
    width: 100%;
  }

  .search-input {
    width: 100%;
    flex: 1;
  }

  .sort-select {
    flex: 1;
  }

  .footer-content {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }

  .card {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
  }

  .contributions-grid {
    gap: 2px;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-actions {
    justify-content: center;
  }

  .identity-grid {
    grid-template-columns: 1fr;
  }

  .lang-row {
    grid-template-columns: 70px 1fr 35px;
  }
}
