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

:root {
  --bg: #0a0a0f;
  --bg-card: #14141f;
  --bg-card-hover: #1a1a2e;
  --bg-input: #1a1a2e;
  --border: #2a2a3e;
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-glow: rgba(124, 58, 237, 0.3);
  --green: #10b981;
  --yellow: #f59e0b;
  --red: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ──────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-links a { color: var(--text-muted); font-size: 0.9rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }

.nav-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.2s;
}

.nav-btn:hover { border-color: var(--accent); }
.nav-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.nav-btn.primary:hover { background: var(--accent-hover); }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
}
.btn-icon:hover { color: var(--red); }

/* ── Hero ────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 1.25rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), #a78bfa, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 2rem;
}

.hero-actions { display: flex; gap: 1rem; margin-bottom: 3rem; }

.hero-stats { display: flex; gap: 3rem; }
.stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Card Stack (hero visual) ────────────────────────── */
.hero-visual { position: relative; height: 320px; }
.card-stack { position: relative; width: 100%; height: 100%; }

.preview-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.pc-1 { top: 20px; left: 0; z-index: 3; }
.pc-2 { top: 100px; left: 40px; z-index: 2; }
.pc-3 { top: 180px; left: 20px; z-index: 1; }

.pc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
  flex-shrink: 0;
}

.pc-info strong { display: block; font-size: 0.9rem; }
.pc-info span { font-size: 0.75rem; color: var(--text-muted); }

.pc-status {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
}
.pc-status.available { background: rgba(16,185,129,0.15); color: var(--green); }
.pc-status.busy { background: rgba(239,68,68,0.15); color: var(--red); }

/* ── Features ────────────────────────────────────────── */
.features {
  max-width: 1000px;
  margin: 0 auto;
  padding: 5rem 2rem;
  text-align: center;
}

.features h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
  transition: border-color 0.2s;
}

.feature-card:hover { border-color: var(--accent); }

.feature-icon { font-size: 2rem; margin-bottom: 1rem; }

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ── CTA ─────────────────────────────────────────────── */
.cta {
  text-align: center;
  padding: 5rem 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.cta h2 { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; }
.cta p { color: var(--text-muted); margin-bottom: 2rem; }

/* ── Footer ──────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* ── Container ───────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

/* ── Directory Page ──────────────────────────────────── */
.directory-header {
  text-align: center;
  margin-bottom: 2rem;
}
.directory-header h1 { font-size: 2.25rem; font-weight: 800; margin-bottom: 0.5rem; }
.directory-header p { color: var(--text-muted); }

.filters {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  margin-bottom: 1rem;
}

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

.filter-row {
  display: flex;
  gap: 1rem;
}

.filter-group {
  flex: 1;
}

.filter-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
}

.filter-group select:focus { border-color: var(--accent); }

.results-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.dir-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
}

.dir-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.dir-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dir-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dir-card-info { flex: 1; min-width: 0; }
.dir-card-info h3 { font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dir-handle { font-size: 0.8rem; color: var(--text-muted); }

.dir-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dir-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.skill-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: rgba(124, 58, 237, 0.12);
  color: #a78bfa;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
}

.skill-tag.more {
  background: rgba(136,136,160,0.12);
  color: var(--text-muted);
}

.dir-card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* ── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
}

.badge-available { background: rgba(16,185,129,0.15); color: var(--green); }
.badge-open { background: rgba(245,158,11,0.15); color: var(--yellow); }
.badge-busy { background: rgba(239,68,68,0.15); color: var(--red); }

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 2rem;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 2rem; }

.modal-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.modal-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.modal-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.modal-bio {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.modal-section {
  margin-bottom: 1.5rem;
}

.modal-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.modal-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.modal-portfolio {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.portfolio-link {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--accent);
  transition: border-color 0.2s;
}

.portfolio-link:hover { border-color: var(--accent); text-decoration: none; }

/* ── Profile Editor ──────────────────────────────────── */
.page-profile { max-width: 700px; }

.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.pe-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.pe-github { font-size: 0.85rem; color: var(--text-muted); }

.profile-form { display: flex; flex-direction: column; gap: 2rem; }

.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.form-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.form-section label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  margin-top: 0.75rem;
  color: var(--text-muted);
}

.form-section label:first-of-type { margin-top: 0; }

.form-section input[type="text"],
.form-section input[type="url"],
.form-section textarea,
.form-section select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.form-section input:focus,
.form-section textarea:focus,
.form-section select:focus { border-color: var(--accent); }

/* ── Skills Grid ─────────────────────────────────────── */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.skill-chip input { display: none; }

.skill-chip span {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-size: 0.8rem;
  transition: all 0.15s;
}

.skill-chip input:checked + span {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--accent);
  color: #a78bfa;
}

.skill-chip span:hover { border-color: var(--accent); }

/* ── Portfolio Rows ──────────────────────────────────── */
.portfolio-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.portfolio-row input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}

.portfolio-row input:focus { border-color: var(--accent); }

.form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.save-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 1.5em;
}

.save-status.success { color: var(--green); }

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state h2, .empty-state h3 { font-weight: 600; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3rem 1.5rem;
  }

  .hero h1 { font-size: 2.25rem; }
  .hero-visual { display: none; }

  .features-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 2rem; }
  .hero-actions { flex-direction: column; }

  .navbar { padding: 0.75rem 1rem; }
  .nav-links a:not(.nav-btn) { display: none; }

  .directory-grid { grid-template-columns: 1fr; }
  .filter-row { flex-direction: column; }

  .portfolio-row { flex-direction: column; }
  .form-actions { flex-direction: column; }
}

/* ── Placeholder Avatars ─────────────────────────────── */
.dir-avatar-placeholder,
.modal-avatar-placeholder,
.pe-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  flex-shrink: 0;
}

.pe-avatar-placeholder {
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
}

.modal-avatar-placeholder {
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
}

/* ── Profile Meta ─────────────────────────────────────── */
.pe-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.pe-email { color: var(--text-muted); }
.pe-sep { color: var(--border); }
.pe-verification {
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(16,185,129,0.15);
  color: var(--green);
}

.pe-verification:empty { display: none; }

.save-status.error { color: var(--red); }
