import { css } from 'lit'

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

    --_focus-icon-color: var(--md-icon-button-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));
    --_hover-icon-color: var(--md-icon-button-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));
    --_hover-state-layer-color: var(
      --md-icon-button-hover-state-layer-color,
      var(--md-sys-color-on-surface-variant, #49454f)
    );
    --_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, #49454f));
    --_pressed-icon-color: var(--md-icon-button-pressed-icon-color, var(--md-sys-color-on-surface-variant, #49454f));
    --_pressed-state-layer-color: var(
      --md-icon-button-pressed-state-layer-color,
      var(--md-sys-color-on-surface-variant, #49454f)
    );
    --_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: 40px;
    --_state-layer-width: 40px;
  }

  .icon-button {
    background-color: rgba(0, 0, 0, 0);
    color: var(--_icon-color);
    place-items: center;
    background: none;
    border: none;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    place-content: center;
    outline: none;
    padding: 0;
    position: relative;
    text-decoration: none;
    user-select: none;
    z-index: 0;
    flex: 1;
    border-radius: var(--_state-layer-shape);
    --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);
  }

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

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

  .icon-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);
  }

  .icon {
    display: inline-flex;
    border-radius: var(--_state-layer-shape);
    overflow: hidden;
  }

  .touch {
    position: absolute;
    height: max(48px, 100%);
    width: max(48px, 100%);
  }

  .user-icon,
  .avatar-initials {
    background-color: var(--user-avatar-initials-background-color, #0540f2);
    color: var(--user-avatar-initials-color, #fff);
  }

  .avatar-initials {
    /* border-radius: 50%; */
    text-transform: uppercase;
    font-size: large;
    border: 1px #0d47a1 solid;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .user-icon {
    height: var(--_state-layer-height);
    width: var(--_state-layer-width);
  }
`
