/* profile.css — v2 with avatars, mission progress, heatmap, badges, social */

.profile-layout { max-width: 800px; display: flex; flex-direction: column; gap: 28px; }
.profile-gate { text-align: center; padding: 60px 20px; max-width: 500px; margin: 0 auto; }
.profile-gate h2 { margin-bottom: 12px; }
.profile-gate p { color: var(--text-dim); margin-bottom: 24px; font-size: 14px; }

/* PROFILE CARD */
.profile-card { display: flex; align-items: flex-start; gap: 24px; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 28px; }
.profile-avatar-wrap { position: relative; flex-shrink: 0; width: 80px; height: 80px; }
.profile-avatar { width: 80px; height: 80px; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.profile-avatar svg { width: 100%; height: 100%; }
.profile-avatar-ring { position: absolute; inset: -4px; border-radius: 16px; border: 2px solid var(--border-subtle); background: conic-gradient(var(--terminal-green) calc(var(--progress) * 1%), transparent 0); z-index: -1; opacity: 0.4; }
.profile-level-pip { position: absolute; bottom: -6px; right: -6px; background: var(--bg-deep); border: 2px solid var(--terminal-green); color: var(--terminal-green); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; font-family: var(--font-mono); }
.profile-identity { flex: 1; min-width: 0; }
.profile-identity h2 { font-size: 22px; margin-bottom: 2px; }
.profile-level-name { font-size: 13px; color: var(--terminal-green); font-weight: 600; margin: 0 0 6px; font-family: var(--font-mono); }
.profile-name-row { display: flex; align-items: center; gap: 12px; }
.profile-edit-row { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.profile-edit-actions { display: flex; gap: 8px; }
.social-edit-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-sm { flex: 1; min-width: 120px; }
.profile-bio { color: var(--text-dim); font-size: 13px; margin: 6px 0; }
.profile-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.profile-social { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.social-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); font-size: 11px; color: var(--text-secondary); text-decoration: none; transition: border-color 0.2s; }
.social-pill:hover { border-color: var(--terminal-green-dim); color: var(--text-primary); }

/* STATS */
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 20px; text-align: center; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--terminal-green); font-family: var(--font-mono); }
.stat-label { font-size: 11px; color: var(--text-dim); margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }
.stat-bar { height: 4px; background: var(--bg-elevated); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.stat-bar-fill { height: 100%; background: var(--terminal-green); border-radius: 2px; transition: width 0.5s; }
.stat-sub { font-size: 10px; color: var(--text-dim); margin-top: 6px; }

/* MISSION PROGRESS */
.mission-progress-section { display: flex; flex-direction: column; gap: 16px; }
.mission-progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.mission-pip-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.mission-pip { position: relative; aspect-ratio: 1; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; transition: transform 0.2s; }
.mission-pip:hover { transform: scale(1.1); }
.pip-done { background: rgba(0,255,136,0.1); border: 1px solid rgba(0,255,136,0.3); color: var(--terminal-green); }
.pip-locked { background: var(--bg-elevated); border: 1px solid var(--border-subtle); color: var(--text-dim); }
.pip-num { font-family: var(--font-mono); }
.pip-check { position: absolute; top: -2px; right: -2px; font-size: 9px; background: var(--terminal-green); color: #000; width: 14px; height: 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* HEATMAP */
.heatmap-wrap { overflow-x: auto; padding: 4px 0; -webkit-overflow-scrolling: touch; }
.heatmap-legend { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--text-dim); }
.hl-box { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: #0f8; }

/* BADGES */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.badge-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 8px; text-align: center; transition: transform 0.2s; }
.badge-card:hover { transform: translateY(-2px); }
.badge-earned { background: rgba(0,255,136,0.05); border: 1px solid rgba(0,255,136,0.15); }
.badge-locked { background: var(--bg-elevated); border: 1px solid var(--border-subtle); opacity: 0.4; }
.badge-icon { font-size: 24px; }
.badge-name { font-size: 10px; color: var(--text-secondary); font-weight: 600; }
.badge-day { font-size: 9px; color: var(--text-dim); }
.badge-bonus { font-size: 9px; color: var(--terminal-green); }

/* SECTIONS */
.profile-section { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 24px; }
.profile-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.profile-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.profile-section-header h3 { margin-bottom: 0; }
.profile-empty { color: var(--text-dim); font-size: 13px; padding: 20px 0; }
.profile-empty a { color: var(--terminal-green); }

/* JOURNALS */
.profile-journals { display: flex; flex-direction: column; gap: 8px; }
.profile-journal-card { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-elevated); border-radius: 6px; transition: background 0.2s; }
.profile-journal-card:hover { background: var(--bg-card); }
.profile-journal-status { font-size: 10px; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; font-weight: 600; flex-shrink: 0; }
.status-approved { background: var(--terminal-green-glow); color: var(--terminal-green); }
.status-pending { background: rgba(255,200,50,0.1); color: #ffc832; }
.status-rejected { background: rgba(255,80,80,0.1); color: #ff5050; }
.status-flagged { background: rgba(255,150,50,0.1); color: #ff9632; }
.profile-journal-title { flex: 1; font-size: 13px; color: var(--text-primary); }
.profile-journal-date { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }

/* QUICK LINKS */
.profile-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.profile-link-card { display: flex; align-items: center; gap: 10px; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 16px 20px; font-size: 13px; color: var(--text-secondary); transition: border-color 0.3s, transform 0.2s; text-decoration: none; }
.profile-link-card:hover { border-color: var(--terminal-green-dim); transform: translateX(3px); }
.profile-link-card span { font-size: 18px; }

/* JOIN PAGE */
.join-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: 900px; align-items: start; }
.join-benefits { display: flex; flex-direction: column; gap: 20px; }
.join-benefits h3 { font-size: 18px; margin-bottom: 4px; }
.join-benefit { display: flex; gap: 16px; align-items: flex-start; }
.join-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.join-benefit strong { font-size: 14px; display: block; margin-bottom: 4px; }
.join-benefit p { font-size: 12px; color: var(--text-dim); margin: 0; line-height: 1.5; }
.join-auth { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 28px; position: sticky; top: 80px; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .profile-links { grid-template-columns: 1fr; }
  .profile-card { flex-direction: column; align-items: center; text-align: center; }
  .profile-meta { justify-content: center; }
  .profile-name-row { justify-content: center; }
  .profile-social { justify-content: center; }
  .join-layout { grid-template-columns: 1fr; }
  .join-auth { position: static; }
  .badge-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .mission-pip-grid { grid-template-columns: repeat(7, 1fr); gap: 4px; }
}
@media (max-width: 480px) {
  .profile-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 14px 10px; }
  .stat-value { font-size: 22px; }
  .badge-grid { grid-template-columns: repeat(4, 1fr); }
}
