/* ─── VARIABLES — misma paleta que el resto del sitio ─────────
   (antes /projects/ tenía su propio verde; ahora hereda los
   mismos tokens de style.css para quedar consistente) ────────── */
:root {
  --bg:         #0d1117;
  --bg-card:    #161b22;
  --bg-card-2:  #1c2128;
  --bg-card-h:  #21262d;
  --border:     #30363d;
  --border-dim: #21262d;
  --accent:      #f5a524;
  --accent-dim:  #c47e1a;
  --accent-soft: rgba(245, 165, 36, 0.12);
  --text:       #e6edf3;
  --text-dim:   #8b949e;
  --text-muted: #6e7681;
  --mono:       'JetBrains Mono', 'Fira Code', monospace;
  --sans:       'Inter', system-ui, sans-serif;
  --r:          12px;
  --nav-h:      72px;

  --done-c:   #3ddc84;
  --prog-c:   #e8c84a;
  --plan-c:   #8a8ad0;

  --sidebar-w: 260px;
}

/* ─── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); }

/* ─── SHELL ──────────────────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ──────────────────────────────────────────────────────────────
   SIDEBAR IZQUIERDA — perfil + búsqueda + filtros (acordeón)
────────────────────────────────────────────────────────────── */
.sidebar-left {
  border-right: 1px solid var(--border-dim);
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}

/* Perfil */
.profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
}

.profile-text {
  display: flex; flex-direction: column; gap: 0.1rem;
  overflow: hidden;
}

.profile-name {
  font-size: 0.85rem; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.profile-handle { font-size: 0.7rem; color: var(--text-muted); }

.profile-bio {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.55;
}

/* Búsqueda — ahora en el sidebar */
.search-wrap {
  display: flex; align-items: center; gap: 0.55rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  transition: border-color 0.15s;
}
.search-wrap:focus-within { border-color: var(--accent-dim); }

.search-wrap svg { color: var(--text-muted); flex-shrink: 0; }

.search-wrap input {
  background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--sans); font-size: 0.82rem;
  width: 100%;
}
.search-wrap input::placeholder { color: var(--text-muted); }

/* ─── FILTROS — ACORDEÓN ──────────────────────────────────────── */
.filters-block { display: flex; flex-direction: column; gap: 0.35rem; }

.filters-title {
  font-family: var(--sans);
  font-size: 0.95rem; font-weight: 700;
  color: var(--text);
  padding-bottom: 0.35rem;
  display: flex; align-items: center; justify-content: space-between;
}

.filters-clear {
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--text-muted); background: none; border: none;
  cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
.filters-clear:hover { color: var(--accent); }

.accordion { border-top: 1px solid var(--border-dim); }
.accordion:last-child { border-bottom: 1px solid var(--border-dim); }

.accordion-head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 0.15rem;
  background: none; border: none;
  color: var(--text); font-family: var(--sans); font-size: 0.82rem; font-weight: 600;
  cursor: pointer;
}

.accordion-head .chev {
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.accordion.open .accordion-head .chev { transform: rotate(180deg); color: var(--accent); }

.accordion-body {
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  padding-bottom: 0.65rem;
}
.accordion.open .accordion-body { display: flex; }

.filter-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.4rem;
  border-radius: 7px;
  color: var(--text-dim); font-size: 0.78rem;
  cursor: pointer; text-align: left; background: none; border: none; width: 100%;
  transition: background 0.15s, color 0.15s;
}
.filter-row:hover  { background: var(--bg-card); color: var(--text); }
.filter-row.active { color: var(--accent); background: var(--accent-soft); }

.filter-check {
  width: 14px; height: 14px; border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card-2);
  transition: border-color 0.15s, background 0.15s;
}
.filter-row.active .filter-check {
  border-color: var(--accent); background: var(--accent);
}
.filter-check svg { opacity: 0; transition: opacity 0.1s; color: var(--bg); }
.filter-row.active .filter-check svg { opacity: 1; }

.filter-row-label { flex: 1; font-family: var(--mono); }

.filter-count {
  font-size: 0.65rem; color: var(--text-muted);
  background: var(--bg-card-2); border: 1px solid var(--border-dim);
  border-radius: 999px; padding: 0 0.4rem; line-height: 1.6;
  font-family: var(--mono);
}
.filter-row.active .filter-count { color: var(--accent); border-color: var(--accent-dim); }

.filter-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────────
   FEED / GRID PRINCIPAL
────────────────────────────────────────────────────────────── */
.feed {
  padding: 1.75rem 2.25rem 3rem;
  display: flex; flex-direction: column; gap: 1.5rem;
}

.feed-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border-dim);
}

.feed-title {
  font-size: 1.3rem; font-weight: 800; color: var(--text);
}

.feed-count {
  font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted);
  flex-shrink: 0;
}

/* ─── GRUPOS Y GRID DE TARJETAS ──────────────────────────────── */
#projects-feed { display: flex; flex-direction: column; gap: 2.5rem; }

.cat-group-label {
  font-family: var(--mono);
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 0.7rem; margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--border-dim);
}

.cat-group-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}
.project-card:hover {
  border-color: var(--accent-dim);
  background: var(--bg-card-h);
  transform: translateY(-2px);
}

/* Imagen / thumb superior (16:9) */
.proj-thumb-wrap {
  position: relative;
  aspect-ratio: 16/9;
  background:
    radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 60%),
    repeating-linear-gradient(0deg, var(--border-dim) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, var(--border-dim) 0 1px, transparent 1px 28px),
    var(--bg-card-2);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border);
}
.proj-thumb {
  width: 56px; height: 56px;
  object-fit: contain;
  filter: brightness(0.95) saturate(0.9);
  transition: filter 0.2s, transform 0.2s;
}
.project-card:hover .proj-thumb { filter: brightness(1.05) saturate(1.1); transform: scale(1.08); }

.proj-status-badge {
  position: absolute; top: 0.65rem; right: 0.65rem;
  display: flex; align-items: center; gap: 0.35rem;
  font-family: var(--mono); font-size: 0.62rem;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  background: rgba(10,14,22,0.75);
  border: 1px solid var(--border);
  backdrop-filter: blur(4px);
  color: var(--text-dim);
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.s-done     { background: var(--done-c); box-shadow: 0 0 4px rgba(61,220,132,0.6); }
.s-progress { background: var(--prog-c); box-shadow: 0 0 4px rgba(232,200,74,0.5); }
.s-planned  { background: var(--plan-c); }

/* Cuerpo de la tarjeta */
.proj-info { display: flex; flex-direction: column; gap: 0.65rem; padding: 1.1rem 1.15rem 1.15rem; flex: 1; }

.proj-title {
  font-size: 1rem; font-weight: 700;
  color: var(--text); line-height: 1.35;
}

.proj-desc {
  font-size: 0.82rem; color: var(--text-dim); line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* Tags — visibles */
.proj-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.tag {
  font-family: var(--mono); font-size: 0.66rem;
  color: var(--text-dim);
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  transition: color 0.15s, border-color 0.15s;
}
.tag:hover { color: var(--accent); border-color: var(--accent-dim); cursor: pointer; }

/* Pie de tarjeta: categoría + botón de repo grande */
.proj-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--border-dim);
  margin-top: auto;
}

.proj-cat {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; color: var(--text-muted);
  overflow: hidden;
}
.proj-cat-icon {
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--bg-card-2); border: 1px solid var(--border-dim);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.proj-cat-icon img { width: 12px; height: 12px; }
.proj-cat-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.proj-repo-btn {
  display: flex; align-items: center; gap: 0.45rem;
  font-family: var(--mono); font-size: 0.74rem; font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  white-space: nowrap; flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}
.proj-repo-btn:hover { background: #ffb648; transform: translateY(-1px); }
.proj-repo-btn svg { flex-shrink: 0; }

.proj-repo-btn.is-planned {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  cursor: default;
}
.proj-repo-btn.is-planned:hover { transform: none; background: transparent; }

/* Empty state */
.empty-state {
  padding: 3rem 0; text-align: center;
  font-family: var(--mono); font-size: 0.8rem; color: var(--text-muted);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar-left {
    position: static; height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-dim);
  }
}
@media (max-width: 640px) {
  .feed { padding: 1.25rem 1rem 2rem; }
  .cat-group-items { grid-template-columns: 1fr; }
  .feed-header { flex-wrap: wrap; gap: 0.5rem; }
}
