/**
 * Fijate Tools - Smart Search & Spotlight Engine Stylesheet
 * Estilos modernos con soporte Glassmorphism y modos oscuro/claro
 */

/* ==========================================================================
   1. CONTENEDOR PRINCIPAL Y BARRA DE BÚSQUEDA
   ========================================================================== */
.tools-search-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 0;
}

.tools-search-input:focus {
  border-color: var(--accent-orange) !important;
  box-shadow: 0 0 0 3px rgba(255, 133, 7, 0.2), 0 8px 24px rgba(0, 0, 0, 0.25) !important;
}

/* ==========================================================================
   2. PÍLDORAS RÁPIDAS DE TENDENCIAS EN ESPAÑA (QUICK CHIPS)
   ========================================================================== */
.tools-quick-chips-wrapper {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0.35rem 0.15rem 0.25rem 0.15rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-top: 0.4rem;
  margin-bottom: 0;
}

.tools-quick-chips-wrapper::-webkit-scrollbar {
  display: none;
}

.tools-quick-chips-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-orange);
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 0.3rem;
  text-shadow: 0 0 10px rgba(255, 133, 7, 0.3);
}

.tools-quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.95rem;
  min-height: 36px;
  background: #182234;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  color: #e2e8f0;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: inherit;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.tools-quick-chip:hover {
  background: rgba(255, 133, 7, 0.18);
  color: #ffffff;
  border-color: rgba(255, 133, 7, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 133, 7, 0.25);
}

.tools-quick-chip svg {
  color: var(--accent-orange);
  flex-shrink: 0;
}

[data-theme="light"] .tools-quick-chip {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .tools-quick-chip:hover {
  background: rgba(255, 133, 7, 0.1);
  color: var(--accent-orange);
  border-color: var(--accent-orange);
  box-shadow: 0 4px 12px rgba(255, 133, 7, 0.15);
}

/* ==========================================================================
   3. PANEL SPOTLIGHT DESPLEGABLE (COMMAND PALETTE)
   ========================================================================== */
.tools-spotlight-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(17, 24, 39, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 133, 7, 0.35);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 1200;
  overflow: hidden;
  display: none;
  animation: spotlightFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

[data-theme="light"] .tools-spotlight-dropdown {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(255, 133, 7, 0.4);
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.tools-spotlight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

[data-theme="light"] .tools-spotlight-header {
  background: #f8fafc;
}

.tools-spotlight-counter {
  color: var(--accent-orange);
  font-weight: 700;
}

.tools-spotlight-hints {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tools-spotlight-hint-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-card);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.tools-spotlight-list {
  list-style: none;
  padding: 0.4rem;
  margin: 0;
  max-height: min(480px, calc(100vh - 160px));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 133, 7, 0.4) transparent;
}

.tools-spotlight-list::-webkit-scrollbar {
  width: 6px;
}

.tools-spotlight-list::-webkit-scrollbar-thumb {
  background: rgba(255, 133, 7, 0.3);
  border-radius: 4px;
}

/* Elemento individual de resultado */
.tools-spotlight-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.14s ease;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
}

.tools-spotlight-item:hover,
.tools-spotlight-item.is-selected {
  background: rgba(255, 133, 7, 0.12);
  border-color: rgba(255, 133, 7, 0.3);
  transform: translateX(2px);
}

[data-theme="light"] .tools-spotlight-item:hover,
[data-theme="light"] .tools-spotlight-item.is-selected {
  background: rgba(255, 133, 7, 0.08);
  border-color: rgba(255, 133, 7, 0.25);
}

/* Miniatura o icono del resultado */
.tools-spotlight-thumb {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tools-spotlight-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tools-spotlight-thumb svg {
  color: var(--accent-orange);
}

.tools-spotlight-info {
  flex: 1 1 0%;
  min-width: 0;
}

.tools-spotlight-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
  flex-wrap: wrap;
}

.tools-spotlight-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tools-spotlight-highlight {
  color: var(--accent-orange);
  background: rgba(255, 133, 7, 0.15);
  padding: 0 0.2rem;
  border-radius: 3px;
}

.tools-spotlight-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  white-space: nowrap;
  line-height: 1.2;
}

.badge-cat {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.badge-local {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.badge-server {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.28);
}

.tools-spotlight-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tools-spotlight-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.tools-spotlight-item:hover .tools-spotlight-action,
.tools-spotlight-item.is-selected .tools-spotlight-action {
  background: var(--accent-orange);
  color: #0b0f17;
  transform: translateX(2px);
}

/* Pie del spotlight */
.tools-spotlight-footer {
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

[data-theme="light"] .tools-spotlight-footer {
  background: #f1f5f9;
}

.tools-spotlight-btn-view-all {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: var(--accent-orange);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.tools-spotlight-btn-view-all:hover {
  background: rgba(255, 133, 7, 0.15);
  text-decoration: underline;
}

/* Estado sin resultados dentro del Spotlight */
.tools-spotlight-empty {
  padding: 2rem 1.5rem;
  text-align: center;
}

.tools-spotlight-empty h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.35rem 0;
}

.tools-spotlight-empty p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}

.tools-spotlight-empty-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.tools-spotlight-empty-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.25rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tools-spotlight-empty-chip:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

/* Adaptación responsiva en móviles */
@media (max-width: 640px) {
  .tools-spotlight-dropdown {
    position: fixed;
    top: 60px;
    left: 8px;
    right: 8px;
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    z-index: 9999;
  }

  .tools-spotlight-list {
    max-height: calc(100vh - 180px);
  }

  .tools-spotlight-hints {
    display: none;
  }

  .tools-spotlight-desc {
    display: none;
  }

  .tools-spotlight-item {
    min-height: 48px;
    padding: 0.65rem;
  }
}

/* ==========================================================================
   4. BLOQUE DE AUTORIDAD GEO Y RESPUESTA DIRECTA (GEO - GENERATIVE OPTIMIZATION)
   ========================================================================== */
.tools-geo-authority {
  margin-top: 1.5rem;
  padding: 0.75rem 1.15rem;
  background: rgba(255, 133, 7, 0.08);
  border: 1px solid rgba(255, 133, 7, 0.25);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
  text-align: left;
}

[data-theme="light"] .tools-geo-authority {
  background: rgba(255, 133, 7, 0.06);
  border-color: rgba(255, 133, 7, 0.3);
}

.tools-geo-authority svg {
  color: var(--accent-orange);
  flex-shrink: 0;
}

.tools-geo-authority p {
  margin: 0;
}

.tools-geo-authority strong {
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .tools-geo-authority {
    font-size: 0.78rem;
    padding: 0.65rem 0.85rem;
  }
}

/* ==========================================================================
   5. AJUSTES RESPONSIVOS MÓVILES (LIMPIEZA DE LÍNEAS Y CONTENCIÓN)
   ========================================================================== */
@media (max-width: 768px) {
  .tools-search-wrapper {
    border: none !important;
    box-shadow: none !important;
  }

  .tools-quick-chips-wrapper {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    margin-top: 0.25rem;
    padding: 0.2rem 0.15rem;
    gap: 0.45rem;
  }

  .tools-quick-chip {
    padding: 0.35rem 0.75rem;
    min-height: 32px;
    font-size: 0.78rem;
  }
}

