import { css } from 'lit';

export default css`
:host {
  display: inline-block;
  vertical-align: top;
  box-sizing: content-box;
  outline: none;
  text-rendering: auto;
  cursor: default;
  user-select: none;
  width: auto;
  -webkit-tap-highlight-color: transparent;

  font-family: var(--md-sys-typescale-title-small-font-family-name);
  font-style: var(--md-sys-typescale-title-small-font-family-style);
  font-weight: var(--md-sys-typescale-title-small-font-weight);
  font-size: var(--md-sys-typescale-title-small-font-size);
  letter-spacing: var(--md-sys-typescale-title-small-tracking);
  line-height: var(--md-sys-typescale-title-small-height);
  text-transform: var(--md-sys-typescale-title-small-text-transform);
  text-decoration: var(--md-sys-typescale-title-small-text-decoration);

  --md-ripple-hover-state-layer-color: var(--md-sys-color-primary);
  --md-ripple-focus-state-layer-color: var(--md-sys-color-primary);
  --md-ripple-pressed-state-layer-color: var(--md-sys-color-primary);
  /* background-color: var(--md-sys-color-surface); */
  color: var(--md-sys-color-on-surface);
}

:host([hidden]) {
  display: none;
}

.surface {
  width: inherit;
  height: inherit;
  position: relative;
  border-radius: inherit;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 48px;
}

.surface.withIcon {
  height: 64px;
}

.container {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.content {
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0px 20px;
}

.tab-content {
  display: flex;
  align-items: center;
}

.ripple {
  border-radius: inherit;
  z-index: 3;
}

.icon ::slotted(*) {
  color: var(--md-sys-color-on-surface-variant);
  fill: var(--md-sys-color-on-surface-variant);
  width: 24px;
  height: 24px;
}

:host([selected]) .icon ::slotted(*) {
  color: var(--md-sys-color-primary);
  fill: var(--md-sys-color-primary);
}

:host([selected]) {
  color: var(--md-sys-color-primary);
}

.indicator {
  position: absolute;
  bottom: 0px;
  left: 0px;
  right: 0px;
  height: 2px;
  display: flex;
  justify-content: center;
}

.indicator.primary {
  height: 3px;
}

.pointer {
  height: inherit;
  display: block;
  background-color: var(--md-sys-color-primary);
}

.indicator.primary .pointer {
  border-radius: 3px 3px 0px 0px;
  width: 40px;
}

.indicator:not(.primary) .pointer {
  flex: 1;
}

:host([disabled]) {
  pointer-events: none;
}

:host([disabled]) .content {
  color: var(--md-sys-color-on-surface);
  opacity: .38;
}

:host(:hover) .container {
  background-color: var(--md-sys-color-primary);
  opacity: var(--md-sys-state-hover-state-layer-opacity);
}

:host(:focus) .container {
  background-color: var(--md-sys-color-primary);
  opacity: var(--md-sys-state-focus-state-layer-opacity);
}
`;
