/* ══════════════════════════════════════════════════════════════════════════
   live-chat.css — console agent du clavardage (section « Messagerie »).

   Cette feuille N'INTRODUIT AUCUNE nouvelle couleur : elle consomme les jetons
   de design Layhosting déclarés dans :root de index.html (--accent, --surface,
   --text2, --glow, …), ce qui lui fait automatiquement suivre le thème clair /
   sombre et la marque violette, comme les autres panneaux du tableau de bord.
   ══════════════════════════════════════════════════════════════════════════ */

.lc-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.lc-column { min-width: 0; }

/* ── Barre d'état agent ──────────────────────────────────────────────────── */
.lc-presence { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 16px; }
.lc-presence-label { font-size: 12px; color: var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-right: auto; }
.lc-segmented { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; }
.lc-segmented button { border: 0; background: none; color: var(--text2); font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.lc-segmented button.active { background: var(--brand-gradient); color: #fff; }
.lc-segmented .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .8; }
.lc-socket-state { font-size: 11.5px; color: var(--text3); display: inline-flex; align-items: center; gap: 6px; }
.lc-socket-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-red); }
.lc-socket-state.connected i { background: var(--accent3); }

/* ── Onglets ─────────────────────────────────────────────────────────────── */
.lc-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.lc-tab { border: 1px solid var(--border); background: var(--surface); color: var(--text2); border-radius: 999px; padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.lc-tab.active { background: var(--glow); color: var(--accent); border-color: transparent; }
.lc-tab .count { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }

/* ── Liste des conversations ─────────────────────────────────────────────── */
.lc-inbox { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; max-height: 620px; display: flex; flex-direction: column; }
.lc-filters { display: flex; gap: 6px; padding: 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.lc-filter { border: 1px solid var(--border); background: var(--surface2); color: var(--text2); border-radius: 8px; font-size: 11.5px; padding: 6px 10px; cursor: pointer; }
.lc-filter.active { background: var(--glow); color: var(--accent); border-color: transparent; font-weight: 600; }
.lc-threads { overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.lc-thread { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.lc-thread:hover { background: var(--card-hover-bg); }
.lc-thread.active { background: var(--glow); }
.lc-avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.lc-thread-body { flex: 1 1 auto; min-width: 0; }
.lc-thread-top { display: flex; align-items: baseline; gap: 8px; }
.lc-thread-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-thread-time { margin-left: auto; font-size: 11px; color: var(--text3); white-space: nowrap; }
.lc-thread-last { font-size: 12px; color: var(--text2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-badges { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.lc-empty { padding: 26px 16px; text-align: center; color: var(--text3); font-size: 12.5px; }

/* ── Fil / thread ────────────────────────────────────────────────────────── */
.lc-room { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; display: flex; flex-direction: column; min-height: 620px; }
.lc-room-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.lc-room-title { font: 600 15px/1.3 'Poppins', sans-serif; color: var(--text); }
.lc-room-sub { font-size: 11.5px; color: var(--text2); margin-top: 2px; }
.lc-room-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.lc-thread-log { flex: 1 1 auto; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface2); }
.lc-bubble { max-width: 74%; padding: 10px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.lc-line { display: flex; }
.lc-line.agent { justify-content: flex-end; }
.lc-line.agent .lc-bubble { background: var(--brand-gradient); color: #fff; border-bottom-right-radius: 6px; }
.lc-line.visitor .lc-bubble { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 6px; }
.lc-line.system { justify-content: center; }
.lc-line.system .lc-bubble { background: transparent; color: var(--text3); font-size: 11.5px; font-style: italic; }
.lc-bubble-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; font-size: 10.5px; opacity: .75; }
.lc-ticks.read { color: #4fc3f7; }
.lc-line.agent .lc-ticks { color: rgba(255, 255, 255, .85); }
.lc-bubble img { display: block; max-width: 240px; width: 100%; border-radius: 10px; margin-top: 6px; }
.lc-typing-row { padding: 6px 16px; font-size: 12px; color: var(--text2); min-height: 24px; }
.lc-composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.lc-composer textarea { flex: 1 1 auto; min-height: 42px; max-height: 140px; resize: vertical; border: 1px solid var(--border); border-radius: 12px; background: var(--surface2); color: var(--text); padding: 10px 12px; font-size: 13.5px; font-family: inherit; }
.lc-composer textarea:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.lc-composer .btn { flex: 0 0 auto; }
.lc-room-placeholder { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px; color: var(--text3); font-size: 13px; }

/* ── Moniteur de visiteurs ───────────────────────────────────────────────── */
.lc-visitors { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.lc-visitors .data-table td { vertical-align: middle; }
.lc-visitor-device { font-size: 11.5px; color: var(--text2); margin-top: 2px; }
.lc-live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent3); margin-right: 6px; animation: lc-pulse 1.8s infinite; }
@keyframes lc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Surcharges responsives ──────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .lc-layout { grid-template-columns: minmax(0, 1fr); }
  .lc-inbox { max-height: 320px; }
  .lc-room { min-height: 480px; }
}
@media (max-width: 640px) {
  .lc-room-actions { margin-left: 0; width: 100%; }
  .lc-bubble { max-width: 90%; }
}
