/* ==========================================================================
   BUSCA — Camara Municipal de Correntes
   Paleta institucional: #435454 (principal) / #6d8282 (claro)
   Icones: Font Awesome (ja carregado) + Iconify nos cards
   Local: css/busca.css
   ========================================================================== */

/* ==========================================================
   1) AUTOCOMPLETE (barra do topo)
   ========================================================== */

.busca-topo {
  width: 100%;
  max-width: 340px;
}

.buscar-input-container {
  position: relative;
  z-index: 2000;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cccccc;
  border-radius: 4px;
  padding: 0 12px;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.buscar-input-container:focus-within {
  border-color: #435454;
  box-shadow: 0 0 0 3px rgba(67, 84, 84, .15);
}

.buscar-icon-search {
  color: #6d8282;
  font-size: 14px;
  flex-shrink: 0;
}

.buscar-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 9px 10px;
  font-size: 14px;
  color: #333333;
}

.buscar-input::placeholder { color: #999999; }

/* ---------- Lista de resultados ---------- */
.resultados-lista {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  width: 100%;
  max-height: 420px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
  text-align: left;
  z-index: 2000;
}

.resultado-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #435454;
  font-size: 13px;
  border-bottom: 1px solid #eeeeee;
  text-decoration: none;
  transition: background-color .25s ease, padding-left .25s ease;
}

.resultado-item:last-of-type { border-bottom: none; }

.resultado-item:hover {
  background-color: #f4f6f6;
  color: #435454;
  padding-left: 24px;
  text-decoration: none;
}

.resultado-item i {
  font-size: 12px;
  color: #a8b5b5;
  flex-shrink: 0;
}

.resultado-item:hover i { color: #435454; }

.resultado-titulo { flex: 1; }

/* Mensagem quando nao ha resultados */
.resultado-vazio {
  padding: 14px 16px;
  text-align: center;
  font-size: 13px;
  color: #999999;
  border-bottom: 1px solid #eeeeee;
}

/* Linha destacada: Busca Avancada */
.resultado-avancado {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background-color: #f4f6f6;
  border-top: 2px solid #435454;
  color: #435454;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease;
}

.resultado-avancado:hover {
  background-color: #435454;
  color: #ffffff;
  text-decoration: none;
}

.resultado-avancado i {
  font-size: 13px;
  color: #435454;
  flex-shrink: 0;
  transition: color .25s ease;
}

.resultado-avancado:hover i { color: #ffffff; }

.resultado-avancado-texto { flex: 1; }
.resultado-avancado-seta  { margin-left: auto; }


/* ==========================================================
   2) PAGINA DE BUSCA AVANCADA
   ========================================================== */

.busca-container {
  padding: 30px 15px 60px;
}

/* ---------- Caixa de busca ---------- */
.busca-hero {
  position: relative;
  max-width: 760px;
  margin: 0 auto 40px;
  background: linear-gradient(135deg, #435454 0%, #2f3d3d 55%, #6d8282 165%);
  border-radius: 8px;
  padding: 26px 28px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(67, 84, 84, .3);
}

.busca-hero-brilho {
  position: absolute;
  top: -70%;
  left: -25%;
  width: 150%;
  height: 240%;
  background:
    radial-gradient(circle at 30% 40%, rgba(255, 255, 255, .1) 0%, transparent 42%),
    radial-gradient(circle at 75% 60%, rgba(109, 130, 130, .3) 0%, transparent 40%);
  animation: buscaGira 20s linear infinite;
  pointer-events: none;
}

@keyframes buscaGira {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.busca-hero-conteudo { position: relative; z-index: 2; }

.busca-hero-legenda {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, .88);
  font-size: 14px;
  text-align: center;
  margin-bottom: 16px;
}

.busca-hero-legenda i { color: #b8c9c9; }

/* ---------- Campo ---------- */
.busca-campo-principal {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 6px;
  padding: 5px 5px 5px 16px;
  gap: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
}

.busca-campo-principal:focus-within {
  box-shadow: 0 0 0 3px rgba(109, 130, 130, .5), 0 8px 22px rgba(0, 0, 0, .2);
}

.busca-campo-icone { font-size: 16px; color: #435454; flex-shrink: 0; }

.busca-campo-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: #333333;
  padding: 11px 0;
}

.busca-campo-input::placeholder { color: #aaaaaa; }

.busca-campo-limpar {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: #eeeeee;
  color: #666666;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .25s ease;
}

.busca-campo-limpar:hover { background: #dddddd; }

.busca-campo-botao {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 5px;
  padding: 12px 22px;
  background: #6d8282;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .25s ease, transform .2s ease;
}

.busca-campo-botao:hover { background: #5a6e6e; transform: translateY(-1px); }
.busca-campo-botao:active { transform: scale(.97); }

/* ---------- Filtros ---------- */
.busca-filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.busca-filtro {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 30px;
  padding: 4px 8px 4px 14px;
}

.busca-filtro label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: rgba(255, 255, 255, .9);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.busca-filtro-select {
  border: none;
  outline: none;
  background: transparent;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}

.busca-filtro-select option { color: #333333; background: #ffffff; }

/* ---------- Cabecalho dos resultados ---------- */
.busca-resultados-cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 2px solid #eeeeee;
}

.busca-resultados-titulo { font-size: 20px; color: #435454; margin: 0; font-weight: 700; }
.busca-termo { color: #6d8282; }

.busca-resultados-contador {
  font-size: 12px;
  color: #777777;
  background: #f0f2f2;
  padding: 6px 14px;
  border-radius: 30px;
  white-space: nowrap;
}

/* ---------- Grid de resultados ---------- */
.busca-lista {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.busca-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 18px;
  background: #ffffff;
  border: 1px solid #e0e5e5;
  border-radius: 6px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}

.busca-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: #6d8282;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}

.busca-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(67, 84, 84, .18);
  border-color: #435454;
  text-decoration: none;
}

.busca-card:hover::before { transform: scaleX(1); }

.busca-card-icone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #f0f2f2;
  flex-shrink: 0;
  transition: background .3s ease;
}

.busca-card-icone .iconify { font-size: 21px; color: #435454; transition: color .3s ease; }

.busca-card:hover .busca-card-icone { background: #435454; }
.busca-card:hover .busca-card-icone .iconify { color: #ffffff; }

.busca-card-conteudo { flex: 1; min-width: 0; }

.busca-card-titulo { font-size: 15px; font-weight: 600; line-height: 1.35; color: #333333; margin: 0 0 6px; }

.busca-card-descricao {
  font-size: 12px;
  line-height: 1.5;
  color: #777777;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.busca-card-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.busca-tag-paginas       { background: #f0f2f2; color: #435454; }
.busca-tag-vereadores    { background: #e8eeee; color: #435454; }
.busca-tag-mesa          { background: #eef1f1; color: #5a6e6e; }
.busca-tag-transparencia { background: #fff4e0; color: #a87400; }

.busca-card-seta {
  position: absolute;
  top: 20px;
  right: 18px;
  font-size: 14px;
  color: #cccccc;
  transition: color .3s ease, transform .3s ease;
}

.busca-card:hover .busca-card-seta { color: #435454; transform: translateX(3px); }

/* ---------- Estados vazio / inicial ---------- */
.busca-vazio,
.busca-inicial {
  text-align: center;
  padding: 45px 25px;
  background: #fafbfb;
  border: 1px dashed #dde3e3;
  border-radius: 8px;
}

.busca-vazio-icone,
.busca-inicial-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #f0f2f2;
  margin-bottom: 16px;
}

.busca-vazio-icone i,
.busca-inicial-icone i { font-size: 28px; color: #435454; }

.busca-vazio h3,
.busca-inicial h3 { font-size: 18px; color: #435454; margin-bottom: 8px; }

.busca-vazio p,
.busca-inicial p { font-size: 13px; color: #777777; max-width: 460px; margin: 0 auto; }

/* ---------- Sugestoes ---------- */
.busca-sugestoes {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.busca-sugestoes-titulo { font-size: 12px; color: #999999; margin-right: 4px; }

.busca-tag {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 30px;
  background: #ffffff;
  border: 1px solid #dde3e3;
  color: #435454;
  font-size: 12px;
  text-decoration: none;
  transition: all .25s ease;
}

.busca-tag:hover {
  background: #435454;
  border-color: #435454;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-2px);
}

/* ---------- Responsivo ---------- */
@media (max-width: 992px) {
  .busca-lista { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}

@media (max-width: 768px) {
  .busca-topo { max-width: 100%; }
  .busca-hero { padding: 20px 16px; margin-bottom: 30px; }
  .busca-campo-principal { flex-wrap: wrap; padding: 10px; gap: 8px; }
  .busca-campo-input { flex: 1 1 auto; width: auto; }
  .busca-campo-botao { width: 100%; justify-content: center; }
  .busca-filtros { flex-direction: column; align-items: stretch; }
  .busca-lista { grid-template-columns: 1fr; }
  .busca-resultados-titulo { font-size: 17px; }
  .resultados-lista { max-height: 300px; }
}