/* ============================================
   Inbox/Messages Page Styling
   ============================================ */

/* ============================================
   Message Display
   ============================================ */

.messagebody {
  padding: 1rem;
  background-color: #161616;
  border-radius: 6px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  border: 1px solid #333;
}

.messagebody-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.messagebody h1,
.messagebody h2,
.messagebody h3,
.messagebody h4,
.messagebody h5,
.messagebody h6 {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.message-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.message-actions a {
  padding: 0.5rem 1rem;
  background-color: var(--accent);
  color: #000;
  border-radius: 50px;
  transition: var(--transition);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 0.85rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  white-space: nowrap;
  text-decoration: none;
}

.message-actions a:hover {
  background-color: var(--accent-hover);
  text-decoration: none;
  transform: translateY(-2px);
}

.message-actions a.btn.danger {
  background-color: var(--danger);
  color: #fff;
}

.message-actions a.btn.danger:hover {
  background-color: var(--danger-hover);
}

/* ============================================
   Inbox List
   ============================================ */

.inbox,
.peers {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.inbox-item,
.peer,
.message {
  display: flex;
  padding: 1rem;
  background-color: var(--card-bg);
  border-bottom: 1px solid #333;
  border-radius: 8px;
  transition: var(--transition);
  cursor: pointer;
}

.inbox-item:first-child,
.peer:first-child,
.message:first-child {
  border-top: 1px solid #333;
}

.inbox-item:hover,
.peer:hover,
.message:hover {
  background-color: #252525;
  border-left: 3px solid var(--accent);
  padding-left: calc(1rem - 3px);
}

.inbox-item a,
.peer a,
.message a {
  display: block;
  color: inherit;
  text-decoration: none;
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.inbox-item a:hover,
.peer a:hover,
.message a:hover {
  text-decoration: none;
}

.inbox-item h2,
.peer h2,
.message h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--accent);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.inbox-item p,
.peer p,
.message p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.unread {
  font-weight: 600;
  color: var(--text-bright);
  background-color: rgba(var(--accent-r), var(--accent-g), var(--accent-b), 0.15);
  border-left: 3px solid var(--accent);
  padding-left: calc(1rem - 3px);
}

/* ============================================
   Search & Filter
   ============================================ */

.search-box {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: var(--card-bg);
  border: 1px solid #333;
  border-radius: 6px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.search-box input {
  width: 100%;
  margin: 0;
  background-color: #0a0a0a;
}

/* ============================================
   Pagination
   ============================================ */

.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  gap: 0.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

.pagination .page-item {
  display: inline-block;
}

.pagination .page-link {
  display: block;
  padding: 0.5rem 0.75rem;
  background-color: var(--card-bg);
  border: 1px solid #333;
  color: var(--text-main);
  transition: var(--transition);
  border-radius: 4px;
  font-weight: 400;
}

.pagination .page-link:hover {
  background-color: var(--accent);
  color: #000;
  text-decoration: none;
  border-color: var(--accent);
}

.pagination .page-item.active .page-link {
  background-color: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.pagination .page-item.disabled .page-link {
  opacity: 0.4;
  cursor: not-allowed;
}
