/* projects.css — Projects grid and the GitHub contribution graph. */

/* Projects & GitHub Activity */

.github-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Noto Sans", sans-serif;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 16px;
}

.github-header svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.github-profile-link {
  margin-left: auto;
  font-size: 11px;
  font-family: "Source Code Pro", monospace;
  opacity: 0.4;
  color: inherit;
  text-decoration: none;
  transition: opacity 200ms ease;
}

.github-profile-link:hover {
  opacity: 0.8;
}

/* Contribution Graph */
.contrib-graph {
  position: relative;
}

.contrib-count {
  font-family: "Noto Sans", sans-serif;
  font-size: 13px;
  opacity: 0.6;
  margin-bottom: 10px;
}

.contrib-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
  padding-bottom: 4px;
}

.contrib-scroll::-webkit-scrollbar {
  height: 4px;
}

.contrib-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

.contrib-grid-wrap {
  display: flex;
  gap: 4px;
  width: fit-content;
}

.contrib-days {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 20px;
}

.contrib-days span {
  height: 10px;
  line-height: 10px;
  font-family: "Source Code Pro", monospace;
  font-size: 9px;
  opacity: 0.4;
  text-align: right;
  padding-right: 4px;
  min-width: 24px;
}

.contrib-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contrib-months {
  position: relative;
  height: 16px;
}

.contrib-month-label {
  position: absolute;
  font-family: "Source Code Pro", monospace;
  font-size: 9px;
  opacity: 0.4;
  white-space: nowrap;
  top: 0;
}

.contrib-grid {
  display: grid;
  grid-template-rows: repeat(7, 10px);
  grid-auto-flow: column;
  grid-auto-columns: 10px;
  gap: 3px;
}

.contrib-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  outline: 1px solid transparent;
  transition: outline-color 120ms ease;
}

.contrib-cell[data-tooltip]:hover {
  outline-color: rgba(255, 255, 255, 0.4);
}

.contrib-cell[data-level="1"] { background: #0e4429; }
.contrib-cell[data-level="2"] { background: #006d32; }
.contrib-cell[data-level="3"] { background: #26a641; }
.contrib-cell[data-level="4"] { background: #39d353; }

.contrib-empty {
  visibility: hidden;
}

.contrib-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.contrib-hint {
  font-family: "Source Code Pro", monospace;
  font-size: 10px;
  opacity: 0.3;
}

.contrib-legend {
  display: flex;
  align-items: center;
  gap: 3px;
}

.contrib-legend span {
  font-family: "Source Code Pro", monospace;
  font-size: 9px;
  opacity: 0.4;
  padding: 0 3px;
}

.contrib-legend .contrib-cell {
  cursor: default;
}

.contrib-tooltip {
  display: none;
  position: absolute;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-family: "Noto Sans", sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.github-loading {
  font-family: "Noto Sans", sans-serif;
  font-size: 12px;
  opacity: 0.4;
  padding: 12px;
  text-align: center;
}

/* Projects Grid */
.projects-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.projects-header {
  font-family: "Noto Sans", sans-serif;
  font-weight: 700;
  font-size: 14px;
}

.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  font-family: "Noto Sans", sans-serif;
  opacity: 0;
  transform: translateY(-8px);
  animation: searchItemIn 420ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.project-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.project-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}

.project-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.project-card-icon svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.project-card-body {
  flex: 1;
  min-width: 0;
}

.project-card-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}

.project-card-desc {
  font-size: 12px;
  opacity: 0.6;
  line-height: 1.4;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.project-tag {
  font-size: 10px;
  font-family: "Source Code Pro", monospace;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.6;
}

.project-card-arrow {
  width: 16px;
  height: 16px;
  opacity: 0.3;
  flex-shrink: 0;
  margin-top: 2px;
  transition: opacity 200ms ease, transform 200ms ease;
}

.project-card:hover .project-card-arrow {
  opacity: 0.7;
  transform: translateX(2px);
}

.project-type-badge {
  font-size: 9px;
  font-family: "Source Code Pro", monospace;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  margin-top: 2px;
}

.project-type-badge.repo {
  background: rgba(88, 166, 255, 0.15);
  color: #58a6ff;
  border: 1px solid rgba(88, 166, 255, 0.25);
}

.project-type-badge.research {
  background: rgba(163, 113, 247, 0.15);
  color: #a371f7;
  border: 1px solid rgba(163, 113, 247, 0.25);
}

.project-type-badge.build {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.25);
}

/* Projects with no public link keep the card treatment but stay unclickable. */
.project-card.is-static {
  cursor: default;
}

.project-card.is-static:hover {
  transform: none;
}

/* Light mode overrides for projects */
body.light-mode .contrib-cell {
  background: #ebedf0;
}

body.light-mode .contrib-cell[data-level="1"] { background: #9be9a8; }
body.light-mode .contrib-cell[data-level="2"] { background: #40c463; }
body.light-mode .contrib-cell[data-level="3"] { background: #30a14e; }
body.light-mode .contrib-cell[data-level="4"] { background: #216e39; }

body.light-mode .contrib-cell[data-tooltip]:hover {
  outline-color: rgba(0, 0, 0, 0.3);
}

body.light-mode .contrib-scroll {
  scrollbar-color: rgba(0,0,0,0.1) transparent;
}

body.light-mode .contrib-scroll::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
}

body.light-mode .contrib-tooltip {
  background: rgba(36, 41, 47, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

body.light-mode .project-card {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.12);
}

body.light-mode .project-card:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.14);
}

body.light-mode .project-card-icon {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .project-tag {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.08);
}

@media (max-width: 480px) {
  .contrib-footer {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }
}
