/* ================================================================
   CERTMASTER — Profile & User Search Styles
   ================================================================ */

/* ── Navbar back button ──────────────────────────────────────────── */
.navbar-back-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 12px;
  font-size: 13px; font-weight: 600; color: var(--text2);
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.navbar-back-btn:hover { background: var(--card2); color: var(--text); }

.prof-edit-nav-btn {
  display: flex; align-items: center; gap: 5px;
  background: var(--accent); border: none;
  border-radius: var(--radius-sm); padding: 6px 14px;
  font-size: 13px; font-weight: 700; color: #fff;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.prof-edit-nav-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ── Profile page layout ─────────────────────────────────────────── */
.prof-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.prof-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.prof-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-xs);
}

/* Avatar */
.prof-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 14px;
  border: 3px solid var(--border);
  flex-shrink: 0;
}
.prof-avatar-init {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-glow);
  border: 3px solid var(--border2);
  color: var(--accent);
  font-size: 28px; font-weight: 800;
  user-select: none;
}

/* Name + headline */
.prof-name {
  font-size: 17px; font-weight: 800;
  color: var(--text); letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.prof-headline {
  font-size: 13px; color: var(--text2);
  font-weight: 500; margin-bottom: 8px;
  line-height: 1.4;
}
.prof-meta-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center; margin-bottom: 12px;
}
.prof-meta-item { font-size: 12px; color: var(--text3); }

/* Social links */
.prof-social-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center; margin-bottom: 14px;
}
.prof-social-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--radius-sm);
  background: var(--card2); border: 1px solid var(--border);
  color: var(--text2); font-size: 12px; font-weight: 600;
  text-decoration: none; transition: var(--transition);
}
.prof-social-link:hover { background: var(--accent-glow); border-color: var(--border2); color: var(--accent); }

/* Stats row */
.prof-stats-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin-bottom: 14px;
}
.prof-stat-chip {
  display: flex; flex-direction: column; align-items: center;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px;
  min-width: 60px;
}
.prof-stat-chip.prof-stat-premium { background: var(--accent-glow); border-color: var(--border2); }
.psc-val { font-size: 14px; font-weight: 800; color: var(--text); }
.psc-lbl { font-size: 10px; color: var(--text3); font-weight: 500; margin-top: 2px; }

/* Edit / action buttons */
.prof-edit-btn {
  width: 100%; padding: 10px 16px;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px; font-weight: 700;
  color: var(--text2); cursor: pointer; font-family: 'Inter', sans-serif;
  transition: var(--transition); margin-top: 4px;
}
.prof-edit-btn:hover { background: var(--accent-glow); border-color: var(--border2); color: var(--accent); }

.prof-action-row { width: 100%; margin-top: 4px; }
.prof-action-btn {
  width: 100%; padding: 8px 14px;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 12px; font-weight: 600;
  color: var(--text3); cursor: pointer; font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.prof-action-btn:hover { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.25); color: #ef4444; }
.prof-action-btn--blocked { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.25); color: #ef4444; }

/* ── Privacy card ────────────────────────────────────────────────── */
.prof-privacy-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-xs);
}
.prof-privacy-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 12px;
}
.prof-privacy-opts { display: flex; flex-direction: column; gap: 6px; }
.prof-privacy-opt {
  display: flex; align-items: center; gap: 0;
  padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card2);
  cursor: pointer; transition: var(--transition);
}
.prof-privacy-opt input[type="radio"] { display: none; }
.prof-privacy-opt.active {
  background: var(--accent-glow);
  border-color: var(--border2);
}
.ppo-inner { display: flex; align-items: center; gap: 10px; }
.ppo-icon { font-size: 18px; flex-shrink: 0; }
.ppo-label { font-size: 13px; font-weight: 700; color: var(--text); }
.ppo-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* ── Main content ────────────────────────────────────────────────── */
.prof-main { display: flex; flex-direction: column; gap: 2px; }

.prof-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
}
.prof-section-title {
  font-size: 14px; font-weight: 800; color: var(--text);
  margin-bottom: 14px; letter-spacing: -0.2px;
}
.prof-section-cta { background: var(--accent-glow); border-color: var(--border2); }
.prof-section-empty { text-align: center; padding: 40px; }

.prof-bio { font-size: 14px; color: var(--text2); line-height: 1.7; margin: 0; white-space: pre-line; }

.prof-inline-btn {
  background: none; border: none; color: var(--accent);
  font-weight: 600; cursor: pointer; font-size: 14px;
  font-family: 'Inter', sans-serif; text-decoration: underline;
  padding: 0;
}
.prof-empty-hint { font-size: 13px; color: var(--text2); margin: 0; }
.prof-empty-icon { font-size: 36px; margin-bottom: 10px; }
.prof-empty-text { font-size: 14px; color: var(--text3); }

/* ── Skills ──────────────────────────────────────────────────────── */
.prof-skills-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.prof-skill-chip {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-full, 9999px);
  padding: 4px 12px; font-size: 12px; font-weight: 600;
  color: var(--text2); white-space: nowrap;
  transition: var(--transition);
}
.prof-skill-chip:hover { background: var(--accent-glow); border-color: var(--border2); color: var(--accent); }

/* ── Experience timeline ─────────────────────────────────────────── */
.prof-timeline { display: flex; flex-direction: column; gap: 0; }
.prof-timeline-item {
  display: flex; gap: 14px;
  padding-bottom: 20px; position: relative;
}
.prof-timeline-item:last-child { padding-bottom: 0; }
.prof-timeline-item:not(:last-child)::before {
  content: ''; position: absolute;
  left: 7px; top: 16px; bottom: 0; width: 2px;
  background: var(--border);
}
.prof-tl-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--card);
  box-shadow: 0 0 0 2px var(--accent-glow);
  flex-shrink: 0; margin-top: 2px;
}
.prof-tl-body { flex: 1; min-width: 0; }
.prof-tl-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.prof-tl-sub { font-size: 13px; color: var(--text2); font-weight: 500; margin-bottom: 2px; }
.prof-tl-dates { font-size: 12px; color: var(--text3); margin-bottom: 6px; }
.prof-tl-desc { font-size: 13px; color: var(--text2); line-height: 1.6; margin: 0; }

/* ── Education ───────────────────────────────────────────────────── */
.prof-edu-list { display: flex; flex-direction: column; gap: 14px; }
.prof-edu-item { display: flex; gap: 14px; align-items: flex-start; }
.prof-edu-icon { font-size: 24px; flex-shrink: 0; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.prof-edu-body { flex: 1; min-width: 0; }
.prof-edu-school { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.prof-edu-degree { font-size: 13px; color: var(--text2); margin-bottom: 2px; }
.prof-edu-dates { font-size: 12px; color: var(--text3); }

/* ── Portfolio ───────────────────────────────────────────────────── */
.prof-portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.prof-portfolio-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  text-decoration: none; transition: var(--transition);
  position: relative;
}
.prof-portfolio-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.prof-portfolio-title { font-size: 14px; font-weight: 700; color: var(--text); }
.prof-portfolio-desc { font-size: 12px; color: var(--text3); line-height: 1.5; flex: 1; }
.prof-portfolio-arrow { font-size: 16px; color: var(--accent); align-self: flex-end; }

/* ── Privacy gate ────────────────────────────────────────────────── */
.prof-gate {
  text-align: center; padding: 80px 24px;
  max-width: 400px; margin: 0 auto;
}
.prof-gate-icon { font-size: 48px; margin-bottom: 16px; }
.prof-gate-title { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.prof-gate-sub { font-size: 14px; color: var(--text3); margin-bottom: 24px; line-height: 1.6; }
.prof-gate-btn {
  background: var(--accent); border: none;
  border-radius: var(--radius); padding: 10px 24px;
  color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: 'Inter', sans-serif;
}

/* ── Skeleton ────────────────────────────────────────────────────── */
.skeleton {
  background: var(--card2);
  border-radius: var(--radius-sm);
  animation: skeletonPulse 1.5s ease-in-out infinite;
}
@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ═══════════════════════════════════════════════════════
   USER SEARCH PAGE
   ═══════════════════════════════════════════════════════ */
.src-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.src-hero { text-align: center; margin-bottom: 28px; }
.src-hero-title { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; margin-bottom: 8px; }
.src-hero-sub { font-size: 14px; color: var(--text3); }

/* Search box */
.src-search-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 20px;
}
.src-input-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 0 14px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.src-input-wrap:focus-within { border-color: var(--accent); }
.src-search-icon { color: var(--text3); flex-shrink: 0; }
.src-input {
  flex: 1; background: none; border: none; outline: none;
  padding: 12px 0; font-size: 14px; color: var(--text);
  font-family: 'Inter', sans-serif;
}
.src-input::placeholder { color: var(--text3); }
.src-clear-btn {
  background: none; border: none; color: var(--text3);
  cursor: pointer; font-size: 14px; padding: 4px;
  transition: color 0.2s; flex-shrink: 0;
}
.src-clear-btn:hover { color: var(--text); }

/* Filter chips */
.src-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.src-filter {
  padding: 5px 14px; border-radius: var(--radius-full, 9999px);
  border: 1.5px solid var(--border); background: var(--card2);
  color: var(--text2); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.src-filter:hover { border-color: var(--border2); color: var(--text); }
.src-filter.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Results */
.src-results { display: flex; flex-direction: column; gap: 8px; }
.src-count { font-size: 12px; color: var(--text3); margin-bottom: 4px; font-weight: 600; }
.src-list { display: flex; flex-direction: column; gap: 8px; }

.src-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px;
  cursor: pointer; transition: var(--transition);
  box-shadow: var(--shadow-xs);
}
.src-card:hover { border-color: var(--border2); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.src-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid var(--border);
}
.src-avatar-init {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-glow); border: 2px solid var(--border2);
  color: var(--accent); font-size: 18px; font-weight: 800;
  user-select: none;
}

.src-info { flex: 1; min-width: 0; }
.src-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.src-headline { font-size: 12px; color: var(--text2); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.src-meta-item { font-size: 11px; color: var(--text3); }
.src-skills { display: flex; flex-wrap: wrap; gap: 4px; }
.src-skill {
  padding: 2px 8px; border-radius: 9999px;
  background: var(--card2); border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--text3);
}
.src-arrow { color: var(--text3); font-size: 16px; flex-shrink: 0; transition: var(--transition); }
.src-card:hover .src-arrow { color: var(--accent); transform: translateX(3px); }

/* Empty / loading */
.src-empty { text-align: center; padding: 48px 24px; }
.src-empty-icon { font-size: 36px; margin-bottom: 12px; }
.src-empty-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.src-empty-sub { font-size: 13px; color: var(--text3); }

.src-loading {
  display: flex; align-items: center; gap: 10px;
  justify-content: center; padding: 32px;
  color: var(--text3); font-size: 13px;
}
.src-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   EDIT PROFILE MODAL
   ═══════════════════════════════════════════════════════ */
.edit-prof-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(8px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 16px; overflow-y: auto;
  animation: fadeIn 0.18s ease;
}
.edit-prof-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 0;
  max-width: 600px; width: 100%;
  margin: auto;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.epm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.epm-title { font-size: 17px; font-weight: 800; color: var(--text); }
.epm-close {
  background: none; border: none; color: var(--text3);
  font-size: 20px; cursor: pointer; line-height: 1;
  padding: 4px; border-radius: var(--radius-sm);
  transition: var(--transition);
}
.epm-close:hover { background: var(--card2); color: var(--text); }

/* Tab nav */
.epm-tabs {
  display: flex; overflow-x: auto;
  border-bottom: 1px solid var(--border);
  padding: 0 24px; gap: 0;
}
.epm-tab {
  padding: 10px 16px; font-size: 13px; font-weight: 600;
  color: var(--text3); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  font-family: 'Inter', sans-serif; white-space: nowrap;
  transition: var(--transition); margin-bottom: -1px;
}
.epm-tab:hover { color: var(--text); }
.epm-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Tab panels */
.epm-body { padding: 20px 24px 24px; }
.epm-panel { display: none; }
.epm-panel.active { display: block; }

/* Form fields */
.epm-field { margin-bottom: 16px; }
.epm-label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--text2); margin-bottom: 6px; text-transform: uppercase;
  letter-spacing: 0.4px;
}
.epm-input, .epm-textarea, .epm-select {
  width: 100%; box-sizing: border-box;
  padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); background: var(--bg);
  color: var(--text); font-size: 14px; font-family: 'Inter', sans-serif;
  outline: none; transition: border-color 0.2s;
  -webkit-appearance: none;
}
.epm-input:focus, .epm-textarea:focus, .epm-select:focus { border-color: var(--accent); }
.epm-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.epm-hint { font-size: 11px; color: var(--text3); margin-top: 5px; }

/* Dynamic list (experience / education / portfolio) */
.epm-list-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.epm-list-item {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  position: relative;
}
.epm-list-item-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.epm-list-item-row3 { grid-template-columns: 1fr 1fr 1fr; }
.epm-remove-btn {
  position: absolute; top: 10px; right: 10px;
  background: none; border: none; color: var(--text3);
  font-size: 16px; cursor: pointer; line-height: 1; padding: 2px 6px;
  border-radius: var(--radius-sm); transition: var(--transition);
}
.epm-remove-btn:hover { background: rgba(239,68,68,0.08); color: #ef4444; }
.epm-add-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1.5px dashed var(--border);
  border-radius: var(--radius); background: none;
  color: var(--text3); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: var(--transition); width: 100%;
}
.epm-add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* Footer */
.epm-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.epm-cancel-btn {
  padding: 10px 20px; background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; font-weight: 600;
  color: var(--text2); cursor: pointer; font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.epm-cancel-btn:hover { background: var(--bg); color: var(--text); }
.epm-save-btn {
  padding: 10px 24px; background: var(--accent); border: none;
  border-radius: var(--radius); font-size: 14px; font-weight: 700;
  color: #fff; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.epm-save-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.epm-save-btn:disabled { opacity: 0.6; pointer-events: none; }

/* ── Own-profile view widget ─────────────────────────────────────── */
.prof-insights-widget {
  margin-top: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.prof-views-loading {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.prof-views-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.prof-views-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--fg);
  line-height: 1;
}
.prof-views-week { color: var(--accent); }
.prof-views-lbl {
  font-size: 12px;
  color: var(--muted);
}
.prof-insights-btn {
  width: 100%;
  margin-top: 10px;
  padding: 8px 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.prof-insights-btn:hover { opacity: .9; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .prof-layout { grid-template-columns: 1fr; }
  .prof-sidebar { position: static; }
  .prof-card { flex-direction: row; text-align: left; gap: 16px; align-items: flex-start; }
  .prof-avatar { margin-bottom: 0; }
  .prof-stats-row { justify-content: flex-start; }
  .prof-social-row { justify-content: flex-start; }
  .prof-meta-row { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .prof-layout { padding: 16px 16px 60px; gap: 14px; }
  .prof-card { flex-direction: column; align-items: center; text-align: center; }
  .epm-list-item-row { grid-template-columns: 1fr; }
  .epm-list-item-row3 { grid-template-columns: 1fr; }
  .src-page { padding: 16px 16px 60px; }
  .src-hero-title { font-size: 20px; }
}
