/* Inbox and chat */

.messages-header {
  padding: 16px 16px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: rgba(24, 27, 34, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(233, 237, 243, 0.08);
  flex-shrink: 0;
}
.msg-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(233, 237, 243, 0.06);
  border: 1px solid rgba(233, 237, 243, 0.08);
  color: #e9edf3;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.22s var(--spring-bounce), background-color 0.2s;
}
.msg-back-btn:hover {
  background-color: rgba(72, 118, 255, 0.16);
  transform: translateX(-2px);
}
.messages-title {
  font-size: 18px;
  font-weight: 700;
  color: #e9edf3;
  letter-spacing: -0.01em;
}

.conversations-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 80px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.conv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border-radius: 16px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.2s var(--smooth-ease), border-color 0.2s, transform 0.2s var(--spring-out);
  gap: 12px;
  animation: cardRiseIn 0.28s var(--spring-out) backwards;
}
.conv-row:hover {
  background-color: rgba(72, 118, 255, 0.09);
  border-color: rgba(72, 118, 255, 0.24);
  transform: translateX(2px);
}
.conv-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #272c35;
  border: 2px solid rgba(72, 118, 255, 0.24);
  color: #e9edf3;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.conv-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.conv-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.conv-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.conv-name {
  font-size: 15px;
  font-weight: 600;
  color: #e9edf3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-time {
  font-size: 12px;
  font-weight: 500;
  color: #969fac;
  flex-shrink: 0;
}
.conv-preview {
  font-size: 13.5px;
  color: #969fac;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-row.unread .conv-preview {
  color: #e9edf3;
  font-weight: 600;
}

.msg-compose-fab {
  position: absolute;
  bottom: 18px;
  right: 18px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4876ff 0%, #2f53bc 100%);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(72, 118, 255, 0.42);
  transition: transform 0.25s var(--spring-bounce), box-shadow 0.25s;
  z-index: 20;
}
.msg-compose-fab:hover {
  transform: translateY(-2px) scale(1.07);
  box-shadow: 0 12px 28px rgba(72, 118, 255, 0.55);
}

/* Chat thread */
.chat-thread-panel {
  position: absolute;
  inset: 0;
  background-color: #000000;
  z-index: 35;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(28px);
  transition:
    opacity 0.26s var(--spring-out),
    transform 0.3s var(--spring-out),
    visibility 0.26s;
}
.chat-thread-panel.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}
.chat-thread-panel .messages-header {
  background-color: #000000;
  border-bottom: none;
  padding: 14px 16px 8px;
  gap: 10px;
}
.chat-messages-box {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: #000000;
}
.chat-time-divider {
  align-self: center;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #8e8e98;
  margin: 14px 0 8px;
  letter-spacing: -0.01em;
}
/* Shared moment card */
.chat-moment-card {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 36px;
  overflow: hidden;
  position: relative;
  background-color: #141518;
  margin: 4px 0 6px;
  flex-shrink: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}
.chat-moment-card img,
.chat-moment-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chat-moment-owner-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px 6px 6px;
  border-radius: 999px;
  background: rgba(20, 20, 24, 0.58);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  z-index: 5;
}
.chat-moment-owner-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  background: #2c2d33;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
}
.chat-moment-owner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-moment-owner-name {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.chat-moment-owner-date {
  font-size: 13.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}
.chat-moment-caption-pill {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 88%;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(20, 20, 24, 0.68);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 5;
}

.chat-bubble-row {
  display: flex;
  max-width: 82%;
  animation: cardRiseIn 0.2s var(--spring-out) backwards;
}
.chat-bubble-row.me {
  align-self: flex-end;
  flex-direction: column;
  align-items: flex-end;
}
.chat-bubble-row.peer {
  align-self: flex-start;
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
}
.chat-peer-mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #26272b;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.chat-peer-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-bubble {
  padding: 10px 16px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.36;
  letter-spacing: -0.01em;
  word-break: break-word;
}
/* Outgoing messages */
.chat-bubble-row.me .chat-bubble {
  background: #f1f1f4;
  color: #09090b;
  font-weight: 700;
}
/* Incoming messages */
.chat-bubble-row.peer .chat-bubble {
  background-color: #26272b;
  color: #ffffff;
  font-weight: 700;
}
/* Message composer */
.chat-input-bar {
  padding: 8px 10px 14px;
  background-color: #000000;
  display: flex;
  align-items: center;
}
.chat-input-pill-wrap {
  width: 100%;
  height: 48px;
  border-radius: 999px;
  background-color: #222328;
  padding: 0 12px 0 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-text-input {
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  outline: none;
  min-width: 0;
}
.chat-text-input::placeholder {
  color: #8e8e98;
  font-weight: 700;
}
.chat-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #35363d;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s var(--spring-bounce), background-color 0.2s;
}
.chat-send-btn:hover {
  transform: scale(1.06);
  background: var(--bs-primary);
}
