/* mixins & extensions */

@keyframes in {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes in-down {
  0% {
    opacity: 0;
    transform: translate3D(0, -5px, 0);
  }

  100% {
    opacity: 1;
    transform: translate3D(0, 0, 0);
  }
}

@keyframes in-up {
  0% {
    opacity: 0;
    transform: translate3D(0, 5px, 0);
  }

  100% {
    opacity: 1;
    transform: translate3D(0, 0, 0);
  }
}

@keyframes in-scale {
  0% {
    opacity: 0;
    transform: scale3D(0.95, 0.95, 1);
  }

  100% {
    opacity: 1;
    transform: scale3D(1, 1, 1);
  }
}

/**
* Currently only used in Checkbox.
*/

:root {
  --calcite-popper-transition: 150ms ease-in-out;
}

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

:host-context([theme=dark]) {
  --calcite-ui-blue-1: #00A0FF;
  --calcite-ui-blue-2: #0087D7;
  --calcite-ui-blue-3: #47BBFF;
  --calcite-ui-green-1: #36DA43;
  --calcite-ui-green-2: #11AD1D;
  --calcite-ui-green-3: #44ED51;
  --calcite-ui-yellow-1: #FFC900;
  --calcite-ui-yellow-2: #F4B000;
  --calcite-ui-yellow-3: #FFE24D;
  --calcite-ui-red-1: #FE583E;
  --calcite-ui-red-2: #F3381B;
  --calcite-ui-red-3: #FF7465;
  --calcite-ui-background: #202020;
  --calcite-ui-foreground-1: #2b2b2b;
  --calcite-ui-foreground-2: #353535;
  --calcite-ui-foreground-3: #404040;
  --calcite-ui-text-1: #ffffff;
  --calcite-ui-text-2: #bfbfbf;
  --calcite-ui-text-3: #9f9f9f;
  --calcite-ui-border-1: #4a4a4a;
  --calcite-ui-border-2: #404040;
  --calcite-ui-border-3: #353535;
  --calcite-ui-border-4: #757575;
  --calcite-ui-border-5: #9f9f9f;
}

.header {
  display: flex;
  justify-content: space-between;
  padding: 0 3px;
}

:host([scale=s]) .text {
  font-size: 14px;
}

:host([scale=s]) .chevron {
  height: 38px;
}

:host([scale=m]) .text {
  font-size: 16px;
}

:host([scale=m]) .chevron {
  height: 48px;
}

:host([scale=l]) .text {
  font-size: 18px;
}

:host([scale=l]) .chevron {
  height: 64px;
}

.chevron {
  color: var(--calcite-ui-text-2);
  flex-grow: 0;
  width: calc(100% / 7);
  box-sizing: content-box;
  outline: none;
  padding: 0 4px;
  margin: 0 -3px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--calcite-ui-foreground-1);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  outline-offset: 0;
  outline-color: transparent;
  transition: outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;
}

.chevron:focus {
  outline: 2px solid var(--calcite-ui-blue-1);
  outline-offset: -2px;
}

.chevron:hover, .chevron:focus {
  fill: var(--calcite-ui-text-1);
  background-color: var(--calcite-ui-foreground-2);
}

.chevron:active {
  background-color: var(--calcite-ui-foreground-3);
}

.chevron[aria-disabled=true] {
  pointer-events: none;
  opacity: 0;
}

.text {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  line-height: 1;
  margin: auto 0;
  text-align: center;
}

.text--reverse {
  flex-direction: row-reverse;
}

.month,
.year,
.suffix {
  color: var(--calcite-ui-text-1);
  background: var(--calcite-ui-foreground-1);
  font-size: inherit;
  font-weight: 500;
  line-height: 1.25;
  margin: 0 4px;
  display: inline-block;
}

.year {
  font-family: inherit;
  text-align: center;
  border: none;
  width: 3em;
  padding: 0;
  background-color: transparent;
  position: relative;
  z-index: 2;
  outline-offset: 0;
  outline-color: transparent;
  transition: outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;
}

.year:hover {
  transition: outline-color 100ms ease-in-out;
  outline: 2px solid var(--calcite-ui-border-2);
  outline-offset: 2px;
}

.year:focus {
  outline: 2px solid var(--calcite-ui-blue-1);
  outline-offset: 2px;
}

.year--suffix {
  width: 4rem;
  text-align: left;
}

.year-wrap {
  position: relative;
}

.suffix {
  position: absolute;
  width: 4rem;
  white-space: nowrap;
  text-align: left;
  top: 0;
  left: 0;
}

.suffix__invisible {
  visibility: hidden;
}