/* === Chat Tab Layout === */
.chatContainer {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* === Channel Tabs === */
.channelTabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--hull-grey);
  padding-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.channelTabs::-webkit-scrollbar {
  display: none;
}

.channelTab {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--chrome-silver);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 1rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.channelTab:hover {
  color: var(--plasma-cyan);
}

.channelTabActive {
  color: var(--plasma-cyan);
  border-bottom-color: var(--plasma-cyan);
}

.channelTabFaction {
  /* faction tabs use orange */
}

.channelTabFaction.channelTabActive {
  color: var(--shell-orange);
  border-bottom-color: var(--shell-orange);
}

/* === Sub-tabs (Private / Local) === */
.subTabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem 0;
}

.subTab {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--chrome-silver);
  background: transparent;
  border: 1px solid var(--hull-grey);
  border-radius: 3px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.2s ease;
}

.subTab:hover {
  color: var(--plasma-cyan);
  border-color: rgba(0, 212, 255, 0.3);
}

.subTabActive {
  color: var(--plasma-cyan);
  border-color: var(--plasma-cyan);
  background: rgba(0, 212, 255, 0.08);
}

/* === Message List === */
.messageList {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--hull-grey) transparent;
}

.messageList::-webkit-scrollbar {
  width: 6px;
}

.messageList::-webkit-scrollbar-track {
  background: transparent;
}

.messageList::-webkit-scrollbar-thumb {
  background: var(--hull-grey);
  border-radius: 3px;
}

/* === Message Item === */
.message {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.message:hover {
  background: rgba(255, 255, 255, 0.02);
}

.messageSender {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--plasma-cyan);
  min-width: 100px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.messageContent {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--chrome-silver);
  flex: 1;
  word-break: break-word;
  line-height: 1.5;
}

.messageTime {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(var(--chrome-silver-rgb, 180, 193, 220), 0.5);
  white-space: nowrap;
  flex-shrink: 0;
}

/* === DM Layout === */
.dmLayout {
  display: flex;
  gap: 1px;
  background: var(--hull-grey);
  border: 1px solid var(--hull-grey);
  border-radius: 4px;
  overflow: hidden;
  height: 400px;
}

.dmSidebar {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--deep-void);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--hull-grey) transparent;
}

.dmContact {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.65rem 0.5rem 1.1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hull-grey);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s ease;
}

.dmContact:hover {
  background: rgba(0, 212, 255, 0.04);
}

.dmContactActive {
  background: rgba(0, 212, 255, 0.08);
}

.dmContactChannel {
  padding: 0.6rem 0.65rem 0.6rem 1.1rem;
}

.dmContactChannelName {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--plasma-cyan);
}

.dmContactChannelRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dmContactCount {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--chrome-silver);
  opacity: 0.5;
}

.dmSeparator {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--chrome-silver);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.65rem;
  border-bottom: 1px solid var(--hull-grey);
}

.dmContactName {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--plasma-cyan);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dmContactPreview {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--chrome-silver);
  opacity: 0.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dmMessages {
  flex: 1;
  background: var(--deep-void);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* === Load More === */
.loadMore {
  display: flex;
  justify-content: center;
  padding: 0.5rem;
}

.loadMoreBtn {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--plasma-cyan);
  background: transparent;
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 4px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.2s ease;
}

.loadMoreBtn:hover {
  border-color: var(--plasma-cyan);
  background: rgba(0, 212, 255, 0.05);
}

.loadMoreBtn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* === Footer === */
.chatFooter {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: rgba(var(--chrome-silver-rgb, 180, 193, 220), 0.4);
  text-align: center;
  padding: 0.75rem 0;
  border-top: 1px solid var(--hull-grey);
}

/* === Badge for message counts === */
.badge {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--void-black);
  background: var(--plasma-cyan);
  padding: 0.1rem 0.35rem;
  border-radius: 8px;
  margin-left: 0.4rem;
}

/* === Empty State === */
.emptyChat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: rgba(var(--chrome-silver-rgb, 180, 193, 220), 0.4);
}

.emptyChat svg {
  opacity: 0.3;
}

.emptyChat p {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

/* === Loading spinner (inline) === */
.inlineSpinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--chrome-silver);
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--hull-grey);
  border-top-color: var(--plasma-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* === Responsive === */
@media (max-width: 640px) {
  .messageSender {
    min-width: 70px;
    max-width: 90px;
    font-size: 0.65rem;
  }

  .messageContent {
    font-size: 0.7rem;
  }

  .messageTime {
    display: none;
  }
}
