/* ==========================================================================
   Project Team Chat & Channels Styles (Jira / Slack Collaboration Hybrid)
   ========================================================================== */

.chat-view-container {
  display: flex;
  height: calc(100vh - 110px);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Chat Sidebar (Channels & Team Members) */
.chat-sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.chat-sidebar-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.chat-section {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chat-channel-item:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.chat-channel-item.active {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  font-weight: 600;
}

.channel-hash {
  color: var(--text-muted);
  font-weight: 700;
}

.chat-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.presence-dot.online { background: #3fb950; }
.presence-dot.offline { background: var(--text-muted); opacity: 0.5; }

/* Main Chat Feed */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  overflow: hidden;
}

.chat-header {
  height: 54px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated);
}

.chat-channel-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-channel-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chat-channel-topic {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chat-messages-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: fadeIn 0.15s ease-in;
}

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

.chat-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.chat-msg-content {
  flex: 1;
  min-width: 0;
}

.chat-msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.chat-msg-author {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-msg-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chat-msg-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
}

/* Rich Jira Issue Chip in Chat */
.issue-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  background: var(--brand-primary-light);
  border: 1px solid var(--brand-primary-border);
  border-radius: var(--radius-sm);
  color: var(--brand-primary);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: none;
}

.issue-chip:hover {
  background: var(--brand-primary);
  color: #ffffff;
}

/* Chat Input Bar */
.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input-field {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}

.chat-input-field:focus {
  border-color: var(--border-focus);
}

.chat-quick-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-chip-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.chat-chip-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

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