/* Search Window chrome — layout + dialog backdrop.
   Beam animation: npm `border-beam` via js/search-window.js (21st Jakubantalik). */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

dialog[data-ask-ai-dialog]::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

dialog[data-ask-ai-dialog] {
  margin: auto;
}

/* 21st @ruixen.ui/pill-morph-tabs — Ask AI quick section nav */
[data-pill-morph] {
  margin: 0 0 14px;
  width: 100%;
}

[data-pill-morph-track] {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-pill-morph-indicator] {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 999px;
  background: #f4f4f5;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  transition:
    transform 0.45s cubic-bezier(0.34, 1.45, 0.64, 1),
    width 0.45s cubic-bezier(0.34, 1.45, 0.64, 1),
    height 0.45s cubic-bezier(0.34, 1.45, 0.64, 1),
    opacity 0.2s ease;
  will-change: transform, width, height;
}

[data-pill-morph-glow] {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.35), rgba(180, 180, 190, 0.2));
  filter: blur(16px);
  opacity: 0.45;
  mix-blend-mode: screen;
  pointer-events: none;
  transition:
    transform 0.45s cubic-bezier(0.34, 1.45, 0.64, 1),
    width 0.45s cubic-bezier(0.34, 1.45, 0.64, 1),
    height 0.45s cubic-bezier(0.34, 1.45, 0.64, 1),
    opacity 0.2s ease;
  will-change: transform, width, height;
}

[data-pill-morph-track] > button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.45rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #d4d4d8;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease;
}

[data-pill-morph-track] > button:hover,
[data-pill-morph-track] > button:focus-visible {
  color: #fff;
}

/* Dark text only while white morph pill sits under the button */
[data-pill-morph-track] > button[data-pill-on="true"] {
  color: #0b0b0c;
}

[data-pill-morph-track] > button:focus-visible {
  outline: 2px solid var(--focus, #c8c8c8);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  [data-pill-morph-track] {
    border-radius: 1.25rem;
  }

  #nl-search-root kbd {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-pill-morph-indicator],
  [data-pill-morph-glow] {
    transition: none !important;
  }
}
