/* ── Bloco Conversas — modal body ─────────────────────────────── */

.fbloco-conversas-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Linha informativa */
.fbloco-conversas-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #fef2f2;
  border-radius: 8px;
  font-size: 13px;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Botão Treine o Agente */
.fbloco-conversas-btn-treinar {
  width: 100%;
  padding: 10px 16px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.fbloco-conversas-btn-treinar:hover {
  background: #dc2626;
}

/* Grade 3×3 de tipos de conteúdo */
.fbloco-conversas-grade {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.fbloco-conversas-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  user-select: none;
}

.fbloco-conversas-cell:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.fbloco-conversas-cell:active {
  background: #fee2e2;
}

/* Destaque quando o tipo já está nos itens */
.fbloco-conversas-cell--ativo {
  background: #fef2f2;
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
}

.fbloco-conversas-cell--ativo .fbloco-conversas-cell-label {
  color: #b91c1c;
  font-weight: 600;
}

.fbloco-conversas-cell-ico {
  font-size: 22px;
  line-height: 1;
}

.fbloco-conversas-cell-label {
  font-size: 11px;
  color: #374151;
  text-align: center;
  line-height: 1.2;
}

/* Lista de itens adicionados */
.fbloco-conversas-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fbloco-conversas-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.fbloco-conversas-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #f3f4f6;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}

.fbloco-conversas-item-remover {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  transition: color .12s;
}

.fbloco-conversas-item-remover:hover {
  color: #ef4444;
}

.fbloco-conversas-item-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: none;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  background: #fff;
  color: #111827;
}

.fbloco-conversas-item-input:focus {
  background: #fafafa;
}

/* ── Upload de mídia ────────────────────────────────────────────── */

.fbloco-conversas-upload {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
}

.fbloco-conversas-upload-btn {
  align-self: flex-start;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.fbloco-conversas-upload-btn:hover:not(:disabled) {
  background: #e5e7eb;
  border-color: #9ca3af;
}
.fbloco-conversas-upload-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fbloco-conversas-upload-status {
  font-size: 12px;
  color: #6b7280;
  min-height: 16px;
}
.fbloco-conversas-upload-enviando { color: #2563eb; font-style: italic; }
.fbloco-conversas-upload-ok       { color: #059669; }
.fbloco-conversas-upload-erro     { color: #dc2626; }

/* Link "ou colar URL" */
.fbloco-conversas-url-toggle {
  align-self: flex-start;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}
.fbloco-conversas-url-toggle:hover { color: #6b7280; }

.fbloco-conversas-url-wrap {
  /* exibido/ocultado via JS */
}

/* Dark mode para upload */
@media (prefers-color-scheme: dark) {
  .fbloco-conversas-upload-btn {
    color: #d1d5db;
    background: #1f2937;
    border-color: #374151;
  }
  .fbloco-conversas-upload-btn:hover:not(:disabled) {
    background: #374151;
    border-color: #4b5563;
  }
  .fbloco-conversas-upload-status  { color: #9ca3af; }
  .fbloco-conversas-upload-enviando { color: #60a5fa; }
  .fbloco-conversas-upload-ok       { color: #34d399; }
  .fbloco-conversas-upload-erro     { color: #f87171; }
  .fbloco-conversas-url-toggle      { color: #6b7280; }
  .fbloco-conversas-url-toggle:hover { color: #9ca3af; }
}

/* Resumo no canvas */
.fbloco-conversas-resumo-linha {
  font-size: 12px;
  color: #4b5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .fbloco-conversas-info {
    background: #450a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
  }

  .fbloco-conversas-cell {
    background: #1f2937;
    border-color: #374151;
  }

  .fbloco-conversas-cell:hover {
    background: #3b1111;
    border-color: #ef4444;
  }

  .fbloco-conversas-cell:active {
    background: #4c1515;
  }

  .fbloco-conversas-cell--ativo {
    background: #3b1111;
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.22);
  }

  .fbloco-conversas-cell--ativo .fbloco-conversas-cell-label {
    color: #fca5a5;
    font-weight: 600;
  }

  .fbloco-conversas-cell-label {
    color: #d1d5db;
  }

  .fbloco-conversas-item {
    border-color: #374151;
  }

  .fbloco-conversas-item-header {
    background: #1f2937;
    color: #f3f4f6;
    border-color: #374151;
  }

  .fbloco-conversas-item-input {
    background: #111827;
    color: #f9fafb;
  }

  .fbloco-conversas-item-input:focus {
    background: #1a2332;
  }

  .fbloco-conversas-resumo-linha {
    color: #9ca3af;
  }
}
