import { css } from 'lit';
import componentStyles from '../../styles/component.styles.mjs';

const styles = css`
  ${componentStyles}

  :host {
    display: block;
    user-select: none;
  }

  :host(:focus) {
    outline: none;
  }

  .option {
    position: relative;
    display: flex;
    align-items: center;
    font-family: var(--flow-ui-font-sans);
    font-size: var(--flow-ui-font-size-medium);
    font-weight: var(--flow-ui-font-weight-normal);
    line-height: var(--flow-ui-line-height-normal);
    letter-spacing: var(--flow-ui-letter-spacing-normal);
    color: var(--flow-ui-menu-color);
    padding: var(--flow-ui-spacing-x-small) var(--flow-ui-spacing-medium) var(--flow-ui-spacing-x-small)
      var(--flow-ui-spacing-x-small);
    transition: var(--flow-ui-transition-fast) fill;
    cursor: pointer;
  }

  .option--small {
    font-size: var(--flow-ui-font-size-small);
    padding: var(--flow-ui-spacing-2x-small) var(--flow-ui-spacing-small) var(--flow-ui-spacing-2x-small)
      var(--flow-ui-spacing-2x-small);
  }

  .option--large {
    font-size: var(--flow-ui-font-size-large);
  }

  .option--current,
  .option--current.option--disabled {
    background-color: var(--flow-ui-menu-background-color-selected);
    color: var(--flow-ui-menu-color-selected);
    opacity: 1;
  }

  .option--hover:not(.option--disabled) {
    background-color: var(--flow-ui-menu-background-color-hover);
    color: var(--flow-ui-menu-color-hover);
  }

  .option--disabled {
    outline: none;
    opacity: 0.5;
    cursor: not-allowed;
  }

  .option__label {
    flex: 1 1 auto;
    display: inline-block;
    line-height: var(--flow-ui-line-height-dense);
  }

  .option .option__check {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    padding-inline-end: var(--flow-ui-spacing-2x-small);
  }

  .option--selected .option__check {
    visibility: visible;
  }

  .option__prefix,
  .option__suffix {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
  }

  .option__prefix::slotted(*) {
    margin-inline-end: var(--flow-ui-spacing-x-small);
  }

  .option__suffix::slotted(*) {
    margin-inline-start: var(--flow-ui-spacing-x-small);
  }

  @media (forced-colors: active) {
    :host(:hover:not([aria-disabled='true'])) .option {
      outline: dashed 1px SelectedItem;
      outline-offset: -1px;
    }
  }
`;

export { styles as default };
