/* ==========================================================================
   Spotlight / Command Palette (Cmd+K) - Ultra Minimalist & Snake Border Beam
   High-Tech Cupertino & Raycast Engineering Standard
   ========================================================================== */

.spotlight-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  padding-left: 1rem;
  padding-right: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
}

[data-theme="dark"] .spotlight-modal,
html.dark .spotlight-modal {
  background-color: rgba(0, 0, 0, 0.65);
}

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

/* Outer frame with dynamic snake beam padding */
.spotlight-dialog {
  position: relative;
  width: 100%;
  max-width: 600px;
  padding: 1.5px; /* The snake beam perimeter channel */
  border-radius: 20px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.08); /* Crisp subtle border track in light mode */
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.22), 0 0 35px -8px rgba(0, 113, 227, 0.18);
  transform: scale(0.96) translateY(-12px);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .spotlight-dialog,
html.dark .spotlight-dialog {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.65), 0 0 40px -8px rgba(10, 132, 255, 0.28);
}

.spotlight-modal.is-open .spotlight-dialog {
  transform: scale(1) translateY(0);
}

/* ==========================================================================
   Snake Border Beam Animation (Rotates continuously around modal perimeter)
   ========================================================================== */

/* Light Mode: High-contrast rich Apple Blue & Cyan Snake (Sharp & vivid against white) */
.spotlight-border-beam {
  position: absolute;
  inset: -150%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    transparent 260deg,
    rgba(0, 113, 227, 0.1) 285deg,
    rgba(0, 150, 255, 0.5) 315deg,
    #0091FF 335deg,
    #0071E3 350deg,
    #004DB3 358deg,
    #002D6E 360deg
  );
  animation: spotlight-snake-spin 3.5s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Dark Mode: Electric Neon Cyan, Azure & White Snake */
[data-theme="dark"] .spotlight-border-beam,
html.dark .spotlight-border-beam {
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    transparent 250deg,
    rgba(10, 132, 255, 0.15) 280deg,
    rgba(100, 210, 255, 0.7) 320deg,
    #0A84FF 345deg,
    #64D2FF 356deg,
    #FFFFFF 360deg
  );
}

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

/* Inner content: 100% OPAQUE to prevent the rotating gradient from bleeding inside */
.spotlight-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 18.5px;
  background-color: #FFFFFF; /* Pure crisp white in daytime mode */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

[data-theme="dark"] .spotlight-inner,
html.dark .spotlight-inner {
  background-color: #1C1C1E; /* Crisp Apple dark surface in dark mode */
}

/* Input Area */
.spotlight-input-wrapper {
  display: flex;
  align-items: center;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  gap: 0.85rem;
  background: #FFFFFF;
}

[data-theme="dark"] .spotlight-input-wrapper,
html.dark .spotlight-input-wrapper {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #1C1C1E;
}

.spotlight-search-icon {
  width: 18px;
  height: 18px;
  color: #0071E3;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .spotlight-search-icon,
html.dark .spotlight-search-icon {
  color: #2997FF;
}

.spotlight-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 450;
  color: #1D1D1F;
  letter-spacing: -0.012em;
}

[data-theme="dark"] .spotlight-input,
html.dark .spotlight-input {
  color: #F5F5F7;
}

.spotlight-input::placeholder {
  color: #86868B;
  font-weight: 400;
}

[data-theme="dark"] .spotlight-input::placeholder,
html.dark .spotlight-input::placeholder {
  color: #6E6E73;
}

.spotlight-kbd-esc {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  background-color: #F5F5F7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #6E6E73;
  letter-spacing: 0.04em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .spotlight-kbd-esc,
html.dark .spotlight-kbd-esc {
  background-color: #2C2C2E;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #A1A1A6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Minimalist Tag Filter Bar */
.spotlight-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  background-color: #FAFAFC;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

[data-theme="dark"] .spotlight-filter-bar,
html.dark .spotlight-filter-bar {
  background-color: #161618;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.spotlight-filter-bar::-webkit-scrollbar {
  display: none;
}

.spotlight-filter-chip {
  display: inline-flex;
  align-items: center;
  height: 25px;
  padding: 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #555559;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

[data-theme="dark"] .spotlight-filter-chip,
html.dark .spotlight-filter-chip {
  background: #242426;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #A1A1A6;
}

.spotlight-filter-chip:hover {
  background: #F0F0F3;
  color: #1D1D1F;
  border-color: rgba(0, 0, 0, 0.18);
  transform: translateY(-0.5px);
}

[data-theme="dark"] .spotlight-filter-chip:hover,
html.dark .spotlight-filter-chip:hover {
  background: #2C2C2E;
  color: #F5F5F7;
  border-color: rgba(255, 255, 255, 0.2);
}

.spotlight-filter-chip.is-active {
  background: #0071E3;
  color: #FFFFFF;
  border-color: #0071E3;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
  font-weight: 600;
}

[data-theme="dark"] .spotlight-filter-chip.is-active,
html.dark .spotlight-filter-chip.is-active {
  background: #0A84FF;
  color: #FFFFFF;
  border-color: #0A84FF;
  box-shadow: 0 0 12px rgba(10, 132, 255, 0.4);
}

/* Results List with Custom Thin Scrollbar */
.spotlight-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.45rem 0.55rem;
  list-style: none;
  margin: 0;
  background: #FFFFFF;
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 140, 145, 0.3) transparent;
}

[data-theme="dark"] .spotlight-results,
html.dark .spotlight-results {
  background: #1C1C1E;
}

.spotlight-results::-webkit-scrollbar {
  width: 5px;
}

.spotlight-results::-webkit-scrollbar-track {
  background: transparent;
}

.spotlight-results::-webkit-scrollbar-thumb {
  background: rgba(140, 140, 145, 0.3);
  border-radius: 10px;
}

.spotlight-results::-webkit-scrollbar-thumb:hover {
  background: rgba(140, 140, 145, 0.5);
}

[data-theme="dark"] .spotlight-results::-webkit-scrollbar-thumb,
html.dark .spotlight-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .spotlight-results::-webkit-scrollbar-thumb:hover,
html.dark .spotlight-results::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

.spotlight-group-title {
  font-size: 0.67rem;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #86868B;
  padding: 0.65rem 0.75rem 0.25rem;
}

[data-theme="dark"] .spotlight-group-title,
html.dark .spotlight-group-title {
  color: #6E6E73;
}

.spotlight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  color: #1D1D1F;
  font-family: var(--font-sans);
  font-size: 0.89rem;
  transition: all 0.12s ease;
  margin-bottom: 2px;
}

[data-theme="dark"] .spotlight-item,
html.dark .spotlight-item {
  color: #F5F5F7;
}

.spotlight-item:hover,
.spotlight-item.is-selected {
  background-color: rgba(0, 113, 227, 0.08);
  color: #0071E3;
  transform: translateX(2px);
}

[data-theme="dark"] .spotlight-item:hover,
[data-theme="dark"] .spotlight-item.is-selected,
html.dark .spotlight-item:hover,
html.dark .spotlight-item.is-selected {
  background-color: rgba(10, 132, 255, 0.15);
  color: #2997FF;
}

.spotlight-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.spotlight-item-icon {
  width: 16px;
  height: 16px;
  color: #86868B;
  flex-shrink: 0;
  transition: color 0.12s ease;
}

[data-theme="dark"] .spotlight-item-icon,
html.dark .spotlight-item-icon {
  color: #8E8E93;
}

.spotlight-item.is-selected .spotlight-item-icon {
  color: #0071E3;
}

[data-theme="dark"] .spotlight-item.is-selected .spotlight-item-icon,
html.dark .spotlight-item.is-selected .spotlight-item-icon {
  color: #2997FF;
}

.spotlight-item-title {
  font-size: 0.89rem;
  font-weight: 450;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
}

.spotlight-item-badge {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background-color: #F5F5F7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #6E6E73;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

[data-theme="dark"] .spotlight-item-badge,
html.dark .spotlight-item-badge {
  background-color: #242426;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #8E8E93;
}

.spotlight-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #86868B;
  font-size: 0.88rem;
}

[data-theme="dark"] .spotlight-empty,
html.dark .spotlight-empty {
  color: #6E6E73;
}

/* Minimalist Footer */
.spotlight-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background-color: #FAFAFC;
  font-size: 0.74rem;
  color: #86868B;
}

[data-theme="dark"] .spotlight-footer,
html.dark .spotlight-footer {
  background-color: #161618;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #6E6E73;
}

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

.spotlight-hints span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.spotlight-hints kbd {
  padding: 0.12rem 0.35rem;
  background-color: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: #333336;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .spotlight-hints kbd,
html.dark .spotlight-hints kbd {
  background-color: #242426;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #F5F5F7;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.spotlight-tech-brand {
  font-family: var(--font-mono);
  font-size: 0.70rem;
  color: #86868B;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .spotlight-tech-brand,
html.dark .spotlight-tech-brand {
  color: #6E6E73;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .spotlight-modal {
    padding-top: 5vh;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .spotlight-dialog {
    max-width: 100%;
    border-radius: 18px;
  }

  .spotlight-inner {
    border-radius: 16.5px;
  }

  .spotlight-results {
    max-height: 52vh;
  }

  .spotlight-footer {
    padding: 0.5rem 0.85rem;
    font-size: 0.70rem;
  }

  .spotlight-tech-brand {
    display: none;
  }
}
