/*
 * AttentionGlyph: a rounded square three quarters of the icon size (12px at md), transparent with an accent mark at
 * rest, tinted when it contains the attended item and filled with the accent when attended. The mark (presence dots
 * or the syncing spinner) fills the square; the spinner turns at half Icon's speed, as a background activity.
 */

@layer dx-components {
  .dx-attention-glyph {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: calc(var(--dx-icon-size) * 0.75);
    height: calc(var(--dx-icon-size) * 0.75);
    border-radius: var(--radius-xs, 0.125rem);
    background: transparent;
    color: var(--color-accent-text);
    transition:
      background-color 150ms,
      color 150ms;
  }
  .dx-attention-glyph[data-contains-attended] {
    background: var(--color-attention-contains);
  }
  .dx-attention-glyph[data-attended] {
    background: var(--color-accent-bg);
    color: var(--color-accent-fg);
  }

  .dx-attention-glyph-mark,
  .dx-attention-glyph > .dx-icon {
    width: 100%;
    height: 100%;
  }
  .dx-attention-glyph[data-syncing] > .dx-icon {
    color: var(--color-fg-subtle);
    animation-duration: 2s;
  }

  @media (prefers-reduced-motion: reduce) {
    .dx-attention-glyph {
      transition: none;
    }
  }
}
