/* messages.css — Combined messaging UI styles */

/* Inbox List */
.inbox-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.inbox-item {
  display: flex;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #ddd;
}
.inbox-avatar-link {
  flex: 0 0 auto;
  margin-right: 12px;
}
.inbox-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}
.inbox-details {
  flex: 1 1 auto;
}
.inbox-username {
  font-weight: bold;
  color: #004D40;
  text-decoration: none;
}
.inbox-username:hover {
  text-decoration: underline;
}
.inbox-snippet-link {
  display: block;
  margin-top: 4px;
  text-decoration: none;
  color: inherit;
}
.snippet {
  color: #333;
  font-size: 0.95em;
  margin-bottom: 2px;
}
.inbox-snippet-link time {
  font-size: 0.8em;
  color: #666;
}

/* Conversation Thread */
.thread {
  max-width: 600px;
  margin: 20px auto;
}
.message {
  display: flex;
  align-items: flex-start;
  padding: 8px 12px;
  margin: 6px 0;
  border-radius: 4px;
  word-wrap: break-word;
}
.incoming {
  background: #f1f1f1;
  text-align: left;
}
.outgoing {
  background: #d0f0d0;
  flex-direction: row-reverse;
  text-align: right;
}
.message-avatar-link {
  flex: 0 0 auto;
  margin: 0 12px;
}
.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.message-body {
  flex: 1;
}
.message p {
  margin: 0;
}
.message time {
  display: block;
  font-size: 0.75em;
  color: #666;
  margin-top: 4px;
}

/* Message Form */
.message-form {
  max-width: 600px;
  margin: 20px auto;
  display: flex;
  flex-direction: column;
}
.message-form textarea {
  resize: vertical;
  min-height: 80px;
  padding: 8px;
  margin-bottom: 8px;
}
.message-form button {
  align-self: flex-end;
  padding: 6px 12px;
  background: #00796B;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.message-form button:hover {
  background: #004D40;
}

/* Follow/Message Buttons */
.action-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.btn-message {
  display: inline-block;
  background: #004D40;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
}
.btn-message:hover {
  background: #00796B;
}

/* Sidebar avatars */
.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 8px;
}

/* Main column width & centering */
.messages-page main.container,
.inbox-page main.container{
  max-width: 900px !important;
  width: 100%;
  margin: 0 auto;
  flex: 1 1 auto;
}

/* List + thread cards */
.messages-page .thread, .inbox-page .thread,
.messages-page .message, .inbox-page .message{
  background: var(--container-bg, #fff);
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
}
.messages-page .thread-header,
.inbox-page .thread-header{ font-weight: 600; }

/* Optional: composer bar */
.messages-page .composer,
.inbox-page .composer{
  background: var(--container-bg, #fff);
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  margin-top: 12px;
}

/* Inbox / Messages — keep main column aligned with the site */
.messages-page main.container,
.inbox-page main.container{
  max-width: 900px !important;
  width: 100%;
  margin: 0 auto;
  flex: 1 1 auto; /* plays nice if .layout uses flex */
}

/* Fix “small box” inside the container:
   Ensure lists/cards stretch full width and don’t inherit tiny widths */
.messages-page .message-list,
.inbox-page .message-list,
.messages-page .thread-list,
.inbox-page .thread-list{
  width: 100%;
  display: block;         /* ensure block-level */
}

/* Message/Thread cards */
.messages-page .thread,
.inbox-page .thread,
.messages-page .message,
.inbox-page .message{
  background: var(--container-bg, #fff);
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
  width: 100%;
  box-sizing: border-box;
}

/* Headers/rows inside cards */
.messages-page .thread-header,
.inbox-page .thread-header{
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  font-weight: 600;
}

/* Composer bar */
.messages-page .composer,
.inbox-page .composer{
  background: var(--container-bg, #fff);
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  margin-top: 12px;
  width: 100%;
}

/* Make avatars sane */
.messages-page .avatar, .inbox-page .avatar{
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
}

/* Small screens */
@media (max-width: 600px){
  .messages-page .thread-header, .inbox-page .thread-header{ flex-wrap: wrap; }
}
