/* ═══════════════════════════════════════════════════════════════════
   CHAT BUBBLE STYLES - Messages styling with left/right positioning
   ═══════════════════════════════════════════════════════════════════ */

.msg-row {
  display: flex;
  margin-bottom: 0.75rem;
  align-items: flex-end;
  gap: 0.5rem;
  animation: fadeInUp 0.25s ease-out;
}

.msg-row.own {
  justify-content: flex-end;
}

.msg-row.peer {
  justify-content: flex-start;
}

.msg-bubble {
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  word-break: break-word;
  line-height: 1.4;
  font-size: 0.95rem;
}

.msg-row.own .msg-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 0.2rem;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.msg-row.peer .msg-bubble {
  background: var(--surface);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-bottom-left-radius: 0.2rem;
}

/* Message receipts (✓ / ✓✓) */
.msg-receipt {
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 16px;
  text-align: center;
  transition: all 0.2s ease;
}

.msg-receipt.sent-receipt {
  color: rgba(255, 255, 255, 0.6);
  opacity: 0.7;
}

.msg-receipt.read-receipt {
  color: rgba(255, 255, 255, 1);
  font-weight: 800;
}

/* ═══════════════════════════════════════════════════════════════════
   CONVERSATION LIST
   ═══════════════════════════════════════════════════════════════════ */

/* Loading dots */
.conv-loading {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 2.5rem;
}
.conv-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-foreground);
  animation: dotBounce 1.2s infinite ease-in-out;
}
.conv-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.conv-loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Empty state */
.conv-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.5rem;
  text-align: center;
}
.conv-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}
.conv-empty-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--foreground);
}
.conv-empty-hint {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* Conversation item */
.conv-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  margin-bottom: 0.5rem;
}
.conv-item:active {
  transform: scale(0.98);
}
.conv-item:hover {
  background: rgba(102, 126, 234, 0.04);
  border-color: rgba(102, 126, 234, 0.3);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.conv-item.has-unread {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.07) 0%, rgba(118, 75, 162, 0.07) 100%);
  border: 1.5px solid rgba(102, 126, 234, 0.4);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
}
.conv-item.urgent {
  border-color: rgba(255, 107, 107, 0.5);
}
.conv-item.expired {
  opacity: 0.5;
}
.conv-item.is-match {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.07) 0%, rgba(255, 75, 110, 0.07) 100%);
  border-color: rgba(255, 107, 157, 0.4);
}

/* Avatar */
.conv-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.conv-item.is-match .conv-avatar {
  background: linear-gradient(135deg, #ff6b9d, #ff4b6e);
  font-size: 1.2rem;
}

/* Body */
.conv-body {
  flex: 1;
  min-width: 0;
}
.conv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  gap: 0.5rem;
}
.conv-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.match-tag {
  font-size: 0.72rem;
  background: linear-gradient(135deg, #ff6b9d, #ff4b6e);
  color: white;
  border-radius: 99px;
  padding: 0.1rem 0.4rem;
  font-weight: 700;
}
.conv-timer-pill {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  background: var(--muted);
  color: var(--muted-foreground);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 600;
}
.conv-timer-pill.critical {
  background: rgba(255, 107, 107, 0.15);
  color: #ff6b6b;
  animation: blink 1s infinite;
}
.conv-timer-pill.expired {
  background: rgba(0,0,0,0.06);
  color: var(--muted-foreground);
  opacity: 0.7;
}
.conv-preview {
  font-size: 0.82rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.has-unread .conv-preview {
  color: var(--foreground);
  font-weight: 600;
}

/* Chevron */
.conv-chevron {
  font-size: 1.3rem;
  color: var(--muted-foreground);
  opacity: 0.5;
  flex-shrink: 0;
}

/* Unread badge */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  background: #667eea;
  color: white;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  animation: scaleIn 0.3s ease-out;
}
@keyframes scaleIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes blink {
  0%, 49%, 100% { opacity: 1; }
  50%, 99% { opacity: 0.6; }
}

.read-receipt { color: #667eea; font-weight: 800; font-size: 0.8rem; }
.sent-receipt { color: var(--muted-foreground); font-size: 0.8rem; }

/* ═══════════════════════════════════════════════════════════════════
   MATCH BANNER
   ═══════════════════════════════════════════════════════════════════ */
.match-banner {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease;
}
.match-banner-inner {
  background: white;
  border-radius: 1.5rem;
  padding: 2rem 1.5rem;
  text-align: center;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(255, 75, 110, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.match-banner-emoji {
  font-size: 3.5rem;
  animation: heartBeat 0.8s ease infinite alternate;
}
@keyframes heartBeat {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}
.match-banner-title {
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ff6b9d, #ff4b6e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.match-banner-sub {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   THREAD CONTAINER
   ═══════════════════════════════════════════════════════════════════ */

#thread-msgs {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}

.msg-placeholder {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}