@use "../../base/utilities/index" as *;

// menu content

.ac-menu-item {
  .ac-nav-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    padding: 5px;
    transition: all 0.3s ease-in-out;
    position: relative;
    z-index: 99;
    user-select: none;
    border: 1px solid $color-border-dark;
    cursor: pointer;

    &:after {
      position: absolute;
      content: "";
      left: 0;
      top: 0;
      opacity: 1;
      z-index: -1;
      width: 100%;
      height: 100%;
      border-radius: 50%;
      transition: 0.3s ease-in-out;
    }

    &:focus {
      box-shadow: none;
    }

    &:hover {
      &:after {
        background-color: $color-border;
      }
    }
  }
  &.ac-profile-button {
    margin-right: 15px;
    &.is-org {
      border: 1px solid $color-border;
      padding: 4px 0;
      border-radius: 4px;
    }
    button.button.ac-nav-button {
      width: 100%;
      background-color: transparent;
      border-radius: 0;
      font-weight: 500;
      border: none;

      &::after {
        border-radius: 0;
        border: none;
        background-color: transparent;
      }
      .ac-user-profile {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        overflow: hidden;
        border: 2px solid $color-border;
      }
      i.fa {
        padding-left: 8px;
      }
    }
  }
  .ac-menu-content {
    position: absolute;
    right: 0;
    top: 80px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease-in;
    width: 260px;
    box-shadow:
      0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1),
      0 0px 0 1px rgba(10, 10, 10, 0.02);

    &.quick-access {
      background-color: $white-100;
      padding: 20px;
      min-width: 260px !important;
      max-height: 250px;
      overflow-y: auto;
      border-radius: 4px;

      .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid $color-border;
        padding-bottom: 20px;

        p {
          font-size: 1rem;
          color: $color-heading;
        }

        button {
          background-color: transparent;
          border: none;
          cursor: pointer;
          color: $color-text;
        }
      }

      .body-content {
        margin-top: 20px;

        p {
          font-size: 1rem;
          color: $color-heading;
        }

        .organizations {
          .organization {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 5px 0;

            .org-info {
              display: flex;
              align-items: center;

              img {
                max-width: 30px;
                margin-right: 10px;
                object-fit: cover;
              }
            }

            .remove {
              border: none;
              padding: 0;
              font-size: 11px;
              color: $danger;
              background-color: transparent;
            }
          }
        }
      }
    }

    &.is-notification {
      right: 0;
      background-color: $white-100;
      box-shadow: 0px 4px 8px rgba(84, 101, 126, 0.2);
      border-radius: 4px;
      min-width: 330px;
      max-height: 400px;
      overflow-y: auto;

      .notification-header {
        padding: 20px 20px 6px 20px;
        display: flex;
        justify-content: space-between;
        align-items: baseline;

        .left-content {
          p {
            font-weight: 500;
            font-size: 1rem;
            line-height: 19px;
            margin-bottom: 15px;

            span {
              font-weight: normal;
            }

            &.date {
              font-size: 11px;
              line-height: 14px;
              font-weight: normal;
              margin-bottom: 0;
            }
          }
        }

        .right-content {
          .button {
            border: none;
            margin: 0;
            padding: 10px;
            font-size: 1rem;

            &.is-active {
              background-color: $ac-primary;
              color: $white-100;

              img {
                filter: brightness(100);
              }
            }

            &:hover {
              background-color: $ac-primary;
              color: $white-100;

              img {
                filter: brightness(100);
              }
            }
          }
        }
      }

      .notification-body {
        .single-notification-item {
          display: block;
          border-top: 1px solid $color-border;
          padding: 15px 20px;
          font-weight: 500;

          &.is-complete {
            font-weight: 400;
          }

          &:hover {
            background-color: #d1e3f2;
          }

          p {
            color: $color-heading;
            font-size: 11px;
          }

          .notification-status {
            margin-top: 10px;
            display: flex;
            align-items: center;
            justify-content: space-between;

            p {
              font-size: 11px;
              color: $color-text;

              &.is-success {
                color: $success;
              }

              &.is-danger {
                color: $danger;
              }

              &.is-warning {
                color: $warning;
              }
            }
          }
        }
      }

      .see-all-message {
        border-top: 1px solid $color-border;
        text-align: center;
        font-weight: 500;
        font-size: 1rem;
        color: $color-heading;
        display: block;
        padding: 10px 20px;
      }
    }

    ul {
      background-color: $white-100;
      padding: 0;
      // border-radius: 4px;
      overflow: hidden;

      li {
        a {
          display: block;
          padding: 8px 15px;
          color: $color-heading;
          transition: 0.3s ease-in-out;
          font-size: 1rem;

          &:hover {
            background-color: $primary-95;

            p {
              color: $ac-primary !important;
            }
          }
        }
      }
    }

    .user-profile-wrapper {
      background-color: $white-100;
      border-radius: 4px;
      border: 1px solid $color-border;

      .profile-area {
        display: flex;
        align-items: center;
        border-bottom: 1px solid $color-border;
        padding: 16px 16px;

        .profile-photo {
          // width: 50px;
          // height: 50px;
          border-radius: 50%;
          position: relative;
          z-index: 1;
          margin-right: 10px;

          img {
            border-radius: 50%;
            width: 100%;
            border: 2px solid #d2e7f9;
          }

          .camera-icon {
            position: absolute;
            right: -10px;
            top: 0;
            background-color: transparent;
            border: none;
            cursor: pointer;
          }
        }

        .profile-info {
          p {
            color: $color-heading;
            font-size: 1rem;
            font-weight: 500;
            line-height: 1.3;
          }

          a {
            font-size: 1rem;
            color: $color-text;
            line-height: 1.3;
          }
        }
      }

      .list-items {
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        li {
          &.is-close {
            ul {
              max-height: 0;
              visibility: hidden;
              transition: max-height 0.25s ease-out;
              &.ac-vscrollbar {
                padding: 0;
              }
            }
          }

          &.is-open {
            ul {
              padding: 8px;
              max-height: 200px;
              visibility: visible;
              transition: max-height 0.25s ease-out;
              li {
                padding: 0;
                border: 1px solid $color-border-light;
              }
            }
          }
          a {
            padding: 8px 16px;
            font-weight: 500;
            display: block;
            color: $color-heading;
            transition: 0.3s;
            display: flex;
            align-items: center;
            gap: 8px;

            &:hover {
              background-color: $primary-light-gray;
              color: $ac-secondary;
            }
          }
        }
      }
    }
  }

  &.is-active {
    .ac-nav-button {
      &::after {
        background-color: $color-border;
      }
    }
    .ac-menu-content {
      opacity: 1;
      visibility: visible;
      top: 35px;
      z-index: 99;

      &::after {
        position: absolute;
        content: "";
        right: 38px;
        top: -6px;
        background-color: $white-100;
        width: 15px;
        height: 15px;
        transform: rotate(45deg);
        box-shadow: 0px -1px 4px rgba(0, 0, 0, 0.16);
        z-index: -1;
      }
    }
  }

  .ac-menu-content {
    &.navbar-dropdown-wrapper {
      position: absolute;
      border-radius: 4px;
      z-index: 9999;
      right: 0px;
      top: 40px;
      display: block;
      transition: all 0.3s ease-in-out;
      ul.app-drawer {
        border-radius: 4px;
        overflow: hidden;
        background-color: $white-100;
        border: 1px solid $color-border;
        // box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.16);
        max-height: calc(100vh - 100px);
        overflow-y: auto;

        li {
          display: block;
          font-size: 1rem;
          a {
            display: block;
            color: $color-heading !important;
            padding: 10px 20px !important;
            font-size: 1rem !important;
            transition: 0.2s;
            border-bottom: 1px solid $color-border;

            &:hover {
              background-color: $primary-light-gray !important;
            }

            span {
              margin-top: -3px;
            }

            &:hover {
              .media-content {
                .content {
                  p {
                    color: $color-text;
                  }
                }
              }
            }

            .media {
              .media-left {
                .image {
                  img {
                    height: 24px;
                    width: auto;
                  }
                }
              }

              .media-content {
                overflow: hidden;

                .content {
                  p {
                    vertical-align: middle;
                    line-height: 1;
                    transition: 0.3s;

                    strong {
                      font-weight: 600;
                      font-size: 1rem;
                      // font-family: $font-heading;
                    }

                    span {
                      display: block;
                      font-size: 1rem;
                      margin-top: 4px;
                      line-height: 150%;
                    }
                  }
                }
              }
            }
          }

          &:hover {
            > a {
              background-color: $white-100;
            }
          }

          &:first-child {
            &:hover {
              > a {
                border-radius: 4px 4px 0 0;
              }
            }
          }

          &:last-child {
            &:hover {
              > a {
                border-radius: 0 0 4px 4px;
              }
            }
          }
        }
      }
    }
  }
}
