/* ===== Google Font Import - Poppins ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-0.25rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  color: #1a1a1a;
  background-color: #f9fafb;
  line-height: 1.5;
}

.min-h-screen {
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Header */
header {
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* Main content */
main {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.titulo {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
  margin-bottom: 2rem;
}

/* Banner */
.banner {
  background-color: #3c6c2a;
  color: white;
  padding: 1.5rem;
  border-radius: 50px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.banner p {
  font-size: 1.125rem;
}

/* Search container */
.search-container {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Dropdown */
.dropdown {
  position: relative;
  min-width: 200px;
  z-index: 10;
}

.dropdown-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.2s;
}

.dropdown-select:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
}

.dropdown-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-icon {
  margin-left: 0.5rem;
  transition: transform 0.2s;
}

.dropdown.active .dropdown-icon {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  width: 100%;
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: none;
  animation: fadeIn 0.2s ease;
  z-index: 20;
}

.dropdown.active .dropdown-menu {
  display: block;
}

.dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: #f9fafb;
}

/* Search input */
.search-input {
  flex: 1;
  min-width: 250px;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #3c6c2a;
  box-shadow: 0 0 0 3px rgba(60, 108, 42, 0.1);
}

/* Buttons */
.search-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background-color: #1a1a1a;
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-button:hover {
  background-color: #333333;
}

.advanced-search-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background-color: #f3f4f6;
  color: #1f2937;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.advanced-search-button:hover {
  background-color: #e5e7eb;
}

.icon-small {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
}

/* Advanced search form */
.advanced-search-form {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
}

.advanced-search-form.visible {
  max-height: 2000px;
  opacity: 1;
  border-top: 1px solid #e5e7eb;
  padding-top: 1.5rem;
  margin-top: 1rem;
}

.form-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: -1.5rem;
}

/* Estilos específicos para a seção de seleção de entidade */
.entity-subsection {
  margin-bottom: 1.5rem;
}

.entity-subsection:last-child {
  margin-bottom: 0;
}

.subsection-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.entity-selection-row {
  display: grid;
  gap: 1rem;
  align-items: end;
}

.geographic-row {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.administrative-row {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Seção de Estatísticas - Simplificada */
.statistics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  padding: 1rem 0;
  border-top: 1px solid #e5e7eb;
  margin-top: 3rem;
  /* Adicionado para afastar do topo */
}

.info-display {
  display: flex;
  flex-direction: column;
  /* Empilha label e value */
  align-items: flex-start;
  /* Alinha à esquerda */
  gap: 0.25rem;
  /* Espaçamento menor entre label e value */
  padding: 0;
  /* Remove padding */
  background-color: transparent;
  /* Remove fundo */
  border: none;
  /* Remove borda */
}

.info-label {
  font-size: 0.875rem;
  /* Tamanho da fonte original */
  font-weight: 500;
  /* Peso da fonte original */
  color: #6b7280;
  /* Cor original */
}

.info-value {
  font-size: 1.5rem;
  /* Aumenta o tamanho da fonte para o valor */
  font-weight: 700;
  /* Torna o valor mais negrito */
  color: #1f2937;
  /* Cor mais escura para o valor */
  display: inline;
  /* Garante que o valor seja exibido */
}

.form-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 0.5rem 0;
}

.form-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
}

.form-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  accent-color: #3c6c2a;
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: white;
  transition: all 0.2s;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: #3c6c2a;
  box-shadow: 0 0 0 3px rgba(60, 108, 42, 0.1);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234b5563'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

/* Custom styles for the entity selection form */
.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.custom-select {
  position: relative;
  width: 100%;
}

.select-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: #4b5563;
  pointer-events: none;
}

/* Modificando o posicionamento do botão LIMPAR */
.form-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: -1.5rem;
}

.clear-selection-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background-color: white;
  color: #4b5563;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 1.5rem;
}

.clear-selection-button:hover {
  background-color: #f9fafb;
}

/* Ajuste para o layout do último grupo de campos */
.form-row:last-of-type {
  align-items: flex-end;
}

.form-select:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}


.submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background-color: #3c6c2a;
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 1.7em;
}

.submit-button:hover {
  background-color: #4d8836;
}

/* Responsive styles */
@media (max-width: 768px) {
  .search-row {
    flex-direction: column;
  }

  .dropdown,
  .search-input,
  .search-button,
  .advanced-search-button {
    width: 100%;
  }

  .form-buttons {
    flex-direction: column;
  }

  .clear-button,
  .submit-button {
    width: 100%;
  }

  .banner {
    border-radius: 25px;
    padding: 1.25rem;
  }

  .banner p {
    font-size: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* Responsive para a seção de entidade */
  .geographic-row,
  .administrative-row {
    grid-template-columns: 1fr;
  }

  .entity-selection-section {
    padding: 1rem;
  }

  .statistics-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .info-display {
    flex-direction: column;
    /* Mantém empilhado para telas menores */
    align-items: flex-start;
    /* Alinha à esquerda */
    gap: 0.25rem;
  }

}

@media (min-width: 769px) and (max-width: 1024px) {
  .search-input {
    min-width: 200px;
  }

  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .geographic-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .administrative-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) and (max-width: 1200px) {
  .geographic-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .administrative-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1201px) {
  .geographic-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .administrative-row {
    grid-template-columns: repeat(3, 1fr);
  }
}