/* EvoPRO — busca de veículo (Tarefa 3) */

.searchbar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(20, 21, 27, .92);
  border: 1px solid rgba(225, 6, 0, .5);
  border-radius: 8px;
  padding: 7px 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  font-family: var(--M, monospace);
}

.sb-icon {
  display: none;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--ink, #F5F7FA);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

.sb-input {
  width: 240px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink, #F5F7FA);
  font-family: var(--M, monospace);
  font-size: 12px;
  letter-spacing: .02em;
}

.sb-input::placeholder {
  color: var(--faint, #5B6472);
}

.sb-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--sub, #9AA3B2);
  border-left: 1px solid var(--line, rgba(255, 255, 255, .08));
  padding-left: 8px;
  white-space: nowrap;
}

.sb-nav[hidden],
.sb-results[hidden] {
  display: none;
}

.sb-arrow {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--ink, #F5F7FA);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.sb-arrow:disabled {
  color: var(--faint, #5B6472);
  cursor: default;
}

.sb-count {
  min-width: 40px;
  text-align: center;
}

.sb-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(20, 21, 27, .97);
  border: 1px solid var(--line, rgba(255, 255, 255, .08));
  border-radius: 8px;
  padding: 4px;
}

.sb-item {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--sub, #9AA3B2);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.sb-item b {
  color: var(--ink, #F5F7FA);
  font-weight: 700;
}

.sb-item .sb-page {
  color: var(--faint, #5B6472);
  white-space: nowrap;
}

.sb-item:hover,
.sb-item.active {
  background: rgba(225, 6, 0, .14);
  color: var(--ink, #F5F7FA);
}

.sb-empty {
  padding: 10px;
  font-size: 12px;
  color: var(--faint, #5B6472);
  text-align: center;
}

/* destaque das linhas encontradas na tabela */
.search-hit {
  background: rgba(225, 6, 0, .18) !important;
  border-left: 3px solid var(--redHot, #FF3B1D) !important;
}

@keyframes searchPulse {

  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 59, 29, 0);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(255, 59, 29, .35);
  }
}

.search-hit.pulse {
  animation: searchPulse .5s ease-in-out 4; /* 4×0.5s = 2s de pulso */
}

@media (max-width: 720px) {
  .searchbar {
    padding: 6px;
    gap: 4px;
  }

  .sb-icon {
    display: flex;
  }

  .sb-input {
    width: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: width .2s ease, opacity .2s ease;
  }

  .searchbar.expanded .sb-icon {
    display: none;
  }

  .searchbar.expanded .sb-input {
    width: 55vw;
    max-width: 220px;
    opacity: 1;
    pointer-events: auto;
  }
}
