@import url("ROOT.css");
/* --------------------------------------------------------------- */
/* ----------------- MODULE DE CHAT MULTI-CANAL ------------------ */
/* --------------------------------------------------------------- */

.chat-module {
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 400px; /* Tu peux ajuster la hauteur selon tes besoins */
  overflow: hidden;
}

/* --- Onglets / Canaux --- */
.chat-channels {
  display: flex;
  background-color: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

/* Cache la scrollbar des onglets */
.chat-channels::-webkit-scrollbar { display: none; }

.channel-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 15px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.channel-btn:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.channel-btn.active {
  color: #60A5FA; /* Bleu vif */
  border-bottom: 2px solid #3B82F6; /* Ligne sous l'onglet actif */
  background-color: var(--surface);
}

/* --- Zone des messages --- */
.chat-messages {
  flex: 1; /* Prend tout l'espace restant */
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Scrollbar personnalisée pour le chat */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 10px;
}

/* --- Un Message --- */
.chat-message {
  font-size: 0.85rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-time {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-right: 5px;
}

.chat-author {
  color: var(--text-main);
  font-weight: bold;
  margin-right: 5px;
}

.chat-text {
  color: #D1D5DB; /* Gris clair */
}

/* Variante de message : Dispatch / Urgence */
.message-dispatch {
  background-color: rgba(239, 68, 68, 0.1); /* Fond légèrement rouge */
  border-left: 3px solid var(--danger);
  padding: 5px 8px;
  border-radius: 4px;
}
.message-dispatch .chat-author {
  color: var(--danger);
}

/* --- Zone de saisie --- */
.chat-input-area {
  display: flex;
  padding: 10px;
  background-color: var(--bg-dark);
  border-top: 1px solid var(--border);
  gap: 10px;
}

.chat-input {
  flex: 1;
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: #3B82F6; /* Focus bleu */
}

.chat-send-btn {
  background-color: #3B82F6;
  color: white;
  border: none;
  border-radius: var(--radius);
  width: 35px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.chat-send-btn:hover {
  background-color: #2563EB;
}
