/*
  Naija234 Personal Messages — Community Chat Visual Match v1
  Visual-only override. No messaging behavior is changed.
*/

/* Conversation panel uses the same warm chat canvas as Community Chat. */
.message-box{
  min-height:380px;
  max-height:540px;
  overflow-y:auto;
  background:#efeae2;
  border:1px solid #dfe5ea;
  border-radius:16px;
  padding:18px;
  scroll-behavior:smooth;
  font:inherit;
}

/* Match Community Chat row spacing and bubble proportions. */
.message-row{
  display:flex;
  gap:9px;
  margin:9px 0;
  align-items:flex-end;
}

.message-row.me{
  justify-content:flex-end;
}

.message-row.other{
  justify-content:flex-start;
}

.message-bubble{
  max-width:min(78%,620px);
  padding:9px 11px;
  background:#fff;
  color:#111;
  border:0;
  border-radius:12px 12px 12px 3px;
  box-shadow:0 1px 2px rgba(0,0,0,.12);
  position:relative;
  font:inherit;
}

.message-row.me .message-bubble{
  background:#d9fdd3;
  color:#111;
  border:0;
  border-radius:12px 12px 3px 12px;
}

.message-bubble p{
  margin:0;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:normal;
  line-height:1.4;
  font:inherit;
}

.message-bubble small{
  display:inline;
  opacity:1;
  font-size:11px;
  color:#667085;
}

/* Date/read receipt treatment equivalent to Community Chat metadata. */
.dm-message-meta{
  display:flex;
  justify-content:flex-end;
  gap:7px;
  align-items:center;
  margin-top:5px;
  font-size:11px;
  color:#667085;
}

.dm-message-meta small{
  margin:0;
  color:#667085;
  font-size:11px;
}

.dm-read-receipt{
  font-weight:700;
  white-space:nowrap;
  color:#0b8f3d!important;
}

/* Reactions: same pill shape, green hover/selected state and typography. */
.dm-reactions{
  display:flex;
  gap:4px;
  flex-wrap:wrap;
  margin-top:7px;
}

.dm-reaction-btn,
.message-row.other .dm-reaction-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  min-width:0;
  width:auto;
  height:auto;
  min-height:28px;
  padding:3px 7px;
  border:1px solid #d8dee5;
  background:rgba(255,255,255,.72);
  color:#111;
  border-radius:999px;
  cursor:pointer;
  font:inherit;
  font-size:16px;
  line-height:1;
  outline:none;
  box-shadow:none;
}

.message-row.me .dm-reaction-btn{
  background:rgba(255,255,255,.5);
}

.dm-reaction-btn:hover,
.message-row.other .dm-reaction-btn:hover,
.message-row.me .dm-reaction-btn:hover{
  border-color:#86efac;
  background:#f0fdf4;
}

.dm-reaction-btn.active,
.message-row.other .dm-reaction-btn.active,
.message-row.me .dm-reaction-btn.active{
  outline:none;
  border-color:#16a34a;
  background:#dcfce7;
  box-shadow:0 0 0 1px rgba(22,163,74,.08);
  color:#111;
}

.dm-reaction-count{
  margin-left:0;
  font-size:11px;
  font-weight:800;
  color:#475467;
}

/* Keep message actions visually quiet like Community Chat tools. */
.message-delete-btn,
.message-report-btn{
  margin-top:5px;
  padding:2px 5px;
  border:0;
  border-radius:6px;
  background:transparent;
  cursor:pointer;
  font:inherit;
  font-size:11px;
  font-weight:bold;
  box-shadow:none;
}

.message-delete-btn{
  color:#b42318;
}

.message-report-btn{
  margin-left:3px;
  color:#9a3412;
}

.message-delete-btn:hover{
  background:#fef2f2;
}

.message-report-btn:hover{
  background:#fff7ed;
}

/* Composer mirrors Community Chat. */
.compose{
  margin-top:0;
  padding:12px 0 0;
  background:#fff;
  font:inherit;
}

.dm-compose-row{
  display:grid;
  grid-template-columns:auto auto minmax(0,1fr) auto;
  gap:6px;
  align-items:end;
}

.dm-compose-row textarea{
  width:100%;
  min-height:48px;
  max-height:130px;
  resize:vertical;
  border:1px solid #d0d5dd;
  border-radius:14px;
  padding:12px;
  font:inherit;
  font-size:inherit;
  line-height:1.4;
  box-sizing:border-box;
  background:#fff;
  color:#111;
  margin:0;
}

.dm-compose-row textarea:focus{
  outline:none;
  border-color:#86efac;
  box-shadow:0 0 0 2px rgba(11,143,61,.08);
}

/* Emoji and attachment buttons match Community Chat compose tools. */
.dm-icon-button,
button.dm-icon-button{
  width:40px;
  height:40px;
  min-width:40px;
  min-height:40px;
  padding:0!important;
  border:1px solid #d0d5dd!important;
  border-radius:12px!important;
  background:#fff!important;
  color:#111!important;
  cursor:pointer;
  font:inherit;
  font-size:18px!important;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:none!important;
  align-self:end;
}

.dm-icon-button:hover,
button.dm-icon-button:hover{
  background:#f0fdf4!important;
  border-color:#86efac!important;
}

/* Send button matches Community Chat compact green send button. */
.dm-send-button,
button.dm-send-button{
  width:auto!important;
  min-width:68px;
  min-height:48px;
  height:48px;
  padding:0 14px!important;
  border:0;
  border-radius:14px!important;
  background:#0b8f3d;
  color:#fff;
  font:inherit;
  font-weight:800;
  cursor:pointer;
  align-self:end;
}

.dm-send-button:hover,
button.dm-send-button:hover{
  background:#087833;
}

/* Emoji picker mirrors Community Chat. */
.dm-emoji-picker{
  display:flex;
  gap:4px;
  flex-wrap:wrap;
  padding:8px 0;
  margin:0;
  border:0;
  border-radius:0;
  background:#fff;
}

.dm-emoji-picker[hidden]{
  display:none;
}

.dm-emoji-picker button{
  width:auto;
  height:auto;
  min-width:36px;
  border:1px solid #e4e7ec;
  background:#fff;
  color:#111;
  border-radius:9px;
  padding:6px 8px;
  font:inherit;
  font-size:18px;
  cursor:pointer;
}

.dm-emoji-picker button:hover{
  background:#f0fdf4;
  border-color:#86efac;
}

/* Attachment preview follows Community Chat's selected-attachment cards. */
.dm-attachment-preview{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:0 0 8px;
}

.dm-preview-item{
  display:flex;
  align-items:center;
  gap:7px;
  width:auto;
  max-width:280px;
  padding:6px 8px;
  border:1px solid #d9eadf;
  border-radius:10px;
  background:#f8fff9;
  font:inherit;
  font-size:12px;
}

.dm-preview-item img{
  width:42px;
  height:42px;
  border-radius:7px;
  object-fit:cover;
}

.dm-preview-info strong{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
}

.dm-preview-info span{
  display:block;
  color:#667085;
  font-size:11px;
}

.dm-preview-remove{
  border:0;
  background:transparent;
  color:#667085;
  padding:1px 4px;
  font:inherit;
  font-size:20px;
  cursor:pointer;
}

/* Sent attachment appearance follows Community Chat media treatment. */
.dm-message-attachments{
  display:grid;
  gap:7px;
  margin-top:7px;
  margin-bottom:4px;
}

.dm-message-image{
  display:block;
  max-width:100%;
  max-height:300px;
  border-radius:10px;
  object-fit:contain;
  background:#f8faf9;
}

.dm-message-video{
  display:block;
  width:min(100%,420px);
  max-height:300px;
  border-radius:10px;
  background:#111;
}

.dm-document-card,
.message-row.other .dm-document-card{
  display:flex;
  gap:7px;
  align-items:center;
  padding:7px 8px;
  margin-top:4px;
  border:1px solid #d9eadf;
  border-radius:10px;
  background:rgba(255,255,255,.58);
  color:#075e35;
  text-decoration:none;
  overflow-wrap:anywhere;
}

.dm-document-card small{
  color:#667085!important;
  font-size:11px!important;
}

/* Footer/status typography. */
.dm-compose-footer{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  margin-top:7px;
  color:#667085;
  font:inherit;
  font-size:12px;
  flex-wrap:wrap;
}

#messageUploadStatus{
  color:#667085;
  font-size:12px;
}

/* Conversation/profile chrome uses Community Chat greens. */
.profile-chip{
  background:#eefaf1;
  border:1px solid #d8f3df;
}

.thread-item.active{
  border-color:#0b8f3d;
  background:#eefaf1;
}

.thread-item:hover{
  background:#f0fdf4;
}

.thread-body h3,
.profile-chip strong{
  font-family:inherit;
}

@media(max-width:700px){
  .message-box{
    min-height:340px;
    max-height:460px;
    padding:12px;
  }

  .message-bubble{
    max-width:88%;
  }

  .dm-compose-row{
    grid-template-columns:auto auto minmax(0,1fr) auto;
    gap:5px;
  }

  .dm-icon-button,
  button.dm-icon-button{
    width:36px;
    min-width:36px;
    height:42px;
    min-height:42px;
    border-radius:11px!important;
    font-size:17px!important;
  }

  .dm-compose-row textarea{
    min-height:44px;
    padding:10px;
  }

  .dm-send-button,
  button.dm-send-button{
    min-width:58px;
    min-height:44px;
    height:44px;
    border-radius:11px!important;
    padding:0 10px!important;
  }

  .dm-reaction-btn,
  .message-row.other .dm-reaction-btn{
    padding:3px 6px;
    min-height:27px;
    font-size:15px;
  }

  .dm-message-image,
  .dm-message-video{
    max-height:230px;
  }
}
