/* Message Item - Updated for cleaner design */
.message-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  margin: 0 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.message-item:hover {
  background: #f9fafb;
  transform: translateX(2px);
}

.message-item:last-child {
  border-bottom: none;
}

.message-item.unread {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.message-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 40%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 0 4px 4px 0;
}

.message-item-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.message-item:hover .message-item-avatar {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.message-item.unread .message-item-avatar {
  border-color: #667eea;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.3);
}

.message-item-info {
  flex: 1;
  min-width: 0;
}

.message-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.message-item-name {
  font-weight: 600;
  font-size: 15px;
  color: #1f2937;
  margin: 0;
  transition: color 0.2s ease;
}

.message-item:hover .message-item-name {
  color: #667eea;
}

.message-item.unread .message-item-name {
  font-weight: 700;
  color: #667eea;
}

.message-item-time {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

.message-item.unread .message-item-time {
  color: #667eea;
  font-weight: 600;
}

.message-item-preview {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-item-text {
  font-size: 14px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  line-height: 1.4;
}

.message-item.unread .message-item-text {
  font-weight: 600;
  color: #374151;
}

.message-item-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
  border: 2px solid #ffffff;
}

/* Friend Item - Updated */
.friend-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  margin: 0 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.friend-item:hover {
  background: #f9fafb;
  transform: translateX(2px);
}

.friend-item:last-child {
  border-bottom: none;
}

.friend-item-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s ease;
}

.friend-item:hover .friend-item-avatar {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.friend-item-info {
  flex: 1;
  min-width: 0;
}

.friend-item-name {
  font-weight: 600;
  font-size: 15px;
  color: #1f2937;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.friend-item:hover .friend-item-name {
  color: #667eea;
}

.friend-item-username {
  font-size: 13px;
  color: #9ca3af;
  margin: 0;
}

.friend-item-status {
  font-size: 12px;
  color: #9ca3af;
  margin: 0;
  font-weight: 500;
}

.friend-item-status.online {
  color: #10b981;
  font-weight: 600;
}

.friend-item-status.online::before {
  content: '●';
  margin-right: 4px;
}

/* Friend status for new layout */
.friend-status {
  font-size: 12px;
  color: #999;
  margin: 0;
}

.friend-status.online {
  color: #42b72a;
  font-weight: 500;
}

.friend-status.online::before {
  content: '●';
  margin-right: 4px;
  font-size: 10px;
}

/* Friend avatar wrapper with online indicator */
.friend-avatar-wrapper {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.friend-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #667eea;
}

.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: #42b72a;
  border: 2px solid white;
  border-radius: 50%;
}

/* Friend info section */
.friend-info {
  flex: 1;
  min-width: 0;
}

.friend-name {
  font-weight: 700;
  font-size: 15px;
  color: #333;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.friend-item-actions {
  display: flex;
  gap: 8px;
}

.btn-friend-action {
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-message-friend {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-message-friend:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-unfriend {
  background: #f0f0f0;
  color: #666;
}

.btn-unfriend:hover {
  background: #fee;
  color: #dc2626;
}

/* Group Item - Updated */
.group-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  margin: 0 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.group-item:hover {
  background: #f9fafb;
  transform: translateX(2px);
}

.group-item:last-child {
  border-bottom: none;
}

.group-item-avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
  transition: all 0.2s ease;
}

.group-item:hover .group-item-avatar {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.group-item-info {
  flex: 1;
  min-width: 0;
}

.group-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.group-item-name {
  font-weight: 600;
  font-size: 15px;
  color: #1f2937;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.group-item:hover .group-item-name {
  color: #667eea;
}

.group-item-members {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

.group-item-preview {
  font-size: 14px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.group-item-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
  border: 2px solid #ffffff;
}

/* Empty State - Updated */
.empty-state {
  padding: 60px 24px;
  text-align: center;
  color: #6b7280;
}

.empty-state-icon {
  margin-bottom: 24px;
  opacity: 0.15;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #667eea;
}

.empty-state-icon svg {
  stroke: #667eea;
  stroke-width: 1.2;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 10px 0;
  letter-spacing: -0.3px;
}

.empty-state p {
  font-size: 15px;
  color: #6b7280;
  margin: 0 0 24px 0;
  line-height: 1.6;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state-action {
  margin-top: 20px;
}

.btn-empty-action {
  padding: 12px 24px;
  background: linear-gradient(135deg, #7b82a200 0%, #764ba200 100%);
  color: #6a1c5a;
  border: none;
  border-radius: 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-empty-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgb(11 255 11 / 0%);
}

/* Loading State */
.loading-state {
  padding: 40px 20px;
  text-align: center;
  color: #667eea;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f0f0f0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 14px;
  font-weight: 600;
}
