/* =====================================================
   OLHAPAUTA — LIVE SEARCH STYLES (SPRINT 15)
===================================================== */

/* 1. Botão de Busca no Header (Simetria ao Hamburger) */
.header-search-toggle {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header-search-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #e53935;
}

.header-search-toggle:focus-visible {
  outline: 3px solid rgba(229, 57, 53, 0.45);
  outline-offset: 2px;
}

/* 2. Glassmorphic Search Overlay */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 14, 20, 0.9); /* Alinhado com o header escuro */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 999999;
  display: flex;
  justify-content: center;
  padding: 60px 20px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.search-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.search-overlay-inner {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.search-overlay-header {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
}

.search-overlay-form {
  flex-grow: 1;
}

.search-overlay-form .search-form__inner {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 5px 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-overlay-form .search-form__inner:focus-within {
  border-color: #e53935;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.25);
}

.search-overlay-input {
  background: transparent;
  border: 0;
  outline: 0;
  color: #fff;
  font-size: 18px;
  width: 100%;
  padding: 10px 0;
}

.search-overlay-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Botão Fechar */
.search-overlay-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.search-overlay-close:hover {
  background: rgba(229, 57, 53, 0.15);
  border-color: rgba(229, 57, 53, 0.3);
  color: #e53935;
  transform: rotate(90deg);
}

/* 3. Dropdown de Resultados (Inline) */
.live-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  border: 1px solid rgba(15, 23, 42, 0.08);
  margin-top: 8px;
  z-index: 100;
  max-height: 400px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.live-search-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 4. Lista de Resultados & Itens */
.search-overlay-results {
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  border-radius: 12px;
}

.live-search-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.live-search-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Item dentro do Overlay (Escuro) */
.search-overlay-results .live-search-item {
  color: #fff;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.search-overlay-results .live-search-item:hover,
.search-overlay-results .live-search-item.focused {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

/* Item dentro do Dropdown Inline (Claro) */
.live-search-dropdown .live-search-item {
  color: #0f172a;
  background: transparent;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 0;
  text-align: left;
}

.live-search-dropdown .live-search-item:last-child {
  border-bottom: 0;
}

.live-search-dropdown .live-search-item:hover,
.live-search-dropdown .live-search-item.focused {
  background: #f8fafc;
}

/* Thumbnails */
.live-search-thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background-color: rgba(255, 255, 255, 0.1);
}

.live-search-thumb-placeholder {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.2);
  flex-shrink: 0;
}

.live-search-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-search-meta {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #e53935; /* Destaque vermelho do tema */
  text-align: left;
}

/* Meta claro */
.live-search-dropdown .live-search-meta {
  color: #e53935;
}

.live-search-item-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  text-align: left;
}

/* 5. Estados Vazios e Loading */
.live-search-empty {
  padding: 30px;
  text-align: center;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.live-search-dropdown .live-search-empty {
  color: #64748b;
  background: transparent;
  border: 0;
}

.live-search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 40px;
  color: rgba(255, 255, 255, 0.6);
}

.live-search-dropdown .live-search-loading {
  color: #64748b;
}

.live-search-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(229, 57, 53, 0.2);
  border-top-color: #e53935;
  border-radius: 50%;
  animation: search-spin 0.8s linear infinite;
}

@keyframes search-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsividade Mobile */
@media (max-width: 599px) {
  .search-overlay {
    padding: 30px 15px 15px;
  }
  .search-overlay-close {
    width: 40px;
    height: 40px;
  }
  .search-overlay-input {
    font-size: 16px;
  }
  .live-search-item {
    gap: 10px;
    padding: 10px;
  }
  .live-search-thumb, .live-search-thumb-placeholder {
    width: 44px;
    height: 44px;
  }
}
