@use "../mixins/bem" as *;
@use "../mixins/function" as *;

@include b(notice) {
  @include e(icon) {
    position: fixed;
    top: 80px;
    right: 10px;
    z-index: 20;
    background-color: var(--vp-c-brand-3);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.6;

    &.twinkle {
      animation: twinkle 1.5s ease-in-out infinite;
    }
  }

  @include e(popover) {
    min-width: 260px;
    max-width: 400px;
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 110;
    background-color: getCssVar(bg-color-1);
    border: 1px solid var(--vp-c-brand-3);
    border-radius: 6px;
    box-shadow: var(--vp-shadow-2);

    @include when(top) {
      top: 80px;
      right: 20px;
    }

    @include when(center) {
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }

    @include e(popover__header) {
      background-color: var(--vp-c-brand-3);
      color: #ffffff;
      padding: 6px 4px;

      > div {
        overflow: hidden;
      }

      .title {
        font-size: 14px;
        padding-left: 6px;
      }
    }

    @include e(popover__content) {
      padding: 10px;
    }
  }

  @include e(mask) {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 109;
  }

  @keyframes twinkle {
    0% {
      opacity: 0.5;
    }
    50% {
      opacity: 0;
    }
    100% {
      opacity: 0.5;
    }
  }
}

html.disable-scroll {
  overflow: hidden;
}
