/* 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.
*/

:host {
  /* Base ":host" styles for the component */
  box-sizing: border-box;
  background-color: var(--calcite-ui-foreground-1);
  color: var(--calcite-ui-text-2);
  font-size: var(--calcite-font-size--1);
}

:host * {
  box-sizing: border-box;
}

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

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

:host {
  display: flex;
  flex: 1 1 auto;
  overflow: hidden;
  background-color: transparent;
}

.content {
  display: flex;
  height: 100%;
  margin: 0;
  overflow: hidden;
  width: 100%;
  flex: 1 0 0;
}

.action-bar-container {
  display: flex;
}

:host([detached]) {
  border-width: 0;
  border-radius: 0.25rem;
  box-shadow: 0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  animation: in-up 300ms ease-in-out;
}

:host([position=end]) {
  align-self: flex-end;
}

:host([position=start]) {
  align-self: flex-start;
}

:host([height-scale=s]) {
  height: 33.333333%;
}

:host([height-scale=m]) {
  height: 70%;
}

:host([height-scale=l]) {
  height: 100%;
}

:host([height-scale=l][detached]) {
  height: calc(100% - 2rem);
}

::slotted(calcite-panel) {
  width: 100%;
  height: 100%;
}

::slotted(calcite-action-bar) {
  border-right-width: 1px;
  border-style: solid;
  border-color: var(--calcite-ui-border-3);
}

::slotted(calcite-action-bar[position=end]) {
  border-left-width: 0;
  border-right-width: 1px;
  border-style: solid;
  border-color: var(--calcite-ui-border-3);
}

.calcite--rtl ::slotted(calcite-action-bar) {
  border-right-width: 0;
  border-left-width: 1px;
  border-style: solid;
  border-color: var(--calcite-ui-border-3);
}

.calcite--rtl ::slotted(calcite-action-bar[position=end]) {
  border-left-width: 0;
  border-right-width: 1px;
  border-style: solid;
  border-color: var(--calcite-ui-border-3);
}