/* ============================================
   SPHERE MESSENGER - Facebook-Style UI
   ============================================ */

/* ============================================
   NOTIFICATION BADGES
   ============================================ */

.nav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #e74c3c;
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  animation: badge-pop 0.3s ease;
}

.nav-badge.hidden {
  display: none;
}

@keyframes badge-pop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ============================================
   ONLINE STATUS INDICATORS (Facebook-style)
   ============================================ */

.online-indicator {
  width: 14px;
  height: 14px;
  background: #71717a;
  border: 2.5px solid var(--surface, #1a1a2e);
  border-radius: 50%;
  position: absolute;
  bottom: -2px;
  right: -2px;
  z-index: 2;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.online-indicator.online {
  background: #22c55e;
  animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.1); }
  50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0), 0 0 0 1px rgba(0, 0, 0, 0.1); }
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
  /* Allow indicator to overflow the avatar boundary */
  overflow: visible;
}

.online-dot {
  width: 12px;
  height: 12px;
  background: #22c55e;
  border: 2.5px solid var(--surface, #1a1a2e);
  border-radius: 50%;
  position: absolute;
  bottom: -2px;
  right: -2px;
  z-index: 2;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  animation: pulse-online 2s infinite;
}

/* ============================================
   TYPING INDICATOR
   ============================================ */

#typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

#typing-indicator.hidden {
  display: none;
}

.typing-dots {
  display: flex;
  gap: 3px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite both;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* ============================================
   ENHANCED MESSAGE BUBBLES
   ============================================ */

.message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 8px;
  max-width: 70%;
  position: relative;
  animation: message-slide-in 0.2s ease;
}

.message.sent {
  align-items: flex-end;
  margin-left: auto;
}

.message.fade-in {
  animation: message-fade-in 0.3s ease;
}

@keyframes message-slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes message-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.message-bubble {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  position: relative;
  word-wrap: break-word;
  max-width: 100%;
}

.message.sent .message-bubble {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  color: white;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 4px;
}

.message-text {
  line-height: 1.4;
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.message.sent .message-time {
  color: rgba(255,255,255,0.7);
}

.message-status {
  font-size: 0.7rem;
}

.message-status.seen {
  color: #3b82f6;
}

.message.sent .message-status.seen {
  color: rgba(255,255,255,0.9);
}

.message-media {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 4px;
}

/* ============================================
   MESSAGE REACTIONS
   ============================================ */

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.reaction-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.reaction-badge:hover {
  transform: scale(1.1);
}

.reaction-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 6px;
  display: flex;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 100;
  animation: picker-pop 0.2s ease;
}

@keyframes picker-pop {
  from { opacity: 0; transform: scale(0.8) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.reaction-btn {
  width: 36px;
  height: 36px;
  font-size: 1.25rem;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.reaction-btn:hover {
  transform: scale(1.2);
  background: var(--surface);
}

/* ============================================
   MESSAGE ACTIONS (Reply, React, More)
   ============================================ */

.message-actions {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: calc(100% + 8px);
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.message:hover .message-actions {
  display: flex;
  opacity: 1;
}

.message.sent .message-actions {
  right: auto;
  left: calc(100% + 8px);
}

.action-btn {
  width: 28px;
  height: 28px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.action-btn:hover {
  background: var(--surface);
  transform: scale(1.1);
}

/* ============================================
   REPLY PREVIEW
   ============================================ */

.message-reply-preview {
  padding: 6px 10px;
  background: rgba(99, 102, 241, 0.1);
  border-left: 3px solid #6366f1;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.message.sent .message-reply-preview {
  background: rgba(255,255,255,0.1);
  border-left-color: rgba(255,255,255,0.5);
}

.reply-to-name {
  font-weight: 600;
  color: #6366f1;
  display: block;
}

.message.sent .reply-to-name {
  color: rgba(255,255,255,0.9);
}

.reply-to-content {
  color: var(--text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message.sent .reply-to-content {
  color: rgba(255,255,255,0.7);
}

/* Reply input preview */
#reply-preview {
  padding: 8px 16px;
  background: var(--surface-elevated);
  border-top: 1px solid var(--border);
}

#reply-preview.hidden {
  display: none;
}

.reply-preview-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.cancel-reply {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 8px;
}

.cancel-reply:hover {
  color: var(--text-primary);
}

/* ============================================
   FORWARDED MESSAGE LABEL
   ============================================ */

.forwarded-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-style: italic;
}

/* ============================================
   EDITED LABEL
   ============================================ */

.edited-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================
   MESSAGE CONTEXT MENU
   ============================================ */

.message-context-menu {
  position: fixed;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 1000;
  min-width: 160px;
  animation: menu-pop 0.15s ease;
}

@keyframes menu-pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.message-context-menu button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}

.message-context-menu button:hover {
  background: var(--surface);
}

.message-context-menu button.danger {
  color: #ef4444;
}

.message-context-menu button.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   SEEN INDICATOR
   ============================================ */

#seen-indicator {
  padding: 4px 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

#seen-indicator.hidden {
  display: none;
}

/* ============================================
   ONLINE FRIENDS SIDEBAR
   ============================================ */

#online-friends {
  padding: 12px;
}

.online-friend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.online-friend:hover {
  background: var(--surface-elevated);
}

.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.friend-name {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.no-online {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 12px;
  text-align: center;
}

/* ============================================
   AVATAR SIZE VARIATIONS (Facebook-style indicators)
   ============================================ */

/* Default avatar inside wrapper */
.avatar-wrapper .avatar,
.avatar-wrapper img {
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

/* Small avatars (32px) - smaller indicator */
.avatar-wrapper .avatar-sm + .online-indicator,
.avatar-wrapper .avatar-sm + .online-dot {
  width: 10px;
  height: 10px;
  border-width: 2px;
  bottom: -1px;
  right: -1px;
}

/* Medium avatars (40-48px) - default size */
.avatar-wrapper .online-indicator,
.avatar-wrapper .online-dot {
  /* Inherits from base styles */
}

/* Large avatars (56px+) - larger indicator */
.avatar-wrapper[data-size="large"] .online-indicator,
.avatar-wrapper[data-size="large"] .online-dot {
  width: 16px;
  height: 16px;
  border-width: 3px;
  bottom: -2px;
  right: -2px;
}

/* ============================================
   CONVERSATION LIST ENHANCEMENTS
   ============================================ */

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.conversation-item:hover {
  background: var(--surface-elevated);
}

.conversation-item.active {
  background: var(--surface-elevated);
  border-left: 3px solid #6366f1;
}

.conversation-item.has-unread::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: #6366f1;
  border-radius: 50%;
}

.conversation-preview {
  color: var(--text-secondary);
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-item.has-unread .conversation-preview {
  font-weight: 600;
  color: var(--text-primary);
}

/* Conversation item avatar with Facebook-style online indicator */
.conversation-item .avatar-wrapper {
  flex-shrink: 0;
  /* Ensure indicator can overflow */
  overflow: visible;
}

.conversation-item .avatar-wrapper img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: block;
}

/* Larger indicator for 48px conversation avatars */
.conversation-item .online-indicator {
  width: 14px;
  height: 14px;
  border: 2.5px solid var(--surface, #1a1a2e);
  bottom: -2px;
  right: -2px;
}

/* Chat header avatar (40px) */
.message-header .avatar-wrapper img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: block;
}

.message-header .online-indicator {
  width: 12px;
  height: 12px;
  border: 2px solid var(--surface, #1a1a2e);
  bottom: -1px;
  right: -1px;
}

/* ============================================
   MESSAGE INPUT ENHANCEMENTS
   ============================================ */

.message-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.message-input-area input {
  flex: 1;
  padding: 10px 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.message-input-area input:focus {
  outline: none;
  border-color: #6366f1;
}

.message-input-area button {
  padding: 10px 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.message-input-area button:hover {
  transform: scale(1.05);
}

.message-input-area button:active {
  transform: scale(0.95);
}

/* ============================================
   CONNECTION STATUS INDICATOR
   ============================================ */

#connection-status {
  display: none; /* Hidden - debug element not for production */
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
}

#connection-status.disconnected {
  background: #ef4444;
  animation: pulse-disconnect 1s infinite;
}

@keyframes pulse-disconnect {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   CHAT HEADS (FLOATING BUBBLES)
   ============================================ */

.chat-heads-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  z-index: 999;
}

.chat-head {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--surface-elevated);
  border: 3px solid #6366f1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s;
  position: relative;
}

.chat-head:hover {
  transform: scale(1.1);
}

.chat-head img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-head .unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  background: #e74c3c;
  color: white;
  font-size: 11px;
  font-weight: bold;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   FACEBOOK-STYLE SIDEBAR LAYOUT
   ============================================ */

.fb-sidebar {
  width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 60px;
  overflow-y: auto;
}

.fb-sidebar-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.fb-sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.2s;
  cursor: pointer;
  position: relative;
}

.fb-sidebar-item:hover {
  background: var(--surface-elevated);
}

.fb-sidebar-item.active {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.fb-sidebar-item .icon {
  width: 36px;
  height: 36px;
  background: var(--surface-elevated);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.fb-sidebar-item.active .icon {
  background: #6366f1;
  color: white;
}

.fb-sidebar-item .label {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 500;
}

.fb-sidebar-item .badge {
  background: #e74c3c;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.fb-sidebar .see-more {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
}

.fb-sidebar .see-more:hover {
  background: var(--surface-elevated);
}

/* ============================================
   RIGHT SIDEBAR (CONTACTS)
   ============================================ */

.fb-contacts-sidebar {
  width: 280px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  height: calc(100vh - 60px);
  position: fixed;
  right: 0;
  top: 60px;
  overflow-y: auto;
  padding: 12px 0;
}

.contacts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
}

.contacts-header .actions {
  display: flex;
  gap: 8px;
}

.contacts-header .action-icon {
  width: 32px;
  height: 32px;
  background: var(--surface-elevated);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.contacts-header .action-icon:hover {
  background: var(--border);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.contact-item:hover {
  background: var(--surface-elevated);
}

/* Contact item avatar with online indicator */
.contact-item .avatar-wrapper {
  flex-shrink: 0;
}

.contact-item .avatar-wrapper img {
  width: 36px;
  height: 36px;
}

.contact-item .online-indicator {
  width: 12px;
  height: 12px;
  border-width: 2px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
  .fb-contacts-sidebar {
    display: none;
  }
}

@media (max-width: 900px) {
  .fb-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
    z-index: 1000;
  }

  .fb-sidebar.open {
    transform: translateX(0);
  }
}

/* ============================================
   DARK MODE ADJUSTMENTS
   ============================================ */

@media (prefers-color-scheme: dark) {
  .message-bubble {
    background: #2d2d3a;
  }

  .message.sent .message-bubble {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
  }
}

/* ============================================
   MESSENGER PAYMENTS (Facebook-style P2P)
   ============================================ */

.payment-btn {
  color: #10b981 !important;
}

.payment-btn:hover {
  background: rgba(16, 185, 129, 0.1) !important;
}

.payment-message {
  padding: 4px 0;
}

.payment-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 16px;
  padding: 16px;
  min-width: 200px;
  max-width: 260px;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.payment-card.request {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 4px 16px rgba(245, 87, 108, 0.4);
}

.payment-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  opacity: 0.9;
}

.payment-card-amount {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}

.payment-card-note {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 8px;
  line-height: 1.4;
}

.payment-card-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  background: rgba(255,255,255,0.2);
}

.payment-card-status.status-completed {
  background: rgba(34, 197, 94, 0.3);
}

.payment-card-status.status-pending {
  background: rgba(251, 191, 36, 0.3);
}

.payment-card-status.status-declined,
.payment-card-status.status-cancelled {
  background: rgba(239, 68, 68, 0.3);
}

.payment-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.payment-card-actions .btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.payment-card-actions .btn:hover {
  transform: translateY(-1px);
}

.payment-card-actions .btn:active {
  transform: translateY(0);
}

.payment-card-actions .btn-primary {
  background: white;
  color: #667eea;
}

.payment-card-actions .btn-secondary {
  background: rgba(255,255,255,0.2);
  color: white;
}

/* Payment Modal Styles */
.payment-modal-content {
  max-width: 380px;
}

.payment-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.payment-tab {
  flex: 1;
  padding: 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.payment-tab.active {
  color: var(--primary-color, #6366f1);
  border-bottom: 2px solid var(--primary-color, #6366f1);
}

.payment-tab-content {
  padding: 24px 20px;
}

.payment-tab-content.hidden {
  display: none;
}

.payment-amount-display {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.payment-amount-display .currency {
  font-size: 36px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}

.payment-amount-input {
  font-size: 56px;
  font-weight: 700;
  width: 160px;
  border: none;
  background: none;
  text-align: center;
  color: var(--text-primary);
}

.payment-amount-input:focus {
  outline: none;
}

.payment-amount-input::placeholder {
  color: var(--border);
}

.payment-presets {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.payment-presets button {
  padding: 10px 20px;
  border: 2px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  color: var(--text-primary);
}

.payment-presets button:hover {
  border-color: var(--primary-color, #6366f1);
  color: var(--primary-color, #6366f1);
  background: rgba(99, 102, 241, 0.05);
}

.payment-note {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 15px;
  background: var(--surface);
  color: var(--text-primary);
}

.payment-note:focus {
  outline: none;
  border-color: var(--primary-color, #6366f1);
}

.payment-submit {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.payment-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* PIN Modal Styles */
.pin-input-container {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.pin-input-container input {
  width: 56px;
  height: 64px;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.pin-input-container input:focus {
  outline: none;
  border-color: var(--primary-color, #6366f1);
}

/* ============================================
   MEDIA PREVIEW IN MESSAGE COMPOSER
   ============================================ */

#media-preview-container {
  padding: 12px 16px;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border);
}

#message-media-preview img,
#message-media-preview video {
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  object-fit: cover;
}

.media-preview-item {
  position: relative;
  display: inline-block;
}

/* ============================================
   MESSAGE SEARCH PANEL
   ============================================ */

#message-search-panel {
  animation: slide-down 0.2s ease;
}

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

#search-results-count {
  padding-left: 2px;
}

/* Highlight search matches */
.message[style*="background-color: rgba(250, 204, 21"] {
  border-radius: 4px;
  padding: 2px;
}

/* ============================================
   CONVERSATION LIST IMPROVEMENTS
   ============================================ */

.conversation-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.conversation-item:hover {
  background: var(--surface-elevated);
}

.conversation-item.active {
  background: var(--surface-elevated);
  border-left: 3px solid var(--primary-color, #6366f1);
}

.conversation-item.has-unread {
  font-weight: 600;
}

.conversation-item.has-unread::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: var(--primary-color, #6366f1);
  border-radius: 50%;
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */

@media (max-width: 768px) {
  .conversations-sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    height: calc(100vh - 60px);
    width: 100% !important;
    max-width: 100%;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 100;
    background: var(--bg-primary);
  }

  .conversations-sidebar.open {
    transform: translateX(0);
  }

  .mobile-conversations-toggle {
    display: block !important;
  }

  .message {
    max-width: 85%;
  }

  #message-media-preview img,
  #message-media-preview video {
    max-width: 150px;
    max-height: 100px;
  }
}
