/* 
arquivo para componente de modal
.modal
  .modal-header
  .modal-body
  .modal-action
*/

.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90%, 600px);
  background-color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  color: #333;
  font-family: var(--font-primary, sans-serif);
  max-height: 60vh;
  overflow: auto;
  flex-direction: column;

  &::backdrop {
    background-color: rgba(0, 0, 0, 0.4);
  }

  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;

    .modal-header-title {
      font-weight: bold;
    }

    .modal-header-action:hover {
      cursor: pointer;
    }
  }

  .modal-body {
    height: 100%;
    text-align: justify;
  }

  .modal-action {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 8px;
  }
}

.modal .form-cadastro-pessoa {
  height: 78%;
}

/* Container das sugestões */
#sugestoes {
  position: relative;
  top: calc(100% - 1px);
  /* encosta no input */
  left: 0;
  width: 100%;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  padding: 0;
}

/* Cada sugestão */
#sugestoes .sugestao-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

/* Último item sem borda */
#sugestoes .sugestao-item:last-child {
  border-bottom: none;
}

/* Hover */
#sugestoes .sugestao-item:hover {
  background-color: #f5f5f5;
}

/* Item ativo/selecionado */
#sugestoes .sugestao-item.active {
  background-color: #e8eaf6;
  color: #3f51b5;
  font-weight: 500;
}

#sugestoes .sugestao-empty {
  padding: 12px 16px;
  transition: background 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

/* Último empty sem borda */
#sugestoes .sugestao-empty:last-child {
  border-bottom: none;
}

/* empty ativo/selecionado */
#sugestoes .sugestao-empty.active {
  background-color: #e8eaf6;
  color: #3f51b5;
  font-weight: 500;
}


/* Chips das pessoas selecionadas */
.chip {
  display: inline-flex;
  align-items: center;
  background: #e0f2ff;
  color: #055160;
  padding: 0.4rem 0.8rem;
  margin: 0.2rem;
  border-radius: 18px;
  font-size: 0.9rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chip .remove {
  margin-left: 0.5rem;
  cursor: pointer;
  font-weight: bold;
  color: inherit;
  font-size: 1rem;
}

.chip .remove:hover {
  color: #ff0000;
}

/* Responsividade */
@media (max-width: 600px) {
  .modal {
    width: 90%;
    padding: 1.5rem 1rem;
  }

  .modal span[name="btn-close"] {
    font-size: 1rem;
  }
}

/* --- Ajustes para dropdown de sugestões --- */
#pessoas-selecionadas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

/* Ajusta inputs para ocupar toda a largura interna do modal */
.modal .input-text {
  max-width: 100%;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  /* remove borda */
  border-radius: 50px;
  /* deixa o input redondo */
  background-color: #f5f7fa;
  /* leve cinza para contraste */
}

/* Chips aprimorados */
.chip {
  background: #e0f2ff;
  color: #055160;
  padding: 0.4rem 0.8rem;
  border-radius: 18px;
  font-size: 0.9rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chip .remove {
  margin-left: 0.5rem;
  font-size: 1rem;
}

/* Botões dentro do modal */
.modal .primary-button {
  width: 180px;
}