/* Estilos para el buscador tipo Spotlight */
.spotlight-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  max-height: 0;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 1050;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.2s ease-in-out, max-height 0.3s ease-in-out;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 600px; /* Ancho fijo más grande */
  max-width: 90vw; /* Responsive en móviles */
  margin: 0 auto;
}

.spotlight-results.active {
  max-height: 85vh; /* Más alto para mostrar más resultados */
  opacity: 1;
  transform: translateY(0);
}

.spotlight-results.mobile {
  position: fixed;
  top: 60px;
  left: 10px;
  right: 10px;
  z-index: 1060;
  width: auto;
}

.spotlight-inner {
  max-height: 85vh;
  overflow-y: auto;
  padding: 0;
}

/* Cabecera de resultados */
.spotlight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 16px; /* Fuente más grande */
  color: #444;
  background-color: rgba(0, 0, 0, 0.02);
  font-weight: 500;
}

.spotlight-count {
  font-size: 14px;
  color: #666;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 3px 10px;
  border-radius: 12px;
}

/* Lista de resultados */
.spotlight-list {
  padding: 10px 0;
}

.spotlight-item {
  padding: 12px 20px; /* Más padding */
  transition: background-color 0.15s ease;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

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

.spotlight-item.active {
  background-color: rgba(0, 123, 255, 0.1);
}

.spotlight-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.spotlight-item-image {
  width: 50px; /* Imagen más grande */
  height: 50px;
  min-width: 50px;
  border-radius: 8px;
  overflow: hidden;
  margin-right: 15px;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.spotlight-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spotlight-item-content {
  flex: 1;
  overflow: hidden;
}

.spotlight-item-title {
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #333;
  font-size: 16px; /* Fuente más grande */
}

.spotlight-item-details {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px; /* Fuente más grande */
  margin-bottom: 4px;
}

.spotlight-item-id {
  color: #555;
  font-weight: 500;
}

.spotlight-item-category {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  font-weight: 500;
}

.spotlight-item-serial {
  font-size: 14px;
  color: #555;
  margin-top: 4px;
}

.spotlight-item-serial-count {
  background-color: rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-size: 12px;
}

/* Estados de carga y error */
.spotlight-loading,
.spotlight-no-results,
.spotlight-error {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  color: #555;
  text-align: center;
  gap: 12px;
  font-size: 16px; /* Fuente más grande */
}

.spotlight-error {
  color: #dc3545;
}

.spotlight-no-results i,
.spotlight-error i {
  font-size: 20px;
  margin-right: 10px;
}

/* Pie de resultados */
.spotlight-footer {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 12px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 14px; /* Fuente más grande */
  color: #777;
  background-color: rgba(0, 0, 0, 0.02);
}

.spotlight-footer i {
  font-size: 12px;
}

/* Resaltado de coincidencias */
.spotlight-item mark {
  background-color: rgba(255, 193, 7, 0.4);
  padding: 0 2px;
  border-radius: 2px;
  color: inherit;
  font-weight: 600;
}

/* Indicador de atajo de teclado */
.search-shortcut-indicator {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.05);
  color: #777;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.search-shortcut-indicator.active {
  background-color: rgba(0, 123, 255, 0.2);
  color: #0d6efd;
}

.search-shortcut-indicator kbd {
  background-color: #f8f9fa;
  border: 1px solid #d3d3d3;
  border-radius: 3px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  color: #333;
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 5px;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
  .spotlight-footer {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px;
  }

  .spotlight-item-details {
    flex-wrap: wrap;
  }

  .spotlight-item-image {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
}

/* Añadir al final del archivo */

/* Modificar el overlay para que tenga un recorte (clip-path) alrededor del cuadro de búsqueda */
.spotlight-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none; /* Permite hacer clic a través del overlay por defecto */
  /* Eliminar cualquier clip-path existente */
  clip-path: none;
}

.spotlight-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* Habilita los eventos de clic cuando está activo */
}

/* Eliminar estilos que intentan poner el cuadro de búsqueda por encima del overlay */
.spotlight-active .navbar-header .input-group,
.spotlight-active .dropdown-search {
  position: relative;
  /* Eliminar z-index para evitar conflictos */
  z-index: auto;
}

/* Eliminar estilos específicos para el cuadro de búsqueda cuando spotlight está activo */
.spotlight-active .navbar-header .form-control,
.spotlight-active .dropdown-search .form-control,
.spotlight-active .spotlight-results {
  /* Eliminar estilos que podrían estar causando problemas */
  filter: none;
  opacity: 1;
  background-color: white;
}

/* Eliminar el resplandor alrededor del cuadro de búsqueda */
.spotlight-active .navbar-header .input-group::after,
.spotlight-active .dropdown-search::after {
  content: none;
}

/* Efecto de pulso para el indicador de atajo */
.search-shortcut-indicator.pulse {
  animation: pulse-animation 1s ease-in-out;
}

@keyframes pulse-animation {
  0% {
    transform: translateY(-50%) scale(1);
    background-color: rgba(0, 123, 255, 0.2);
  }
  50% {
    transform: translateY(-50%) scale(1.1);
    background-color: rgba(0, 123, 255, 0.4);
  }
  100% {
    transform: translateY(-50%) scale(1);
    background-color: rgba(0, 123, 255, 0.2);
  }
}

/* Asegurar que el contenedor de búsqueda esté por encima del overlay */
.spotlight-active .navbar-header .input-group,
.spotlight-active .dropdown-search {
  position: relative;
  z-index: 1050;
}

/* Estilos específicos para el cuadro de búsqueda y resultados cuando spotlight está activo */
.spotlight-active .navbar-header .form-control,
.spotlight-active .dropdown-search .form-control,
.spotlight-active .spotlight-results {
  filter: none !important; /* Evitar que se aplique cualquier filtro */
  opacity: 1 !important; /* Asegurar opacidad completa */
  background-color: white !important; /* Forzar fondo blanco */
}

/* Añadir un resplandor alrededor del cuadro de búsqueda */
.spotlight-active .navbar-header .input-group::after,
.spotlight-active .dropdown-search::after {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
  z-index: 1045;
  pointer-events: none;
  border-radius: 8px;
}

/* NUEVO: Modal de búsqueda tipo Spotlight */
.spotlight-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.spotlight-modal.active {
  opacity: 1;
  visibility: visible;
}

.spotlight-modal-content {
  width: 650px;
  max-width: 95vw;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.spotlight-modal.active .spotlight-modal-content {
  transform: translateY(0);
}

.spotlight-modal-header {
  padding: 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
}

.spotlight-modal-search {
  width: 100%;
  padding: 10px 15px;
  font-size: 16px;
  border: 2px solid #e1e1e1;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.spotlight-modal-search:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.spotlight-modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

.spotlight-modal-footer {
  padding: 10px 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #777;
}

.spotlight-modal-shortcuts {
  display: flex;
  gap: 15px;
}

.spotlight-modal-shortcut {
  display: flex;
  align-items: center;
  gap: 5px;
}

.spotlight-modal-shortcut kbd {
  background-color: #f8f9fa;
  border: 1px solid #d3d3d3;
  border-radius: 3px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  color: #333;
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 5px;
  white-space: nowrap;
}

/* Estilos para el botón de búsqueda en la barra de navegación */
#spotlight-search-btn {
  background: rgba(0, 0, 0, .18) !important;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, .05);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
}

#spotlight-search-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.search-shortcut {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  padding: 2px 4px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-size: 12px;
}

.search-kbd kbd {
  background-color: rgba(0, 0, 0, 0.5)!important;
  border: 0;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.8);
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 4px;
  white-space: nowrap;
}

/* Estilos para el botón de búsqueda móvil */
#spotlight-search-btn-mobile {
  font-size: 18px;
  color: white;
}

/* Efecto de pulso para el botón de búsqueda */
@keyframes pulse-animation {
  0% {
    transform: scale(1);
    background-color: rgba(255, 255, 255, 0.1);
  }
  50% {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.2);
  }
  100% {
    transform: scale(1);
    background-color: rgba(255, 255, 255, 0.1);
  }
}

.pulse {
  animation: pulse-animation 1s ease-in-out;
}
