/* What the page says back: the busy bar and failure notice for slow requests,
   and the tag suggestions that float under a box. */

/* Activity. While a request runs for more than a moment, a thin bar slides
   along the top of the window (app.js sets `data-busy` on the page), and the
   form that asked is dimmed and can't be pressed again. The search form and
   the quick-add input are left alone: they send a request as you type. */
html[data-busy] body::before {
  content: "";
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  height: 0.1875rem;
  background: linear-gradient(
      90deg,
      transparent,
      var(--color-accent-base),
      transparent
    )
    no-repeat;
  background-size: 40% 100%;
  animation: busy-slide 1.1s linear infinite;
}

@keyframes busy-slide {
  from {
    background-position: -40% 0;
  }

  to {
    background-position: 140% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-busy] body::before {
    background: var(--color-accent-base);
    animation: none;
  }
}

li > form.htmx-request,
.quick.htmx-request,
button.htmx-request,
a.htmx-request {
  opacity: 0.6;
  pointer-events: none;
  cursor: progress;
}

/* A message about a request that failed, at the bottom of the window. */
.notice {
  position: fixed;
  z-index: 30;
  right: var(--space-4);
  bottom: var(--space-4);
  left: var(--space-4);
  max-width: 28rem;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  border-left: 0.25rem solid var(--color-danger-base);
  border-radius: var(--radius-md);
  background: var(--color-danger-subtle);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-md);
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.notice[hidden] {
  display: none;
}

/* Tag suggestions under a box (see suggest.js): a small list that floats over
   the page. Its position is set by the script. */
.suggest {
  position: fixed;
  z-index: 50;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-md);
}

.suggest[hidden] {
  display: none;
}

.suggest li {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.suggest li[aria-selected],
.suggest li:hover {
  background: var(--color-accent-subtle);
}
