@import '../../style/index.scss';
$popover: cp-ui-popover;
$popover-arrow-width: 7 * $hd;

// Base class
.#{$popover} {
  position: absolute;
  z-index: 1999;

  &-hidden {
    display: none;
  }

  &-mask {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    height: 100%;
    z-index: 999;

    &-hidden {
      display: none;
    }
  }

  &-placement-top &-arrow,
  &-placement-topLeft &-arrow,
  &-placement-topRight &-arrow {
    transform: rotate(225deg);
    bottom: -$popover-arrow-width/2;
  }

  &-placement-top &-arrow {
    left: 50%;
  }

  &-placement-topLeft &-arrow {
    left: 8px;
  }

  &-placement-topRight &-arrow {
    right: 8px;
  }

  &-placement-right &-arrow,
  &-placement-rightTop &-arrow,
  &-placement-rightBottom &-arrow {
    transform: rotate(-45deg);
    left: -$popover-arrow-width/2;
  }

  &-placement-right &-arrow {
    top: 50%;
  }

  &-placement-rightTop &-arrow {
    top: 8px;
  }

  &-placement-rightBottom &-arrow {
    bottom: 8px;
  }

  &-placement-left &-arrow,
  &-placement-leftTop &-arrow,
  &-placement-leftBottom &-arrow {
    transform: rotate(135deg);
    right: -$popover-arrow-width/2;
  }

  &-placement-left &-arrow {
    top: 50%;
  }

  &-placement-leftTop &-arrow {
    top: 8px;
  }

  &-placement-leftBottom &-arrow {
    bottom: 8px;
  }

  &-placement-bottom &-arrow,
  &-placement-bottomLeft &-arrow,
  &-placement-bottomRight &-arrow {
    top: -$popover-arrow-width/2;
  }

  &-placement-bottom &-arrow {
    left: 50%;
  }

  &-placement-bottomLeft &-arrow {
    left: 8px;
  }

  &-placement-bottomRight &-arrow {
    right: 8px;
  }
  // Arrows
  &-arrow {
    position: absolute;
    width: 7px;
    height: 7px;
    background-color: rgb(255, 255, 255);
    transform: rotate(45deg);
    z-index: 0;
    box-shadow: rgba(0, 0, 0, 0.21) 0 0 2px;
    border-radius: 1px;
  }
}
