/* DM conversation styles */
.messages-conversation-page {
  max-width: 720px;
  margin: 0 auto;
}

.messages-thread {
  margin: 1rem 0 1.5rem;
}

.message-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message-item {
  display: flex;
}

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

.message-item.from-them {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 80%;
  padding: 0.5rem 0.75rem;
  border-radius: 1rem;
  background: #222;
  border: 1px solid #333;
}

.message-item.from-me .message-bubble {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.message-author {
  font-weight: 600;
  font-size: 0.85rem;
}

.message-body {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message-compose textarea {
  width: 100%;
  resize: vertical;
}

/* Conversation list */
.messages-page .conversation-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.conversation-item a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #333;
  text-decoration: none;
}

.conversation-item.has-unread a {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

.conversation-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.conversation-username {
  font-weight: 600;
}

.badge-unread {
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid #2563eb;
}

/* Notifications */
.notifications-page {
  max-width: 720px;
  margin: 0 auto;
}

.notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.notification-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notification-item {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #333;
}

.notification-item.is-unread {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.07);
}

.notification-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}

.notification-from {
  font-weight: 600;
}

/* Tiny text helper */
.tiny {
  font-size: 0.7rem;
}

/* Header layout + icons + search bar */
.site-header {
  border-bottom: 1px solid #2d3145;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.25rem;
  padding: 0.5rem 1.25rem;
}


.header-left {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.header-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.header-nav a {
  font-size: 0.9rem;
  text-decoration: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}


.header-icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Icon buttons */
.header-icon-wrapper {
  position: relative;
}

.header-icon-button {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.25rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-icon-button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.icon-shape {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: #020617;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}


.icon-bell::before {
  content: "\1F514"; /* bell emoji */
}

.icon-mail::before {
  content: "\2709"; /* envelope emoji */
}

.icon-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Popover panels */
.header-popover {
  min-height: 160px;
  position: absolute;
  top: 120%;
  right: 0;
  width: 520px;
  max-width: 98vw;
  max-height: 85vh;
  background: #111827;
  border-radius: 0.75rem;
  border: 1px solid #374151;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  padding: 0.9rem 0.9rem 0.75rem;
  display: none;
  z-index: 40;
}

.header-popover.is-open {
  display: block;
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.popover-header span {
  font-weight: 600;
}

.popover-header-link {
  font-size: 0.8rem;
  text-decoration: none;
}

.popover-body {
  max-height: 72vh;
  overflow-y: auto;
  font-size: 0.95rem;
}

/* Popover list items for header dropdowns */
.popover-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.popover-item a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.popover-item-main {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.popover-avatar .avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #4b5563;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.popover-item-text {
  flex: 1;
  min-width: 0;
}

.popover-item-title {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.popover-item-preview {
  margin-top: 0.1rem;
}

.popover-item-meta {
  margin-top: 0.1rem;
}

.popover-footer {
  margin-top: 0.45rem;
  text-align: center;
}

.popover-footer-link {
  font-size: 0.8rem;
  text-decoration: none;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: #2563eb;
  color: #fff;
}
/* User pill tweak so avatar + name look nicer next to icons */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #4b5563;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.header-search-row {
  padding: 0 1.25rem 0.9rem;
}

.header-search-form {
  width: 280px;
  max-width: 320px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: #020617;
  border-radius: 999px;
  border: 1px solid #374151;
  padding: 0.35rem 0.6rem;
}


.header-search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 0.9rem;
  padding: 0.25rem 0.4rem;
}

.header-search-input:focus {
  outline: none;
}

.header-search-button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.15rem 0.4rem;
}

/* Small screens: stack nav under logo */
@media (max-width: 720px) {
  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .header-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .header-right {
    align-self: stretch;
    justify-content: space-between;
  }
}
