/*! _popovers.scss | Friendkit | © Css Ninja. 2020-2021 */

/* ==========================================================================
Popover styles
========================================================================== */

/*
    1. Webui popover
    2. User profile popovers
*/

/* ==========================================================================
1. Webui popover
========================================================================== */

.webui-popover {
  box-shadow: rgba(0, 0, 0, 0.04) 0px 3px 10px 4px !important;
  background: $white !important;
  color: $dark-text !important;
  border: none !important;
  margin-top: -20px !important;

  &.top > .webui-arrow {
    border-top-color: $white !important;
  }

  &.bottom-right > .webui-arrow {
    border-right-color: transparent !important;
    border-bottom-color: transparent !important;
  }

  &.top-right > .webui-arrow {
    border-right-color: transparent !important;

    &:after {
      border-top-color: $white !important;
    }
  }

  &.top-left > .webui-arrow {
    border-top-color: $white !important;
  }

  &.left > .webui-arrow {
    border-left-color: transparent !important;
  }

  .webui-arrow {
    border-top-color: transparent !important;
    border-right-color: transparent !important;

    &:after {
      border-top-color: transparent !important;
    }
  }

  .webui-popover-title {
    background-color: $white !important;
    border-bottom: none !important;
    font-weight: 500;
  }

  .webui-popover-content {
    font-size: 0.75rem !important;

    .popover-flex-block {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      padding: 12px;
      font-size: 0.85rem;

      .staff-avatar {
        height: 38px;
        width: 38px;
        border-radius: 50%;
      }

      .content-block {
        margin-left: 4px;
        color: $muted-grey;

        span {
          &:first-child {
            font-weight: 500;
            color: $dark-text;
          }
        }

        label,
        span {
          display: block;
        }

        label {
          color: lighten($dark-text, 35%);
          text-transform: uppercase;
          font-size: 70%;
        }
      }

      .fa.fa-star,
      .fa.fa-star-half {
        color: #ffd700;
      }

      .icon-block {
        height: 38px;
        width: 38px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 10px;

        svg {
          height: 24px;
          width: 24px;
          stroke: $muted-grey;
          stroke-width: 1.3px;

          &.is-medium {
            height: 26px;
            width: 26px;
          }
        }
      }
    }
  }
}

/* ==========================================================================
2. User profile popovers
========================================================================== */

.profile-popover-block {
  position: relative;

  .profile-popover-wrapper {
    padding: 8px 8px 0 8px;

    .popover-cover {
      position: relative;
      margin-bottom: 10px;
      min-height: 104px;

      img {
        display: block;
      }

      .popover-avatar {
        position: absolute;
        right: 14px;
        bottom: -25px;
        width: 50px;
        height: 50px;
        min-width: 50px;
        z-index: 0;

        img {
          display: block;
        }

        .avatar {
          width: 50px;
          height: 50px;
          border-radius: 50%;
          border: 3px solid $white;
        }

        .badge {
          position: absolute;
          right: -10px;
          bottom: 0;
          width: 24px;
          height: 24px;
          border: 2px solid $white;
          border-radius: 50%;
        }
      }
    }

    .popover-meta {
      span {
        display: block;

        &.user-meta,
        &.page-meta {
          display: flex;
          justify-content: space-between;
          align-items: center;
          margin-bottom: 8px;

          .username,
          .pagename {
            display: block;
            font-size: 0.9rem;
            font-weight: 500;
          }
        }

        &.job-title {
          font-size: 0.8rem;
          color: $primary;
          font-weight: 500;
          margin-bottom: 8px;
        }
      }

      .common-friends,
      .user-location,
      .page-activity,
      .page-followers {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        margin-bottom: 8px;

        .text {
          margin: 0 10px;
          color: $medium-text;
        }

        svg {
          stroke: $grey-text;
          width: 16px;
          height: 16px;
        }
      }
    }
  }

  .popover-actions {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 5px 10px;
    z-index: 1;

    .popover-icon {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 30px;
      height: 30px;
      max-width: 30px;
      margin: 0 2px;
      border-radius: 50%;
      transition: all 0.3s;
      cursor: pointer;

      &:hover {
        background: $primary;

        svg {
          stroke: $white;
        }
      }

      svg {
        width: 16px;
        height: 16px;
        stroke: $placeholder;
      }
    }
  }

  .loader-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    opacity: 0;
    transition: all 0.3s;
    z-index: 0;

    &.is-active {
      opacity: 1;
      z-index: 1;
    }

    .loader {
      &.is-loading {
        height: 24px;
        width: 24px;
        min-height: 24px;
        min-width: 24px;
      }
    }
  }
}
