/* Estilos específicos para a página de Pessoas */

/* Estilos para o dropdown de autocomplete de empresas */
#filterEmpresaDropdown {
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  background-color: white;
}

#filterEmpresaDropdown .list-group-item {
  cursor: pointer;
  border: none;
  border-bottom: 1px solid #e9ecef;
}

#filterEmpresaDropdown .list-group-item:hover {
  background-color: #f8f9fa;
}

#filterEmpresaDropdown .list-group-item:last-child {
  border-bottom: none;
}

/* Tabela de Pessoas */
#pessoasTable {
  font-size: 0.85rem;
  min-width: 2000px; /* Largura mínima para acomodar todas as colunas */
  table-layout: fixed; /* Força o uso dos widths definidos */
  width: 100%;
}

.table-responsive {
  overflow-x: auto;
  overflow-y: auto;
}

#pessoasTable thead th {
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #dee2e6;
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 10;
  padding: 12px 16px;
  width: 200px;
}

#pessoasTable tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

#pessoasTable tbody tr:hover {
  background-color: #f8f9fa;
}

#pessoasTable tbody td {
  vertical-align: middle;
  padding: 10px 12px;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Respeitar widths inline definidos no HTML */
#pessoasTable thead th:first-child,
#pessoasTable tbody td:first-child {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
}

#pessoasTable thead th:last-child,
#pessoasTable tbody td:last-child {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

/* Ícone de pessoa */
.pessoa-icon {
  color: #c6254e;
  margin-right: 8px;
  font-size: 0.9rem;
}

/* Texto indefinido */
.text-indefinido {
  color: #999;
  font-style: italic;
}

/* Barra de busca */
#searchInput {
  border-radius: 8px 0 0 8px;
}

#searchBtn {
  border-radius: 0 8px 8px 0;
  border-left: none;
}

/* Botões de ação */
.btn.btn-outline-primary.btn-sm {
  width: 120px;
}

#addPessoaBtn {
  background-color: #c6254e;
  border-color: #c6254e;
}

#addPessoaBtn:hover {
  background-color: #a01e3f;
  border-color: #a01e3f;
}

#addPessoaBtn:active {
  background-color: #a01e3f !important;
  border-color: #a01e3f !important;
}

#addPessoaBtn:focus-visible {
  background-color: #a01e3f !important;
  border-color: #a01e3f !important;
}

#pessoaDetailsExcluirBtn:active {
  color: white !important;
}

#pessoaDetailsExcluirBtn:focus-visible {
  color: white !important;
}

/* Barra de progresso */
#progressBar {
  transition: width 0.3s ease;
  background-color: #c6254e;
}

/* Responsividade */
@media (max-width: 768px) {
  #pessoasTable {
    font-size: 0.8rem;
  }

  #pessoasTable tbody td {
    padding: 8px 12px;
  }

  .pessoa-icon {
    font-size: 0.8rem;
  }
}

/* Scrollbar customizada para a tabela */
.table-responsive::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #c6254e;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #a01e3f;
}

/* Estilos para Modal de Ordenação */
#sortModal {
  z-index: 1055 !important;
}

#sortModal .modal-dialog {
  z-index: 1056 !important;
  position: relative;
}

.modal-backdrop {
  z-index: 1050 !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}

.modal-backdrop.show {
  opacity: 0.5 !important;
}

#viewPessoaModal .modal-dialog {
  z-index: 1056 !important;
  position: relative;
  max-width: 95vw;
  margin: 1.75rem auto;
}

/* Garantir que o modal fique acima de tudo */
.modal.show {
  display: block !important;
  z-index: 1055 !important;
}

/* Remover backdrops duplicados */
body.modal-open {
  overflow: hidden !important;
  padding-right: 0 !important;
}

/* Garantir que apenas um backdrop exista */
.modal-backdrop:not(:first-of-type) {
  display: none !important;
}

/* Estilos para seção de redes sociais */
.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

input[id^="pessoa"]:focus {
  border-color: #c6254e;
  box-shadow: 0 0 0 0.2rem rgba(198, 37, 78, 0.25);
}

/* Estilos para botões de ação */
.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-top-left-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
}

.btn-group .btn:last-child {
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
}

.btn-group .btn-info {
  background-color: #17a2b8;
  border-color: #17a2b8;
}

.btn-group .btn-info:hover {
  background-color: #138496;
  border-color: #117a8b;
}

.btn-group .btn-warning:hover {
  background-color: #e0a800;
  border-color: #d39e00;
}

.btn-group .btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
}

/* Estilos para modal de visualizar pessoa */
#viewPessoaContent .form-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

#viewPessoaContent p {
  font-size: 0.95rem;
}

/* Estilos para modal de excluir pessoa */
#deletePessoaModal .modal-header {
  background-color: #dc3545;
}

/* Estilos para campo Responsável com chip */
#pessoaResponsavelContainer {
  transition: all 0.2s ease;
}

#pessoaResponsavelContainer:hover {
  background-color: #e9ecef !important;
}

#pessoaResponsavelDropdown {
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#pessoaResponsavelDropdown .list-group-item {
  cursor: pointer;
  border: none;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
}

#pessoaResponsavelDropdown .list-group-item:hover {
  background-color: #f8f9fa;
}

#pessoaResponsavelDropdown .list-group-item:last-child {
  border-bottom: none;
}

#pessoaResponsavelRemove:hover {
  color: #dc3545 !important;
}

/* Estilos para dropdown de empresas no modal de pessoa (igual ao filtro) */
#pessoaEmpresaDropdown {
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  background-color: white;
}

#pessoaEmpresaDropdown .list-group-item {
  cursor: pointer;
  border: none;
  border-bottom: 1px solid #e9ecef;
}

#pessoaEmpresaDropdown .list-group-item:hover {
  background-color: #f8f9fa;
}

#pessoaEmpresaDropdown .list-group-item:last-child {
  border-bottom: none;
}

/* Estilos para seleção de produtos */
#pessoaProdutosContainer {
  position: relative;
}

#pessoaProdutosTags .badge {
  padding: 0.375rem 0.5rem;
  font-weight: 500;
}

#pessoaProdutosTags .badge i {
  margin-left: 0.25rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

#pessoaProdutosTags .badge i:hover {
  opacity: 1;
}

#pessoaProdutosDropdown {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

#pessoaProdutosList .list-group-item {
  border-left: none;
  border-right: none;
  padding: 0.75rem 1rem;
}

#pessoaProdutosList .list-group-item:hover {
  background-color: #f8f9fa;
}

#pessoaProdutosList .list-group-item.active {
  background-color: #0d6efd;
  color: white;
}

/* Estilos adicionais da página pessoas.html */
.table thead th {
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #dee2e6;
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 10;
}

.table tbody tr {
  border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

.table tbody td {
  vertical-align: middle;
  padding: 12px 16px;
}

@media (max-width: 768px) {
  .table-responsive {
    font-size: 0.875rem;
  }

  .table tbody td {
    padding: 8px 12px;
  }
}

/* Tabela de Negócios no Modal de Visualizar Pessoa */
#pessoaNegociosTable {
  font-size: 1rem;
  min-width: 2000px; /* Largura mínima para acomodar todas as colunas */
  table-layout: fixed; /* Força o uso dos widths definidos */
  width: 100%;
}

#pessoaNegociosTable thead th {
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #dee2e6;
  padding: 12px 16px;
}

#pessoaNegociosTable tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

#pessoaNegociosTable tbody tr:hover {
  background-color: #f8f9fa;
}

#pessoaNegociosTable tbody td {
  vertical-align: middle;
  padding: 10px 12px;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Respeitar widths inline definidos no HTML */
#pessoaNegociosTable thead th:first-child,
#pessoaNegociosTable tbody td:first-child {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
}

/* Estilos para o card de números WhatsApp */
#pessoaWhatsAppNumbersCard {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
  display: none;
  min-width: 320px;
  z-index: 1050;
}

#pessoaWhatsAppNumbersCard .card-body {
  max-height: 400px;
  overflow-y: auto;
}

.whatsapp-numbers-card {
  display: none;
  min-width: 320px;
  z-index: 1050;
}

.badge-circle-small {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.icon-small {
  font-size: 0.875rem;
}

/* Estilos para edição inline do CPF */
.pessoa-cpf-edit {
  display: none !important;
}

.pessoa-cpf-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do Cargo */
.pessoa-cargo-edit {
  display: none !important;
}

.pessoa-cargo-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do Aniversário */
.pessoa-aniversario-edit {
  display: none !important;
}

.pessoa-aniversario-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do Ano de Nascimento */
.pessoa-ano-nascimento-edit {
  display: none !important;
}

.pessoa-ano-nascimento-edit.show {
  display: flex !important;
}

/* Estilos para edição inline da Descrição */
.pessoa-descricao-edit {
  display: none !important;
}

.pessoa-descricao-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do Sexo */
.pessoa-sexo-edit {
  display: none !important;
}

.pessoa-sexo-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do Cadastrado por */
.pessoa-cadastrado-por-edit {
  display: none !important;
}

.pessoa-cadastrado-por-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do Responsável */
.pessoa-responsavel-edit {
  display: none !important;
}

.pessoa-responsavel-edit.show {
  display: flex !important;
}

/* Estilos para edição inline da Empresa */
.pessoa-empresa-edit {
  display: none !important;
}

.pessoa-empresa-edit.show {
  display: flex !important;
}

.pessoa-empresa-dropdown {
  background-color: white;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.pessoa-empresa-dropdown .list-group-item {
  cursor: pointer;
  border: none;
  border-bottom: 1px solid #dee2e6;
}

.pessoa-empresa-dropdown .list-group-item:last-child {
  border-bottom: none;
}

.pessoa-empresa-dropdown .list-group-item:hover {
  background-color: #f8f9fa;
}

/* Estilos para dropdown de Cargo */
.pessoa-cargo-dropdown {
  background-color: white;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.pessoa-cargo-dropdown .list-group-item {
  cursor: pointer;
  border: none;
  border-bottom: 1px solid #dee2e6;
}

.pessoa-cargo-dropdown .list-group-item:last-child {
  border-bottom: none;
}

.pessoa-cargo-dropdown .list-group-item:hover {
  background-color: #f8f9fa;
}

/* Estilos para edição inline da Categoria */
.pessoa-categoria-edit {
  display: none !important;
}

.pessoa-categoria-edit.show {
  display: flex !important;
}

/* Estilos para edição inline da Origem */
.pessoa-origem-edit {
  display: none !important;
}

.pessoa-origem-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do Email */
.pessoa-email-edit {
  display: none !important;
}

.pessoa-email-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do Celular */
.pessoa-celular-edit {
  display: none !important;
}

.pessoa-celular-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do WhatsApp */
.pessoa-whatsapp-edit {
  display: none !important;
}

.pessoa-whatsapp-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do Telefone */
.pessoa-telefone-edit {
  display: none !important;
}

.pessoa-telefone-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do País */
.pessoa-pais-edit {
  display: none !important;
}

.pessoa-pais-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do Facebook */
.pessoa-facebook-edit {
  display: none !important;
}

.pessoa-facebook-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do Twitter/X */
.pessoa-twitter-edit {
  display: none !important;
}

.pessoa-twitter-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do LinkedIn */
.pessoa-linkedin-edit {
  display: none !important;
}

.pessoa-linkedin-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do Instagram */
.pessoa-instagram-edit {
  display: none !important;
}

.pessoa-instagram-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do Skype */
.pessoa-skype-edit {
  display: none !important;
}

.pessoa-skype-edit.show {
  display: flex !important;
}

/* Estilos para edição inline do Endereço (card style) */
.endereco-edit-cell {
  position: relative;
}

.endereco-display {
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.endereco-edit-card {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid #dee2e6;
}

.endereco-edit-card .card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  padding: 0.75rem 1rem;
}

.endereco-edit-card .card-body {
  padding: 1rem;
  max-height: 70vh;
  overflow-y: auto;
}

.endereco-edit-card .form-label {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.endereco-edit-card .form-control-sm {
  font-size: 0.875rem;
}

.endereco-edit-card-positioned {
  display: none;
  z-index: 1050;
  min-width: 400px;
  max-width: 500px;
  top: -200px;
  transform: translateX(-35%);
}

.text-max-width-60 {
  max-width: 60%;
  word-wrap: break-word;
}

.icon-edit {
  font-size: 0.875rem;
}

.dropdown-toggle::after {
  display: none;
}
