/* KeyExchange Anonymous Encrypted Forum ("The Exchange") Styles */

.exchange-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 640px;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  backdrop-filter: blur(16px);
  margin-top: 20px;
}

@media (max-width: 850px) {
  .exchange-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  .exchange-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

/* Chat Sidebar (Rooms & Sovereign Identity) */
.exchange-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.identity-card {
  background: #05070d;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 20px;
}

.identity-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.burner-alias {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  word-break: break-all;
}

.roll-alias-btn {
  background: none;
  border: none;
  color: var(--accent-gold);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 4px;
}

.rooms-list-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.room-item {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.room-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.room-item.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-indigo);
}

.room-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.room-item-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.crypto-status-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
  background: rgba(16, 185, 129, 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Chat Main Pane */
.exchange-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-card);
}

.chat-header {
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.current-room-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text-main);
}

.verify-encryption-btn {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.verify-encryption-btn:hover {
  background: rgba(56, 189, 248, 0.2);
}

/* Message Stream */
.chat-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-bubble {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  position: relative;
  font-size: 0.95rem;
  line-height: 1.6;
}

.message-bubble.incoming {
  align-self: flex-start;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 2px;
}

.message-bubble.outgoing {
  align-self: flex-end;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid var(--accent-indigo);
  border-bottom-right-radius: 2px;
}

.message-author {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--accent-gold);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.message-time {
  font-weight: normal;
  color: var(--text-dim);
  font-size: 0.7rem;
}

.cipher-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent-emerald);
  margin-top: 8px;
  cursor: pointer;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
}

/* Input Bar */
.chat-input-area {
  padding: 18px 24px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
}

.chat-input {
  flex: 1;
  background: #05070d;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

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

.chat-send-btn {
  background: var(--accent-cyan);
  color: #07090e;
  border: none;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.chat-send-btn:hover {
  background: #7dd3fc;
}
