.Root {
  color: var(--demo-neutral-fg);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  width: 100%;

  &[data-orientation='vertical'] {
    max-width: 16rem;
  }
}

.Label {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--demo-neutral-fg);
  user-select: none;
}

.ValueText {
  font-weight: 400;
  color: var(--demo-coral-fg);
}

.Content {
  display: flex;
  flex-direction: column;
  padding: 0.25rem;
  background: var(--demo-bg-popover);
  border: 1px solid var(--demo-border-emphasized);
  border-radius: 0.375rem;
  max-height: 18rem;
  overflow-y: auto;
  outline: none;

  scrollbar-width: thin;
  scrollbar-color: var(--demo-border-emphasized) var(--demo-bg-popover);

  &::-webkit-scrollbar {
    width: 8px;
    background: var(--demo-bg-popover);
    border-radius: 4px;
  }

  &::-webkit-scrollbar-thumb {
    border-radius: 0.375rem;
    background: var(--demo-border-emphasized);
  }

  &[data-orientation='horizontal'] {
    flex-direction: row;
    max-height: none;
    max-width: max-content;
    overflow-x: auto;
    overflow-y: hidden;
  }
}

.ItemCard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  border-radius: 0.375rem;

  user-select: none;
  outline: none;

  &:is(:hover, [data-highlighted]) {
    background: var(--demo-neutral-subtle);
  }

  &[data-state='checked'] {
    outline: 2px solid var(--demo-coral-solid);
    outline-offset: -2px;
  }

  &[data-disabled] {
    filter: grayscale(100%);
    opacity: 0.5;
  }
}

.ItemCardImage {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 0.25rem;
}

.ItemCardTitle {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--demo-neutral-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

.ItemCardArtist {
  font-size: 0.75rem;
  color: var(--demo-neutral-emphasized);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

.ItemCardIndicator {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--demo-coral-solid);
  color: white;
  border-radius: 9999px;

  & svg {
    width: 0.75rem;
    height: 0.75rem;
  }
}

.SelectAllHeader {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
}

.Empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  font-size: 0.875rem;
  color: var(--demo-neutral-emphasized);
}

.SelectAllHeaderIndicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid transparent;
  background: var(--demo-coral-solid);
  color: white;
  border-radius: 0.25rem;

  & svg {
    width: 0.875rem;
    height: 0.875rem;
  }

  &:empty {
    background: transparent;
    border-color: var(--demo-border-emphasized);
  }
}

.GridContent {
  display: grid;
  grid-template-columns: repeat(var(--column-count, 5), 1fr);
  gap: 0.25rem;
  padding: 0.5rem;
  background: var(--demo-bg-popover);
  border: 1px solid var(--demo-border-emphasized);
  border-radius: 0.375rem;
  max-width: max-content;
  outline: none;
}

.GridItem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.25rem;
  border-radius: 0.375rem;

  user-select: none;
  outline: none;

  &:hover {
    background: var(--demo-neutral-subtle);
  }

  &[data-highlighted] {
    outline: 2px solid var(--demo-coral-solid);
    outline-offset: -2px;
  }

  &[data-state='checked'] {
    background: var(--demo-coral-subtle);
  }

  &[data-disabled] {
    opacity: 0.5;
  }
}

.ItemGroup {
  display: flex;
  flex-direction: column;

  & + & {
    margin-top: 0.5rem;
  }
}

.ItemGroupLabel {
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--demo-neutral-emphasized);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.Item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 2rem;
  padding-inline: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: 0.25rem;

  user-select: none;
  outline: none;

  &:is(:hover, [data-highlighted]) {
    background: var(--demo-neutral-subtle);
  }

  &[data-state='checked'] {
    color: var(--demo-coral-fg);
  }

  &[data-disabled] {
    filter: grayscale(100%);
    opacity: 0.5;
  }
}

.ItemText {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ItemIndicator {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--demo-coral-solid);
  flex-shrink: 0;

  & svg {
    width: 0.875rem;
    height: 0.875rem;
  }
}
