/**
 * ChoicesJS Custom Styles - LED Globo
 * Design System: Azul Globo #00004D, Verde Limão #CDF973
 * Tipografia: Globotipo Corporativa
 */

/* Container principal */
.choices {
  border: 1px solid #D1D5DC;
  border-radius: 8px;
  background-color: #F3F3F5;
  margin-bottom: 0;
}

.choices.is-focused,
.choices.is-open {
  border-color: #D1D5DC !important; /* Mantém a borda padrão */
  box-shadow: none !important; /* Remove sombrinhas que criam efeito de crescimento de borda */
}

/* Campo interno */
.choices__inner {
  padding: 12px 16px;
  background-color: #F3F3F5;
  border: none;
  border-radius: 8px;
  min-height: 48px;
  font-family: 'Globotipo Corporativa', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* Input de busca */
.choices__input {
  background-color: transparent;
  font-family: 'Globotipo Corporativa', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  color: #1f2937;
  padding: 0;
  margin-bottom: 0;
}

.choices__input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

/* Lista dropdown */
.choices__list--dropdown {
  background-color: #ffffff;
  border: 1px solid #D1D5DC;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  margin-top: 4px;
  z-index: 100;
}

.choices__list--dropdown .choices__item {
  padding: 12px 16px;
  font-family: 'Globotipo Corporativa', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  color: #1f2937;
}

.choices__list--dropdown .choices__item--selectable {
  transition: background-color 0.15s ease-in-out;
}

.choices__list--dropdown .choices__item--selectable:hover,
.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background-color: #f3f4f6;
}

.choices__list--dropdown .choices__item--selectable::after {
  display: none;
}

/* Item selecionado (múltipla seleção) */
.choices__list--multiple .choices__item {
  background-color: #00004D;
  border: 1px solid #00004D;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 14px;
  color: #ffffff;
  margin-right: 4px;
  margin-bottom: 4px;
}

.choices__list--multiple .choices__item.is-highlighted {
  background-color: #000033;
  border-color: #000033;
}

/* Botão remover */
.choices__button,
.choices__button_joomla {
  text-indent: -9999px !important;
  font-size: 0 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E") !important; /* X Vermelho sempre */
  background-size: 14px !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  border: none !important;
  background-color: rgba(220, 38, 38, 0.08) !important; /* Fundo vermelho bem claro sempre */
  opacity: 1 !important; /* Visibilidade total sempre */
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  margin-left: 8px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important; /* Sombra sutil para destaque */
  border-radius: 50% !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.choices__button:hover,
.choices__button_joomla:hover {
  background-color: rgba(220, 38, 38, 0.15) !important; /* Fundo um pouco mais forte no hover */
}

/* Ocultar botão de remover quando o valor for vazio (ex: placeholder '--selecione--') */
.choices__item[data-value=""] .choices__button,
.choices__item[data-value=""] .choices__button_joomla,
.choices__placeholder .choices__button,
.choices__placeholder .choices__button_joomla {
  display: none !important;
}

/* Placeholder */
.choices__placeholder {
  color: #9ca3af;
  opacity: 1;
}

/* Estado disabled */
.choices.is-disabled .choices__inner {
  background-color: #e5e7eb;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Grupos de opções */
.choices__group .choices__heading {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  padding: 8px 16px 4px;
}

/* Mensagem de "sem resultados" */
.choices__item--choice.has-no-results {
  color: #6b7280;
  font-style: italic;
}

/* Select único - seta dropdown */
.choices[data-type*="select-one"] .choices__inner {
  padding-right: 45px;
}

.choices[data-type*="select-one"]::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #6b7280;
  pointer-events: none;
  transition: transform 0.2s ease-in-out;
}

/* Removido efeito de rotação que causava deslocamento */

/* Responsividade mobile */
@media (max-width: 768px) {
  .choices__inner {
    padding: 10px 14px;
    min-height: 44px;
    font-size: 16px;
  }
  
  .choices__list--dropdown {
    max-height: 240px;
  }
  
  .choices__list--dropdown .choices__item {
    padding: 10px 14px;
  }
}

/* Estado de validação (erro) */
.choices.is-invalid,
.was-validated .form-select:invalid + .choices {
  border-color: #dc2626;
}

.choices.is-invalid.is-focused {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Estado de validação (sucesso) */
.choices.is-valid,
.was-validated .form-select:valid + .choices {
  border-color: #16a34a;
}

.choices.is-valid.is-focused {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}
