/* Estilos para buscador estilo Google */

#search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

#search-input {
  width: 100%;
  padding: 12px 48px 12px 16px;
  border: 1px solid #dfe1e5;
  border-radius: 24px;
  font-size: 16px;
  outline: none;
  transition: box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
  background: #fff;
}

#search-input:focus {
  border-color: #4285f4;
  box-shadow: 0 2px 8px rgba(32, 33, 36, 0.28);
}

#search-loading {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
}

#search-loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #4285f4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #dfe1e5;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(32, 33, 36, 0.28);
  max-height: 600px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 8px;
  display: none;
}

.search-results-header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid #e8eaed;
  background: #f8f9fa;
}

.results-count {
  font-size: 13px;
  color: #70757a;
}

.search-result-item {
  padding: 16px;
  border-bottom: 1px solid #e8eaed;
  cursor: pointer;
  transition: background-color 0.1s ease-in-out;
  position: relative;
}

.search-result-item:hover,
.search-result-item.selected {
  background-color: #f8f9fa;
}

.search-result-item:last-child {
  border-bottom: none;
}

/* Estilos específicos para tipos de resultados */
.result-capitulo {
  border-left: 4px solid #4285f4;
}

.result-articulo {
  border-left: 4px solid #34a853;
  background-color: #fafffe;
}

.result-header {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  color: #70757a;
}

.result-type-icon {
  margin-right: 6px;
  font-size: 14px;
}

.result-type-label {
  font-weight: 500;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.result-title {
  font-size: 18px;
  color: #1a0dab;
  font-weight: normal;
  margin-bottom: 4px;
  line-height: 1.3;
}

.result-title mark {
  background-color: #fff59d;
  padding: 0;
  font-weight: bold;
}

.result-breadcrumb {
  font-size: 14px;
  color: #006621;
  margin-bottom: 4px;
}

.result-excerpt {
  font-size: 14px;
  color: #545454;
  line-height: 1.4;
  margin-bottom: 4px;
}

.result-excerpt mark {
  background-color: #fff59d;
  padding: 0;
  font-weight: bold;
}

.result-url {
  font-size: 12px;
  color: #006621;
  text-decoration: none;
}

/* Estilos para sugerencias de historial */
.search-suggestions {
  padding: 8px 0;
}

.suggestions-header {
  padding: 8px 16px;
  font-size: 13px;
  color: #70757a;
  font-weight: 500;
  border-bottom: 1px solid #e8eaed;
  margin-bottom: 4px;
}

.suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #202124;
  transition: background-color 0.1s ease-in-out;
  display: flex;
  align-items: center;
}

.suggestion-item:hover {
  background-color: #f8f9fa;
}

.suggestion-item i {
  margin-right: 12px;
  color: #70757a;
  width: 16px;
}

/* Estilos para cuando no hay resultados */
.no-results {
  padding: 32px 16px;
  text-align: center;
}

.no-results-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.no-results-text {
  font-size: 16px;
  color: #202124;
  margin-bottom: 16px;
}

.search-suggestions ul {
  margin: 8px 0 0 0;
  padding: 0;
  list-style: none;
}

.search-suggestions li {
  font-size: 13px;
  color: #70757a;
  margin-bottom: 4px;
}

/* Estilos para errores */
.search-error {
  padding: 24px 16px;
  text-align: center;
}

.error-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.7;
}

.error-text {
  font-size: 14px;
  color: #d93025;
}

/* Responsive */
@media (max-width: 768px) {
  #search-container {
    margin: 0 16px;
  }
  
  #search-results {
    left: -16px;
    right: -16px;
    margin-left: 0;
    margin-right: 0;
  }
  
  .search-result-item {
    padding: 12px;
  }
  
  .result-title {
    font-size: 16px;
  }
}

/* Animaciones suaves */
#search-results {
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}