/*
 * social.css — view-social + view-profile.
 * Scoped to those two view blocks. Matches the Velvet-Aurora + view-auth
 * look (obsidian + gold) so the three feature surfaces feel like one
 * product.
 */

#view-social,
#view-profile {
  --sx-bg:        #070410;
  --sx-bg-2:      #120A1E;
  --sx-surface:   #1A0F2A;
  --sx-surface-2: #231538;
  --sx-text:      #F5EFE3;
  --sx-text-2:    #B8AECA;
  --sx-text-3:    #857698;
  --sx-gold:      #F0B65C;
  --sx-crimson:   #FF4477;
  --sx-mint:      #48E0A4;
  --sx-violet:    #8567FF;
  --sx-rule:      rgba(245, 239, 227, 0.08);
  --sx-rule-2:    rgba(245, 239, 227, 0.04);
  --sx-display:   'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sx-body:      'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  color: var(--sx-text);
  font-family: var(--sx-body);
  background:
    radial-gradient(ellipse at 20% 10%, rgba(133, 103, 255, 0.10), transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(240, 182, 92, 0.07), transparent 55%),
    var(--sx-bg);
  min-height: calc(100vh - 44px);
  padding: 28px 32px 60px;
  box-sizing: border-box;
  overflow-y: auto;
}

#view-social .sx-container,
#view-profile .sx-container {
  max-width: 960px;
  margin: 0 auto;
}

#view-social .sx-heading,
#view-profile .sx-heading {
  font-family: var(--sx-display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.1;
}
#view-social .sx-sub,
#view-profile .sx-sub {
  color: var(--sx-text-3);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 24px;
}

/* ── Hero row ──────────────────────────────────────────────────────────── */
#view-social .sx-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
#view-social .sx-hero-text { flex: 1; min-width: 260px; }
#view-social .sx-hero-text .sx-sub { margin-bottom: 0; }

/* ── Snapshot cards ────────────────────────────────────────────────────── */
#view-social .sx-snapshot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
#view-social .sx-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(180deg, var(--sx-surface) 0%, rgba(26, 15, 42, 0.65) 100%);
  border: 1px solid var(--sx-rule);
  border-radius: 14px;
  transition: border-color 160ms ease, transform 160ms ease;
}
#view-social .sx-stat:hover {
  border-color: rgba(240, 182, 92, 0.22);
  transform: translateY(-1px);
}
#view-social .sx-stat-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--sx-gold);
  background: rgba(240, 182, 92, 0.12);
}
#view-social .sx-stat-icon--pending { color: var(--sx-violet); background: rgba(133, 103, 255, 0.14); }
#view-social .sx-stat-icon--online  { color: var(--sx-mint);   background: rgba(72, 224, 164, 0.12); }
#view-social .sx-stat-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#view-social .sx-stat-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sx-text-3);
  font-weight: 600;
}
#view-social .sx-stat-value {
  font-family: var(--sx-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--sx-text);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Tabs ──────────────────────────────────────────────────────────────── */
#view-social .sx-tabs {
  display: flex;
  gap: 4px;
  background: var(--sx-bg-2);
  border: 1px solid var(--sx-rule);
  border-radius: 12px;
  padding: 4px;
  margin: 22px 0 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#view-social .sx-tabs::-webkit-scrollbar { display: none; }
#view-social .sx-tab {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 0;
  background: transparent;
  color: var(--sx-text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}
#view-social .sx-tab:hover { color: var(--sx-text); background: rgba(255,255,255,0.03); }
#view-social .sx-tab[aria-selected="true"] {
  background: var(--sx-surface-2);
  color: var(--sx-text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 0 0 1px rgba(240,182,92,0.12) inset;
}
#view-social .sx-tab .sx-badge {
  display: inline-block;
  background: var(--sx-gold);
  color: #1A0F02;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 14px;
  text-align: center;
  line-height: 1.4;
}

/* ── Search box ───────────────────────────────────────────────────────── */
#view-social .sx-search {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--sx-surface);
  border: 1px solid var(--sx-rule);
  border-radius: 12px;
  padding: 4px 14px;
  margin-bottom: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
#view-social .sx-search:focus-within {
  border-color: var(--sx-gold);
  box-shadow: 0 0 0 3px rgba(240, 182, 92, 0.15);
}
#view-social .sx-search-ic { color: var(--sx-text-3); display: inline-flex; }
#view-social .sx-search input {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 12px 4px;
  color: var(--sx-text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
#view-social .sx-search input::placeholder { color: var(--sx-text-3); }

/* ── Signed-out hero ──────────────────────────────────────────────────── */
#view-social .sx-signedout {
  max-width: 520px;
  margin: 80px auto 0;
  text-align: center;
  padding: 40px 28px;
  background: var(--sx-surface);
  border: 1px solid var(--sx-rule);
  border-radius: 18px;
}
#view-social .sx-signedout .sx-heading { font-size: 28px; margin-bottom: 8px; }
#view-social .sx-search-results {
  display: none;
  background: var(--sx-surface);
  border: 1px solid var(--sx-rule);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 14px;
}
#view-social .sx-search-results.is-open { display: block; }
#view-social .sx-search-results .sx-empty { padding: 18px 12px; color: var(--sx-text-3); font-size: 13px; }

#view-social .sx-pane { display: none; }
#view-social .sx-pane.is-active { display: block; }

#view-social .sx-section-title,
#view-profile .sx-section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sx-text-3);
  margin: 28px 0 12px;
}

/* User row — shared across friends / requests / blocked / search results */
#view-social .sx-row,
#view-profile .sx-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  background: var(--sx-surface);
  border: 1px solid var(--sx-rule);
  border-radius: 14px;
  margin-bottom: 10px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
#view-social .sx-row:hover,
#view-profile .sx-row:hover {
  border-color: rgba(240, 182, 92, 0.26);
  background: linear-gradient(180deg, var(--sx-surface) 0%, rgba(35, 21, 56, 0.65) 100%);
  transform: translateY(-1px);
}

#view-social .sx-avatar,
#view-profile .sx-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(240, 182, 92, 0.45), rgba(133, 103, 255, 0.55));
  display: grid;
  place-items: center;
  font-family: var(--sx-display);
  font-size: 18px;
  font-weight: 700;
  color: #1A0F02;
  text-transform: uppercase;
  box-shadow: 0 2px 10px -4px rgba(240, 182, 92, 0.4);
}

#view-social .sx-who,
#view-profile .sx-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
#view-social .sx-who strong,
#view-profile .sx-who strong {
  color: var(--sx-text);
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#view-social .sx-who span,
#view-profile .sx-who span {
  color: var(--sx-text-3);
  font-size: 12.5px;
  line-height: 1.5;
}
#view-social .sx-iq,
#view-profile .sx-iq {
  color: var(--sx-gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
}
#view-profile .sx-iq-display {
  font-family: var(--sx-display);
  font-size: 44px;
  font-weight: 600;
  color: var(--sx-gold);
  letter-spacing: -0.02em;
  line-height: 1;
}

#view-social .sx-provisional,
#view-profile .sx-provisional {
  font-size: 10px;
  color: var(--sx-text-3);
  border: 1px solid var(--sx-rule);
  border-radius: 999px;
  padding: 2px 7px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#view-social .sx-actions,
#view-profile .sx-actions {
  display: flex;
  gap: 6px;
}
#view-social .sx-btn,
#view-profile .sx-btn {
  background: transparent;
  border: 1px solid var(--sx-rule);
  color: var(--sx-text-2);
  border-radius: 9px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, transform 140ms ease;
  white-space: nowrap;
}
#view-social .sx-btn:hover,
#view-profile .sx-btn:hover {
  color: var(--sx-text);
  border-color: rgba(240, 182, 92, 0.32);
  background: rgba(240, 182, 92, 0.06);
}
#view-social .sx-btn.is-primary,
#view-profile .sx-btn.is-primary {
  background: linear-gradient(180deg, #F5C370 0%, var(--sx-gold) 100%);
  color: #1A0F02;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 14px -6px rgba(240, 182, 92, 0.55);
}
#view-social .sx-btn.is-primary:hover,
#view-profile .sx-btn.is-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
#view-social .sx-btn.is-primary:active,
#view-profile .sx-btn.is-primary:active { transform: translateY(0); }
#view-social .sx-btn.is-danger,
#view-profile .sx-btn.is-danger {
  color: var(--sx-crimson);
}
#view-social .sx-btn.is-danger:hover,
#view-profile .sx-btn.is-danger:hover {
  border-color: var(--sx-crimson);
  background: rgba(255, 68, 119, 0.08);
}
#view-social .sx-btn:disabled,
#view-profile .sx-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
#view-social .sx-btn-lg,
#view-profile .sx-btn-lg {
  padding: 12px 22px;
  font-size: 14px;
  border-radius: 12px;
}
#view-social .sx-btn-ic {
  font-weight: 400;
  opacity: 0.8;
  font-size: 1.05em;
  margin-right: 8px;
  line-height: 1;
}

#view-social .sx-empty-state,
#view-profile .sx-empty-state {
  padding: 56px 32px;
  text-align: center;
  color: var(--sx-text-3);
  font-size: 14px;
  line-height: 1.6;
  border: 1px dashed var(--sx-rule);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.015);
}

/* Profile-specific header card */
#view-profile .sx-profile-card {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 22px;
  align-items: center;
  background: var(--sx-surface);
  border: 1px solid var(--sx-rule);
  border-radius: 18px;
  padding: 28px 30px;
  margin-bottom: 22px;
}
#view-profile .sx-avatar.sx-avatar-xl {
  width: 96px;
  height: 96px;
  font-size: 34px;
  border-radius: 50%;
}
#view-profile .sx-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
#view-profile .sx-profile-meta h1 {
  font-family: var(--sx-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--sx-text);
}
#view-profile .sx-profile-meta .sx-handle { color: var(--sx-text-3); font-size: 13px; }
#view-profile .sx-profile-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

#view-profile .sx-loading {
  padding: 50px 0;
  text-align: center;
  color: var(--sx-text-3);
}

@media (max-width: 720px) {
  #view-social .sx-snapshot { grid-template-columns: 1fr; }
  #view-social .sx-hero { flex-direction: column; align-items: stretch; }
  #view-social .sx-hero .sx-btn-lg { align-self: flex-start; }
}
@media (max-width: 640px) {
  #view-social, #view-profile { padding: 22px 16px 40px; }
  #view-social .sx-row,
  #view-profile .sx-row { grid-template-columns: 44px 1fr; grid-template-areas: 'av who' 'av actions'; }
  #view-social .sx-actions,
  #view-profile .sx-actions { grid-area: actions; flex-wrap: wrap; }
  #view-profile .sx-profile-card { grid-template-columns: 72px 1fr; }
  #view-profile .sx-profile-right { grid-column: 1 / -1; align-items: flex-start; }
  #view-social .sx-heading { font-size: 28px; }
}
