/* ═══════════════════════════════════════════════════════════════════════════
 * spotlight.css — Estilo Apple / Linear / Raycast
 * ═══════════════════════════════════════════════════════════════════════════ */

#thor-spotlight {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
    'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

#thor-spotlight.open {
  display: block;
  animation: spot-fade-in .15s ease-out;
}

@keyframes spot-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#thor-spotlight .spot-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
}

#thor-spotlight .spot-modal {
  position: absolute;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px));
  max-height: 70vh;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .05),
    0 12px 40px -4px rgba(0, 0, 0, .25),
    0 24px 80px -12px rgba(0, 0, 0, .15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: spot-modal-pop .2s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes spot-modal-pop {
  from { transform: translate(-50%, -8px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}

/* Dark mode */
[data-theme="dark"] #thor-spotlight .spot-modal {
  background: rgba(28, 28, 30, .96);
  color: #e5e7eb;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .08),
    0 12px 40px -4px rgba(0, 0, 0, .6),
    0 24px 80px -12px rgba(0, 0, 0, .5);
}

/* ─── Input row ──────────────────────────────────────────────────────── */
#thor-spotlight .spot-input-row {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  gap: 12px;
}
[data-theme="dark"] #thor-spotlight .spot-input-row {
  border-bottom-color: rgba(255, 255, 255, .08);
}

#thor-spotlight .spot-search-icon {
  font-size: 18px;
  opacity: .55;
}

#thor-spotlight .spot-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
  font-weight: 400;
  color: #0f172a;
  letter-spacing: -0.01em;
  padding: 2px 0;
}
[data-theme="dark"] #thor-spotlight .spot-input { color: #e5e7eb; }

#thor-spotlight .spot-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

#thor-spotlight .spot-kbd-esc {
  font-size: 10px;
  padding: 3px 7px;
  background: rgba(0, 0, 0, .06);
  color: #64748b;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: .05em;
}
[data-theme="dark"] #thor-spotlight .spot-kbd-esc {
  background: rgba(255, 255, 255, .12);
  color: #cbd5e1;
}

/* ─── Hints (atajos) ─────────────────────────────────────────────────── */
#thor-spotlight .spot-hints {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px 10px;
  font-size: 11px;
  color: #64748b;
  border-bottom: 1px solid rgba(0, 0, 0, .04);
  flex-wrap: wrap;
}
[data-theme="dark"] #thor-spotlight .spot-hints {
  color: #94a3b8;
  border-bottom-color: rgba(255, 255, 255, .06);
}
#thor-spotlight .spot-hints span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
#thor-spotlight .spot-hints kbd {
  display: inline-block;
  font-family: inherit;
  font-size: 10px;
  padding: 1px 6px;
  background: rgba(0, 0, 0, .06);
  border-radius: 3px;
  font-weight: 600;
}
[data-theme="dark"] #thor-spotlight .spot-hints kbd {
  background: rgba(255, 255, 255, .12);
}

/* ─── Resultados ─────────────────────────────────────────────────────── */
#thor-spotlight .spot-results {
  flex: 1;
  overflow-y: auto;
  padding: 6px 6px 8px;
  scroll-behavior: smooth;
}

#thor-spotlight .spot-section {
  padding: 4px 0;
}

#thor-spotlight .spot-section-title {
  padding: 10px 14px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #94a3b8;
}
[data-theme="dark"] #thor-spotlight .spot-section-title { color: #64748b; }

#thor-spotlight .spot-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .08s ease;
  margin: 0 6px;
}

#thor-spotlight .spot-item.selected {
  background: linear-gradient(135deg, rgba(249, 115, 22, .12), rgba(234, 88, 12, .08));
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, .18);
}
[data-theme="dark"] #thor-spotlight .spot-item.selected {
  background: linear-gradient(135deg, rgba(249, 115, 22, .18), rgba(234, 88, 12, .12));
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, .28);
}

#thor-spotlight .spot-item-icon {
  flex-shrink: 0;
  font-size: 18px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .04);
  border-radius: 8px;
}
[data-theme="dark"] #thor-spotlight .spot-item-icon {
  background: rgba(255, 255, 255, .06);
}

#thor-spotlight .spot-item-body {
  flex: 1;
  min-width: 0;
}

#thor-spotlight .spot-item-title {
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
}
[data-theme="dark"] #thor-spotlight .spot-item-title { color: #f1f5f9; }

#thor-spotlight .spot-item-meta {
  display: flex;
  gap: 4px;
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-theme="dark"] #thor-spotlight .spot-item-meta { color: #94a3b8; }

#thor-spotlight .spot-item-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

#thor-spotlight mark {
  background: rgba(249, 115, 22, .25);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

/* ─── Empty state ────────────────────────────────────────────────────── */
#thor-spotlight .spot-empty {
  padding: 60px 20px;
  text-align: center;
}

#thor-spotlight .spot-empty-emoji {
  font-size: 40px;
  opacity: .35;
  margin-bottom: 12px;
}

#thor-spotlight .spot-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}
[data-theme="dark"] #thor-spotlight .spot-empty-title { color: #cbd5e1; }

#thor-spotlight .spot-empty-subtitle {
  font-size: 13px;
  color: #94a3b8;
}

#thor-spotlight .spot-empty kbd {
  display: inline-block;
  font-family: inherit;
  font-size: 11px;
  padding: 1px 6px;
  background: rgba(0, 0, 0, .06);
  border-radius: 3px;
  font-weight: 600;
  margin: 0 2px;
}
[data-theme="dark"] #thor-spotlight .spot-empty kbd {
  background: rgba(255, 255, 255, .12);
}

/* ─── Footer ─────────────────────────────────────────────────────────── */
#thor-spotlight .spot-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-top: 1px solid rgba(0, 0, 0, .06);
  font-size: 11px;
  color: #94a3b8;
}
[data-theme="dark"] #thor-spotlight .spot-footer {
  border-top-color: rgba(255, 255, 255, .08);
  color: #64748b;
}

#thor-spotlight .spot-brand {
  font-weight: 600;
  letter-spacing: .02em;
}

/* ─── Scrollbar elegante ─────────────────────────────────────────────── */
#thor-spotlight .spot-results::-webkit-scrollbar {
  width: 8px;
}
#thor-spotlight .spot-results::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .15);
  border-radius: 4px;
}
#thor-spotlight .spot-results::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, .25);
}
[data-theme="dark"] #thor-spotlight .spot-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .15);
}

/* Respetar reduced-motion */
@media (prefers-reduced-motion: reduce) {
  #thor-spotlight.open,
  #thor-spotlight .spot-modal {
    animation: none !important;
  }
}

/* Móvil */
@media (max-width: 600px) {
  #thor-spotlight .spot-modal {
    top: 8vh;
    width: calc(100vw - 16px);
    max-height: 80vh;
  }
  #thor-spotlight .spot-hints {
    font-size: 10px;
    gap: 8px;
  }
  #thor-spotlight .spot-input { font-size: 16px; }
}
