/* =====================================================
   ליכודלינק — SEARCH (find-a-friend) + PROFILE VIEW + 1:1 CHAT
   ===================================================== */

/* ── header search ── */
.search-wrap { position: relative; }
.search-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--fill); color: var(--navy-600); display: grid; place-items: center; cursor: pointer; }
.search-btn svg { width: 19px; height: 19px; }
.search-panel { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; width: 320px; background: var(--bg-elev); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--sh-3); padding: 12px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .15s ease, transform .15s ease; z-index: 60; }
.search-wrap.open .search-panel { opacity: 1; visibility: visible; transform: none; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--fill); border-radius: 30px; padding: 9px 13px; }
.search-box-ic { color: var(--faint); display: flex; }
.search-box-ic svg { width: 16px; height: 16px; }
.search-input { flex: 1; border: 0; background: none; outline: none; font-family: inherit; font-size: .92rem; color: var(--mist); }
.search-results { margin-top: 8px; max-height: 320px; overflow-y: auto; }
.sr-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: start; }
.sr-item:hover { background: var(--glass-hover); }
.sr-av { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--fill); color: var(--navy-600); font-weight: 800; display: grid; place-items: center; font-size: 1rem; }
.sr-name { font-weight: 700; color: var(--white); font-size: .92rem; }
.sr-empty { padding: 14px 8px; color: var(--faint); font-size: .86rem; text-align: center; }

/* ── header chat icon ── */
.chat-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--mist); display: grid; place-items: center; cursor: pointer; }
.chat-ic svg { width: 21px; height: 21px; }
.chat-badge { position: absolute; top: 2px; inset-inline-end: 2px; background: var(--like); color: #fff; font-size: .66rem; font-weight: 800; min-width: 16px; height: 16px; border-radius: 10px; display: grid; place-items: center; padding: 0 3px; }

/* ── public profile view modal (someone ELSE's profile) ── */
.upf { text-align: center; padding: 6px 4px; }
.upf-loading { color: var(--faint); padding: 30px 0; }
.upf-av { width: 78px; height: 78px; border-radius: 50%; margin: 0 auto 12px; background: var(--grad-brand); color: #fff; font-size: 2rem; font-weight: 800; display: grid; place-items: center; }
.upf-name { font-size: 1.25rem; font-weight: 800; color: var(--white); }
.upf-since { color: var(--faint); font-size: .84rem; margin-top: 4px; }
.upf-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ── chats list page ── */
.chats-list { display: flex; flex-direction: column; gap: 8px; }
.chat-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; text-align: start; box-shadow: var(--sh-1); }
.chat-row:hover { background: var(--glass-hover); }
.cr-av { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--fill); color: var(--navy-600); font-weight: 800; display: grid; place-items: center; }
.cr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cr-name { font-weight: 800; color: var(--white); font-size: .95rem; }
.cr-last { color: var(--faint); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-badge { flex: none; background: var(--navy-600); color: #fff; font-weight: 800; font-size: .74rem; min-width: 20px; height: 20px; border-radius: 12px; display: grid; place-items: center; padding: 0 5px; }

/* ── fullscreen chat window ── */
.chat-overlay { position: fixed; inset: 0; z-index: 900; background: rgba(10, 20, 45, .55); display: grid; place-items: center; }
.chat-shell { width: min(480px, 100vw); height: min(88vh, 760px); background: var(--bg); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--sh-3); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg-elev); border-bottom: 1px solid var(--line); }
.chat-back { display: none; background: none; border: 0; color: var(--mist); cursor: pointer; }
.chat-back svg { width: 20px; height: 20px; transform: scaleX(-1); }
.chat-head-av { width: 36px; height: 36px; border-radius: 50%; background: var(--fill); color: var(--navy-600); font-weight: 800; display: grid; place-items: center; }
.chat-head-name { flex: 1; font-weight: 800; color: var(--white); }
.chat-head-x { background: none; border: 0; color: var(--faint); cursor: pointer; padding: 5px; }
.chat-head-x svg { width: 19px; height: 19px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.cmsg { max-width: 76%; padding: 9px 13px; border-radius: 16px; font-size: .92rem; line-height: 1.45; word-break: break-word; }
.cmsg.theirs { align-self: flex-start; background: var(--bg-elev); color: var(--mist); border: 1px solid var(--line); border-bottom-start-radius: 4px; }
.cmsg.mine { align-self: flex-end; background: var(--grad-brand); color: #fff; border-bottom-end-radius: 4px; }
.chat-input-row { display: flex; gap: 8px; padding: 12px; background: var(--bg-elev); border-top: 1px solid var(--line); }
.chat-input { flex: 1; border: 1px solid var(--line-2); border-radius: 30px; padding: 10px 16px; font-family: inherit; font-size: .92rem; outline: none; background: var(--bg); color: var(--mist); }
.chat-send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--navy-600); color: #fff; display: grid; place-items: center; cursor: pointer; }
.chat-send svg { width: 18px; height: 18px; }

@media (max-width: 560px) {
  .chat-overlay { align-items: stretch; }
  .chat-shell { width: 100%; height: 100%; border-radius: 0; }
  .chat-back { display: inline-flex; }
  .search-panel { position: fixed; top: 62px; inset-inline: 10px; width: auto; }
}
