/* group-chat.css — /group-chat page overrides */
/* Shared styles in 2-components/chat-base.css */

/* ─── Loading state ─── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(198, 255, 0, 0.2);
  border-top-color: #C6FF00;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  margin-top: 16px;
  color: var(--text-white-muted, #6B7B8D);
  font-size: 14px;
}

/* ─── Error state ─── */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.error-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-white, #253C56);
  margin-bottom: 8px;
}

.error-message {
  color: var(--text-white-muted, #6B7B8D);
  font-size: 14px;
  margin-bottom: 20px;
}

.error-btn {
  padding: 12px 24px;
  background: #C6FF00;
  color: #0B1622;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

/* ─── Connection status badge ─── */
.connection-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
}

.connection-status.connected {
  background: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
}

.connection-status.disconnected {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

.connection-status.connecting {
  background: rgba(255, 193, 7, 0.2);
  color: #FFC107;
}

/* ─── Participants button (header) ─── */
.participants-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.participants-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ─── Participants modal ─── */
.participants-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.participants-modal.active {
  display: flex;
}

.participants-content {
  background: var(--bg-card, #FFFFFF);
  border-radius: 16px;
  padding: 20px;
  width: 90%;
  max-width: 320px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.participants-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.participants-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-white, #253C56);
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-white, #253C56);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

.participant-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

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

.participant-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C6FF00, #9be600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #0B1622;
  font-size: 16px;
  overflow: hidden;
}

.participant-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.participant-name {
  font-weight: 500;
  color: var(--text-white, #253C56);
}

.participant-you {
  font-size: 12px;
  color: var(--lime-primary, #C6FF00);
}

/* ─── @ Mention Autocomplete Popup ─── */
.mention-popup {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 4px;
  background: var(--bg-card, #FFFFFF);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 210;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.mention-popup.active {
  display: block;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--text-white, #253C56);
  font-size: 14px;
}

.mention-item:first-child { border-radius: 12px 12px 0 0; }
.mention-item:last-child { border-radius: 0 0 12px 12px; }
.mention-item:only-child { border-radius: 12px; }

.mention-item:hover,
.mention-item.selected {
  background: rgba(198, 255, 0, 0.15);
}

.mention-item .mi-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy-dark, #253C56);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.mention-item .mi-name { flex: 1; }

.mention-item .mi-tag {
  font-size: 11px;
  color: var(--text-white-muted, #6B7B8D);
}

/* ─── Load earlier messages button ─── */
.chat-load-earlier {
  align-self: center;
  padding: 8px 20px;
  background: var(--bg-card, #FFFFFF);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 20px;
  color: var(--navy-dark, #253C56);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.chat-load-earlier:hover {
  background: var(--lime-primary, #C6FF00);
  border-color: var(--lime-primary, #C6FF00);
}