:host {
  --dropdown-offset: 0px;
  --max-height: 300px;
  display: inline-block;
  position: relative;
  outline: none;
  box-sizing: border-box;
  vertical-align: top;
}

@keyframes dropdown-appear-animation {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.options-container {
  animation: dropdown-appear-animation 0.3s 0s both;
  position: absolute;
  z-index: 99;
  border-radius: var(--corner-radius);
  margin: 0;
  padding: 0;
  max-height: var(--max-height);
  overflow: auto;
  box-shadow: 0 2px 8px rgba(var(--color-elevated-item-shadow), 0.1);
  background: var(--color-elevated-item-background);
  display: none;
}

.options-container.expanded {
  display: block;
}

/* right-top */
.options-container.right-top {
  /* TODO add offset to other placements */
  left: calc(100% + var(--dropdown-offset));
  top: 5px;
}

.options-container.right-top.leaned {
  top: 0;
}

/* right-bottom */
.options-container.right-bottom {
  left: 100%;
  bottom: 5px;
}

.options-container.right-bottom.leaned {
  bottom: 0;
}

/* left-top */
.options-container.left-top {
  right: 100%;
  top: 5px;
}

.options-container.left-top.leaned {
  top: 0;
}

/* left-bottom */
.options-container.left-bottom {
  right: 100%;
  bottom: 5px;
}

.options-container.left-bottom.leaned {
  bottom: 0;
}

/* top-left */
.options-container.top-left {
  bottom: 100%;
  left: 5px;
}

.options-container.top-left.leaned {
  left: 0;
}

/* top-right */
.options-container.top-right {
  bottom: 100%;
  right: 5px;
}

.options-container.top-right.leaned {
  right: 0;
}

/* bottom-left */
.options-container.bottom-left {
  top: 100%;
  left: 5px;
}

.options-container.bottom-left.leaned {
  left: 0;
}

/* bottom-right */
.options-container.bottom-right {
  top: 100%;
  right: 5px;
}

.options-container.bottom-right.leaned {
  right: 0;
}
