import { css } from 'lit'

export default css`
  :host {
    display: flex;
    outline: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    justify-content: center;
    height: var(--_state-layer-height);
    width: auto;
    user-select: none;

    --_focus-icon-color: var(--md-icon-button-focus-icon-color, var(--md-sys-color-on-surface-variant));
    --_hover-icon-color: var(--md-icon-button-hover-icon-color, var(--md-sys-color-on-surface-variant));
    --_hover-state-layer-color: var(--md-icon-button-hover-state-layer-color, var(--md-sys-color-on-surface-variant));
    --_hover-state-layer-opacity: var(--md-icon-button-hover-state-layer-opacity, 0.08);
    --_icon-color: var(--md-icon-button-icon-color, var(--md-sys-color-on-surface-variant));
    --_pressed-icon-color: var(--md-icon-button-pressed-icon-color, var(--md-sys-color-on-surface-variant));
    --_pressed-state-layer-color: var(
      --md-icon-button-pressed-state-layer-color,
      var(--md-sys-color-on-surface-variant)
    );
    --_pressed-state-layer-opacity: var(--md-icon-button-pressed-state-layer-opacity, 0.12);
    --_state-layer-shape: var(--md-icon-button-state-layer-shape, var(--md-sys-shape-corner-full, 9999px));
    --_state-layer-height: 56px;
    --_state-layer-color: transparent;
    --_state-layer-padding-start: 24px;
    --_state-layer-padding-end: 24px;
  }

  :host([selected]) {
    --_state-layer-color: var(--md-sys-color-secondary-container);
    --_icon-color: var(--md-sys-color-on-secondary-container);
  }

  .button {
    color: var(--_icon-color);
    background: var(--_state-layer-color);
    place-items: center;
    border: none;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    outline: none;
    padding: 0 var(--_state-layer-padding-end) 0 var(--_state-layer-padding-start);
    position: relative;
    text-decoration: none;
    user-select: none;
    z-index: 0;
    flex: 1;
    gap: 12px;
    border-radius: var(--_state-layer-shape);
    font-family: var(--md-sys-typescale-label-large-font);
    font-size: var(--md-sys-typescale-label-large-size);
    letter-spacing: var(--md-sys-typescale-label-large-tracking);
    line-height: var(--md-sys-typescale-label-large-height);
    font-weight: var(--md-sys-typescale-label-large-weight);
    --md-ripple-hover-color: var(--_hover-state-layer-color);
    --md-ripple-hover-opacity: var(--_hover-state-layer-opacity);
    --md-ripple-pressed-color: var(--_pressed-state-layer-color);
    --md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity);
  }

  .button.icon {
    --_state-layer-padding-start: 16px;
  }

  .button:hover {
    color: var(--_hover-icon-color);
  }

  .button:focus {
    color: var(--_focus-icon-color);
  }

  .button:active {
    color: var(--_pressed-icon-color);
  }

  md-focus-ring {
    --md-focus-ring-shape-start-start: var(--_state-layer-shape);
    --md-focus-ring-shape-start-end: var(--_state-layer-shape);
    --md-focus-ring-shape-end-end: var(--_state-layer-shape);
    --md-focus-ring-shape-end-start: var(--_state-layer-shape);
  }

  md-ripple {
    border-radius: var(--_state-layer-shape);
  }
`
