@import "../mixins/mixins";
@import "../mixins/typo";
@import "../config/variables";
@import "./popper";

@include b(popover) {
  position: absolute;
  background: $--color-text;
  min-width: 150px;
  max-width: 280px;
  border-radius: $--border-radius;
  border: none;
  padding: $--size-base * 2 $--size-base * 4 $--size-base * 5;
  z-index: 2000;
  color: $--color-white;
  text-align: justify;
  box-shadow: initial;

  @include e(title) {
    font-size: 13px;
    line-height: 16px;
    letter-spacing: 1px;
    color: $--color-white;
    font-weight: bold;
    margin-bottom: $--size-base * 2;
  }

  @include e(footer) {
    margin-top: $--size-base * 4;
  }

  @include e(content) {
    @include bodyXS;
    text-align: left;
  }

  @include e(close) {
    text-align: right;
    .el-button {
      color: $--color-white;
      &:hover {
        color: $--color-dark;
      }
      &:active {
        color: $--color-focus;
      }
    }
  }

  @include e(reference) {
    &:focus:not(.focusing), &:focus:hover {
      outline-width: 0;
    }
  }

  &:focus:active, &:focus {
    outline-width: 0;
  }


  .popper__arrow,
  .popper__arrow::after {
    position: absolute;
    display: block;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
  }

  .popper__arrow {
    border-left-width: 6px;
    border-right-width: 6px;
    border-top-width: 4px;
  }

  .popper__arrow::after {
    content: " ";
    border-left-width: 6px;
    border-right-width: 6px;
    border-top-width: 4px;
  }

  &[x-placement^="top"] {
    margin-bottom: #{6px + 6};
  }

  &[x-placement^="top"] .popper__arrow {
    bottom: -$--size-base;
    border-top-color: $--color-text;
    border-bottom-width: 0;

    &::after {
      bottom: 0;
      margin-left: -6px;
      border-top-color: $--color-text;
      border-bottom-width: 0;
    }
  }

  &[x-placement^="bottom"] {
    margin-top: $--size-base * 2 + 6px;
  }

  &[x-placement^="bottom"] .popper__arrow {
    top: -$--size-base;
    border-top-width: 0;
    border-bottom-color: $--color-text;
    border-left-width: 6px;
    border-right-width: 6px;
    border-bottom-width: 4px;

    &::after {
      top: 0px;
      margin-left: -6px;
      border-top-width: 0;
      border-bottom-color: $--color-text;
      border-left-width: 6px;
      border-right-width: 6px;
      border-bottom-width: 4px;
    }
  }

  &[x-placement^="right"] {
    margin-left: $--size-base * 2 + 6px;
  }

  &[x-placement^="right"] .popper__arrow {
    left: -$--size-base;
    border-right-color: $--color-text;
    border-left-width: 0;
    border-right-width: 4px;
    border-top-width: 6px;
    border-bottom-width: 6px;

    &::after {
      bottom: -6px;
      left: 0px;
      border-right-color: $--color-text;
      border-left-width: 0;
      border-right-width: 4px;
      border-top-width: 6px;
      border-bottom-width: 6px;
    }
  }

  &[x-placement^="left"] {
    margin-right: $--size-base * 2 + 6px;
  }

  &[x-placement^="left"] .popper__arrow {
    right: -$--size-base;
    border-right-width: 0;
    border-left-color: $--color-text;
    border-left-width: 4px;
    border-top-width: 6px;
    border-bottom-width: 6px;

    &::after {
      right: 0px;
      bottom: -6px;
      margin-left: -6px;
      border-right-width: 0;
      border-left-color: $--color-text;
      border-left-width: 4px;
      border-top-width: 6px;
      border-bottom-width: 6px;
    }
  }




}
