
/* conv-conversation.css - formulaire futuriste "conversation" */
#conv-dialog-root {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 20, 0.78);
  z-index: 1200;
}

#conv-dialog-root.active {
  display: flex;
}

.conv-dialog {
  background: radial-gradient(circle at top left, #151b3a, #050816);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.75);
  width: min(900px, 96vw);
  height: min(640px, 90vh);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(120, 180, 255, 0.35);
  overflow: hidden;
}

.conv-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(120, 180, 255, 0.28);
  background: linear-gradient(90deg, rgba(29, 78, 216,0.26), transparent);
}

.conv-dialog-contact {
  display: flex;
  align-items: center;
  gap: 10px;
}

.conv-dialog-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #4ade80, #16a34a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: #020617;
  overflow: hidden;
}

.conv-dialog-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.conv-dialog-contact-meta {
  display: flex;
  flex-direction: column;
}

.conv-dialog-name {
  font-size: 15px;
  font-weight: 600;
  color: #e5f0ff;
}

.conv-dialog-sub {
  font-size: 11px;
  color: rgba(191, 219, 254, 0.88);
}

.conv-dialog-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.conv-btn-ghost {
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15,23,42,0.88);
  color: #e5f0ff;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.conv-btn-ghost:hover {
  background: rgba(30,64,175,0.7);
  border-color: rgba(129, 140, 248,0.9);
}

.conv-dialog-body {
  flex: 1;
  padding: 10px 12px 8px;
  overflow: hidden;
}

.conv-dialog-messages {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: radial-gradient(circle at top, rgba(15,23,42,0.9), rgba(15,23,42,0.96));
  border: 1px solid rgba(51, 65, 85, 0.95);
  padding: 10px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse; /* derniers messages en bas */
  gap: 8px;
}

/* bulles de messages */
.conv-msg {
  max-width: 78%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.conv-msg-inner {
  padding: 8px 11px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
  word-break: break-word;
}

.conv-msg-out {
  align-self: flex-end;
}
.conv-msg-out .conv-msg-inner {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #0b1120;
}
.conv-msg-in {
  align-self: flex-start;
}
.conv-msg-in .conv-msg-inner {
  background: rgba(15,23,42,0.96);
  border: 1px solid rgba(148,163,184,0.55);
  color: #e5e7eb;
}

.conv-msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: rgba(148, 163, 184, 0.9);
}
.conv-msg-meta-status {
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.7);
  color: rgba(191, 219, 254, 0.9);
}
.conv-msg-meta-time {
  opacity: 0.9;
}
.conv-msg-meta-stickers {
  display: inline-flex;
  gap: 3px;
  font-size: 11px;
}

/* pièces jointes */
.conv-msg-attachment {
  margin-top: 4px;
}
.conv-msg-attachment img {
  max-width: 220px;
  max-height: 180px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.4);
}
.conv-msg-attachment video,
.conv-msg-attachment audio {
  max-width: 240px;
  border-radius: 12px;
  outline: none;
}
.conv-msg-attachment-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15,23,42,0.96);
  border: 1px solid rgba(148,163,184,0.7);
  font-size: 11px;
  cursor: pointer;
}

/* footer */
.conv-dialog-footer {
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(30, 64, 175, 0.6);
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.conv-dialog-attach {
  display: flex;
  align-items: center;
}
.conv-dialog-file-input {
  display: none;
}
.conv-dialog-file-btn {
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.45);
  background: rgba(15,23,42,0.9);
  color: #e5f0ff;
  width: 34px;
  height: 34px;
  font-size: 16px;
  cursor: pointer;
}
.conv-dialog-file-btn:hover {
  background: rgba(37,99,235,0.85);
  border-color: rgba(129,140,248,0.9);
}

.conv-dialog-input {
  flex: 1;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.6);
  background: rgba(15,23,42,0.9);
  color: #e5e7eb;
  padding: 6px 10px;
  resize: none;
  font-size: 13px;
}
.conv-dialog-input:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.85);
  box-shadow: 0 0 0 1px rgba(59,130,246,0.7);
}

.conv-dialog-send {
  border-radius: 14px;
  padding: 7px 14px;
  border: none;
  background: linear-gradient(135deg, #22c55e, #3b82f6);
  color: #0b1120;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.conv-dialog-send:hover {
  filter: brightness(1.05);
}

/* mobile adaptations */
@media (max-width: 768px) {
  .conv-dialog {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}


/* === CONVERSATION HEADER STRUCTURE (INJECTED – DO NOT REMOVE) === */
.conversation-header-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.conversation-header-center {
  display: flex;
  justify-content: center;
}

.conversation-count {
  padding: 4px 12px;
  border-radius: 14px;
  background: rgba(0, 180, 255, 0.18);
  color: #00eaff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(0, 200, 255, 0.35);
}

.conversation-header {
  overflow: visible;
  z-index: 2;
}


/* === SIDEBAR PANELS CORE (PHASE 2) === */
.sidebar-panel {
  position: fixed;
  top: 0;
  left: 72px;
  width: calc(100% - 72px);
  height: 100vh;
  z-index: 200;
}
.sidebar-panel-active { display: block !important; }
