﻿/* ═══════════════════════════════════════════════════════════
   INFONOMENON PROFILES — fully self-contained stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS Variables (dark default, light override) ────────── */
:root {
  --bg:       #0d0d0d;
  --surface:  #161616;
  --surface2: #1e1e1e;
  --border:   rgba(255,255,255,0.08);
  --border2:  rgba(255,255,255,0.14);
  --red:      #d63031;
  --txt:      #f0eaea;
  --txt2:     #8a7f7f;
  --txt3:     #4e4545;
  --radius:   8px;
}

[data-theme="light"] {
  --bg:       #f5f5f5;
  --surface:  #ffffff;
  --surface2: #f0f0f0;
  --border:   rgba(0,0,0,0.08);
  --border2:  rgba(0,0,0,0.14);
  --red:      #d63031;
  --txt:      #1a1a1a;
  --txt2:     #5a5a5a;
  --txt3:     #999999;
}
/* ─── Nav ─────────────────────────────────────────────────── */
.pf-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.pf-nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  color: var(--txt);
  letter-spacing: -0.02em;
}

.pf-logo-red { color: var(--red); }

.pf-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pf-nav-handle {
  font-size: 13px;
  color: var(--txt2);
}

/* ─── Buttons ─────────────────────────────────────────────── */
.pf-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.pf-btn-primary:hover { opacity: 0.85; }
.pf-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.pf-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  background: transparent;
  color: var(--txt);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.pf-btn-secondary:hover { background: var(--surface2); border-color: var(--red); }

/* ─── Layout ──────────────────────────────────────────────── */
.pf-main {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* ─── Loading ─────────────────────────────────────────────── */
.pf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 100px 0;
  color: var(--txt2);
  font-size: 15px;
}

.pf-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: pf-spin 0.75s linear infinite;
}

@keyframes pf-spin { to { transform: rotate(360deg); } }

/* ─── Hero ────────────────────────────────────────────────── */
.pf-hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 24px;
}

.pf-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border2);
  background: var(--surface2);
}

.pf-hero-info { flex: 1; min-width: 0; }

.pf-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--txt);
  margin: 0 0 4px;
  line-height: 1.2;
}

.pf-handle { font-size: 14px; color: var(--txt2); margin-bottom: 10px; }

.pf-bio { font-size: 14px; color: var(--txt); line-height: 1.6; margin: 0 0 12px; }

.pf-bsky-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #1185fe;
  text-decoration: none;
}
.pf-bsky-link:hover { text-decoration: underline; }

/* ─── Sections ────────────────────────────────────────────── */
.pf-section { margin-bottom: 24px; }

.pf-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 0 0 12px;
}

/* Links */
.pf-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.pf-link-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--txt);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s, transform 0.1s;
  overflow: hidden;
}
.pf-link-card:hover { border-color: var(--red); transform: translateY(-1px); }
.pf-link-icon { font-size: 18px; flex-shrink: 0; }
.pf-link-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-link-arrow { color: var(--txt3); font-size: 12px; flex-shrink: 0; }

/* Chips */
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.pf-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--txt);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.pf-chip:hover { border-color: var(--red); color: var(--red); }

/* Recs */
.pf-recs { display: flex; flex-direction: column; gap: 10px; }

.pf-rec-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.pf-rec-emoji { font-size: 22px; flex-shrink: 0; line-height: 1.2; }
.pf-rec-body { flex: 1; min-width: 0; }
.pf-rec-title { font-size: 15px; font-weight: 600; color: var(--txt); margin-bottom: 4px; }
.pf-rec-note { font-size: 13px; color: var(--txt2); margin-bottom: 6px; line-height: 1.5; }
.pf-rec-link { font-size: 13px; color: var(--red); text-decoration: none; }
.pf-rec-link:hover { text-decoration: underline; }

/* Edit bar */
.pf-edit-bar { display: flex; justify-content: center; padding-top: 24px; }

/* ─── Empty / Setup ───────────────────────────────────────── */
.pf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 80px 20px;
  gap: 16px;
}
.pf-empty-icon { font-size: 56px; line-height: 1; }
.pf-empty h2 { font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 700; color: var(--txt); }
.pf-empty p { font-size: 15px; color: var(--txt2); max-width: 380px; line-height: 1.6; }

/* ─── Editor modal ────────────────────────────────────────── */
.pf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px 40px;
  overflow-y: auto;
  backdrop-filter: blur(4px);
}

.pf-modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  flex-shrink: 0;
}

.pf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.pf-modal-header h2 { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 700; color: var(--txt); }

.pf-modal-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--txt2);
  cursor: pointer;
  padding: 4px 10px;
  font-size: 14px;
  transition: border-color 0.15s, color 0.15s;
}
.pf-modal-close:hover { border-color: var(--red); color: var(--red); }

.pf-modal-body { padding: 24px; display: flex; flex-direction: column; gap: 20px; }

.pf-field { display: flex; flex-direction: column; gap: 8px; }
.pf-field label { font-size: 13px; font-weight: 600; color: var(--txt); }
.pf-hint { font-weight: 400; color: var(--txt3); }

.pf-field input[type="text"],
.pf-field input[type="url"],
.pf-field textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--txt);
  box-sizing: border-box;
  transition: border-color 0.15s;
  resize: vertical;
}
.pf-field input:focus, .pf-field textarea:focus { outline: none; border-color: var(--red); }

.pf-editor-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.pf-editor-row input { flex: 1; min-width: 80px; }
.pf-icon-input { flex: 0 0 52px !important; text-align: center; }

.pf-remove-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--txt3);
  cursor: pointer;
  padding: 6px 10px;
  font-size: 12px;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.pf-remove-btn:hover { border-color: #ef4444; color: #ef4444; }

.pf-add-btn {
  width: 100%;
  padding: 9px;
  background: none;
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
  color: var(--txt2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  margin-top: 4px;
  transition: border-color 0.15s, color 0.15s;
}
.pf-add-btn:hover { border-color: var(--red); color: var(--red); }

.pf-modal-actions { display: flex; gap: 10px; }
.pf-modal-actions .pf-btn-primary { flex: 1; padding: 12px; font-size: 15px; }

.pf-note { font-size: 12px; color: var(--txt3); line-height: 1.6; }
.pf-note code { background: var(--surface2); padding: 1px 5px; border-radius: 3px; font-size: 11px; }

.pf-status { font-size: 13px; text-align: center; min-height: 18px; }
.pf-status-ok  { color: #22c55e; }
.pf-status-err { color: #ef4444; }

/* ─── Search result card (injected into main app) ─────────── */
.info-profile-card {
  background: var(--surface, #161616);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-left: 3px solid var(--red, #d63031);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  animation: pf-fadein 0.3s ease;
}
.info-profile-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.info-profile-card-avatar {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; border: 2px solid var(--border, rgba(255,255,255,0.08));
  background: var(--surface2, #1e1e1e);
}
.info-profile-card-avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--red, #d63031); color: #fff; font-weight: 700; font-size: 18px;
}
.info-profile-card-meta { flex: 1; min-width: 0; }
.info-profile-card-name { font-size: 15px; font-weight: 700; color: var(--txt, #f0eaea); margin-bottom: 2px; }
.info-profile-card-handle { font-size: 12px; color: var(--txt2, #8a7f7f); margin-bottom: 4px; }
.info-profile-card-bio { font-size: 13px; color: var(--txt, #f0eaea); line-height: 1.5; }
.info-profile-card-view-btn {
  flex-shrink: 0; padding: 6px 13px; background: var(--red, #d63031); color: #fff;
  border-radius: 7px; font-size: 12px; font-weight: 600; text-decoration: none;
  white-space: nowrap; transition: opacity 0.15s;
}
.info-profile-card-view-btn:hover { opacity: 0.85; }
.info-profile-card-links, .info-profile-card-searches { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.info-profile-card-link, .info-profile-card-search {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  background: var(--surface2, #1e1e1e); border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 14px; font-size: 12px; color: var(--txt, #f0eaea); text-decoration: none;
  transition: border-color 0.15s;
}
.info-profile-card-link:hover, .info-profile-card-search:hover { border-color: var(--red, #d63031); color: var(--red, #d63031); }
.info-profile-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}
.info-profile-badge { font-size: 11px; font-weight: 600; color: var(--red, #d63031); letter-spacing: 0.04em; text-transform: uppercase; }
.info-profile-bsky-link { font-size: 12px; color: #1185fe; text-decoration: none; }
.info-profile-bsky-link:hover { text-decoration: underline; }

@keyframes pf-fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .pf-nav { padding: 0 16px; }
  .pf-hero { flex-direction: column; align-items: center; text-align: center; padding: 20px; }
  .pf-avatar { width: 72px; height: 72px; }
  .pf-name { font-size: 20px; }
  .pf-links-grid { grid-template-columns: 1fr; }
  .info-profile-card-header { flex-wrap: wrap; }
  .info-profile-card-view-btn { width: 100%; text-align: center; margin-top: 8px; }
  .pf-editor-row { flex-direction: column; align-items: stretch; }
  .pf-icon-input { flex: 0 0 auto !important; width: 100%; }
  .pf-modal-actions { flex-direction: column; }
}
