/* app/assets/css/messenger.css — user picker UI v2 (dropdown nad polem, min 3 znaki) */
.btnMessenger { position: relative; }

.msgBadge{
  margin-left:8px; padding:2px 6px; border-radius:12px;
  background:#c62828; color:#fff; font-size:12px; line-height:18px;
  display:none;
}
.msgBadge.isOn{ display:inline-block; }

/* CSP-safe helpers */
.isHidden{ display:none !important; }
.isVisible{ display:block !important; }

.messengerPanel{
  position: fixed; right: 16px; bottom: 16px;
  width: 920px; height: 560px; background: #111; color:#eee;
  border: 1px solid rgba(255,255,255,.15); border-radius: 12px;
  overflow: hidden; z-index: 9999;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}

.mpHead{ display:flex; justify-content:space-between; align-items:center; padding:10px 12px; background:#161616; }
.mpTitle{ font-weight:600; }
.mpClose{ background: transparent; color:#eee; border:0; font-size:18px; cursor:pointer; }

.mpBody{ display:flex; height: calc(100% - 44px); }

.mpThreads{ width: 340px; border-right:1px solid rgba(255,255,255,.1); display:flex; flex-direction:column; }
.mpThreadsHead{ padding:10px; border-bottom:1px solid rgba(255,255,255,.06); }
.mpThreadsTitle{ font-weight:600; margin-bottom:8px; }

.mpThreadsList{ overflow:auto; height: 360px; }

.mpHint{ padding:10px; opacity:.7; font-size:12px; line-height:1.35; }

.mpThread{ padding:10px; cursor:pointer; border-bottom:1px solid rgba(255,255,255,.06); }
.mpThread:hover{ background: rgba(255,255,255,.05); }
.mpThread.isUnread{ background: rgba(255,255,255,.06); }
.mpThreadName{ font-weight:600; }
.mpThreadMeta{ display:flex; justify-content:space-between; gap:10px; margin-top:6px; }
.mpThreadLast{ opacity:.75; font-size:12px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; max-width:240px; }

.mpThreadUnread{
  margin-left:8px; padding:2px 6px; border-radius:10px;
  background:#2e7d32; font-size:12px;
  display:none;
}
.mpThreadUnread.isOn{ display:inline-block; }

.mpChat{ flex:1; display:flex; flex-direction:column; }
.mpChatHead{ padding:10px 12px; border-bottom:1px solid rgba(255,255,255,.1); display:flex; justify-content:space-between; align-items:center; min-height:44px; }
.mpChatWith{ opacity:.9; }
.mpCloseThread{ padding:6px 10px; border-radius:10px; border:1px solid rgba(255,255,255,.12); background:#1a1a1a; color:#eee; cursor:pointer; }

.mpChatMsgs{ flex:1; overflow:auto; padding:12px; }
.mpMsg{ max-width: 70%; margin: 6px 0; padding:8px 10px; border-radius:10px; background:#222; }
.mpMsg.mine{ margin-left:auto; background:#1f2a3a; }
.mpMsgBody{ white-space:pre-wrap; word-break:break-word; }
.mpMsgAt{ opacity:.55; font-size:11px; margin-top:4px; }

.mpChatSend{ display:flex; gap:8px; padding:10px; border-top:1px solid rgba(255,255,255,.1); }
.mpMsgInput{ flex:1; resize:none; padding:8px 10px; border-radius:10px; border:1px solid rgba(255,255,255,.12); background:#141414; color:#eee; }
.mpSend{ padding:8px 14px; border-radius:10px; border:1px solid rgba(255,255,255,.12); background:#1a1a1a; color:#eee; cursor:pointer; }

/* User picker: nad listą rozmów, dropdown NAD polem */
.mpUserPickerTop{ display:flex; gap:8px; margin-bottom:10px; }
.mpStart{ padding:8px 10px; border-radius:10px; border:1px solid rgba(255,255,255,.12); background:#1a1a1a; color:#eee; cursor:pointer; }

.mpUserPicker{ position:relative; flex:1; }
.mpUserSearch{
  width:100%;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.12);
  background:#141414;
  color:#eee;
  box-sizing:border-box;
}

.mpUserDropdown{
  position:absolute;
  left:0; right:0;
  bottom: 42px; /* nad inputem */
  max-height: 220px;
  overflow:auto;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.12);
  background:#121212;
  box-shadow: 0 10px 24px rgba(0,0,0,.45);
  z-index: 10000;
}

.mpUserItem{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  cursor:pointer;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.mpUserItem:hover{ background: rgba(255,255,255,.06); }
.mpUserEmpty{ cursor:default; opacity:.7; }
.mpUserName{ font-weight:600; }
.mpUserIdTag{ opacity:.65; font-size:12px; }

@media (max-width: 980px){
  .messengerPanel{ width: calc(100% - 20px); height: 70vh; right:10px; bottom:10px; }
  .mpThreads{ width: 46%; }
}
