/* assets/ab-search.css - Buscador interno ligero y accesible */
.ab-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.ab-search-trigger:hover,
.ab-search-trigger:focus-visible {
  background: rgba(94, 234, 212, 0.12);
  border-color: #5eead4;
  color: #f8fafc;
  outline: none;
}

.ab-search-kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  color: #94a3b8;
}

/* Modal overlay */
.ab-search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 15, 29, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 1rem 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ab-search-modal.is-open {
  display: flex;
  opacity: 1;
}

.ab-search-dialog {
  background: #0f172a;
  border: 1px solid rgba(94, 234, 212, 0.25);
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 30px rgba(94, 234, 212, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ab-search-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #131d35;
}

.ab-search-box svg {
  color: #5eead4;
  flex-shrink: 0;
}

.ab-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 1rem;
  outline: none;
  font-family: inherit;
}

.ab-search-input::placeholder {
  color: #64748b;
}

.ab-search-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.ab-search-close:hover,
.ab-search-close:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.ab-search-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
  list-style: none;
  margin: 0;
}

.ab-search-item {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: #e2e8f0;
  text-decoration: none;
  transition: background 0.15s ease;
  margin-bottom: 0.25rem;
}

.ab-search-item:hover,
.ab-search-item.is-selected,
.ab-search-item:focus-visible {
  background: rgba(94, 234, 212, 0.12);
  outline: none;
}

.ab-search-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.ab-search-item-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: #f8fafc;
}

.ab-search-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ab-badge-problema { background: rgba(239, 68, 68, 0.18); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.ab-badge-proceso { background: rgba(59, 130, 246, 0.18); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.ab-badge-glosario { background: rgba(168, 85, 247, 0.18); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.ab-badge-kpi { background: rgba(34, 197, 94, 0.18); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.ab-badge-norma { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.ab-badge-industria { background: rgba(14, 165, 233, 0.18); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.3); }

.ab-search-item-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.35;
}

.ab-search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #0b1120;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  color: #64748b;
}

.ab-search-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .ab-search-modal { padding-top: 2rem; }
  .ab-search-footer { display: none; }
  .ab-search-kbd { display: none; }
}
