/**=====================
    Sidebar CSS Start
==========================**/
@use "../utils/variables" as *;

.page-wrapper {
  .page-body-wrapper {
    .sidebar {
      background-color: transparent;
      // backdrop-filter: blur(28px);
      position: relative;

      .search-menu {
        position: relative;
        padding-inline: 15px;
        margin-block: 15px;

        input {
          padding: 10px;
          padding-left: 36px;
          // background-color: rgba($white, 0.08) !important;
          // background-color: #222222 !important;
          color: #222;
          font-size: 14px;
          box-shadow: inset 4px 0px 10px rgba(238, 238, 238, 0.4901960784);
          border: none;
          box-shadow: 4px 2px 2px rgba(38, 38, 38, 0.5);
          background-color: rgba(34, 34, 34, 0.12) !important;
          transition: all 0.4s ease-in-out;

          body.dark & {
            background-color: rgba($primary-color, 1) !important;
            color: #fff !important;
          }

          &::placeholder {
            // color: rgba($white, 0.9);
            color: #222;

            body.dark & {
              color: #fff !important;
            }

          }

          &:hover,
          &:active,
          &.active {
            box-shadow: 0px 0px 2px rgba(38, 38, 38, 0.5);
            transition: all 0.4s ease-in-out;
          }
        }

        i {
          position: absolute;
          top: 50%;
          left: 10px;
          transform: translateY(-50%);
          color: #222;
          font-size: 20px;

          body.dark & {
            color: #fff !important;
          }
        }
      }

      .sidebar-skeleton-main {
        display: none;
        flex-flow: row wrap;
        width: 100%;
        justify-content: center;
        padding: 4px 8px;

        .sidebar-skeleton {
          height: auto;
          padding: 0 5px 8px;
          width: 100%;
          height: 100%;

          .load {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 25px;

            &:first-child {
              padding-top: 4px;
            }

            &:nth-child(even) {
              .line {
                width: 100px;
              }
            }

            &:nth-child(odd) {
              .line {
                width: 140px;
              }
            }
          }

          .line {
            width: 160px;
          }

          .img {
            width: 18px;
          }

          .line,
          .img {
            height: 18px;
            border-radius: 2px;
            overflow: hidden;
            position: relative;
            background: linear-gradient(90deg,
                rgba(210, 210, 212, 0.24) 0%,
                rgba(217, 216, 216, 0.27) 100%);

            &::after {
              position: absolute;
              top: 0;
              right: 0;
              bottom: 0;
              left: 0;
              content: "";
              animation: shimmer 1s infinite;
              background-image: linear-gradient(90deg,
                  rgba(255, 255, 255, 0) 0%,
                  rgba(255, 255, 255, 0.08) 20%,
                  rgba(255, 255, 255, 0.07) 40%,
                  rgba(255, 255, 255, 0) 100%);
            }
          }
        }
      }

      .no-data {
        h6 {
          color: rgba($primary-color, 1);
        }
      }
    }

    .page-sidebar {
      width: $sidebar-width;
      position: $sidebar-position;
      // background: var(--sidebar-background-color);
      background: #F3F4F6;
      // box-shadow: $sidebar-shadow;
      top: 0;
      z-index: $sidebar-z-index;
      transition: $sidebar-transition;
      animation: sidebar-background-color 15s ease infinite;

      // &::before {
      //   content: "";
      //   position: absolute;
      //   top: 0;
      //   left: 0;
      //   width: 100%;
      //   height: 100%;
      //   backdrop-filter: blur(24px);
      // }

      .sidebar-menu {
        list-style: $sidebar-menu-list-style;
        margin: $sidebar-menu-list-margin;
        padding: 0 10px;
        height: calc(100vh - 115px);
        display: flex;
        flex-direction: column;
        overflow: auto;
        gap: 2px;

        &.custom-scrollbar::-webkit-scrollbar,
        .select2-results__options::-webkit-scrollbar {
          width: 0 !important;
          height: 0 !important;
        }

        .pin-title {
          display: none !important;
          order: -1;

          &.show {
            display: block !important;

            +.sidebar-main-title {
              padding-top: 24px;
            }
          }

          +.sidebar-main-title {
            padding-top: 10px;
          }
        }

        .sidebar-main-title {
          display: block;
          padding: 6px 0 6px 6px;
          margin-bottom: 0px;
          position: relative;
          width: 100%;

          &:first-child {
            padding-top: unset;
          }

          // &::before {
          //   position: absolute;
          //   content: "";
          //   bottom: 0;
          //   width: calc(100% - 40px);
          //   border-bottom: 2px dotted #222222a0;
          // }

          h6 {
            margin-bottom: 0;
            font-size: 13px;
            text-transform: uppercase;
            font-weight: 700;
            color: $primary-color;
            letter-spacing: 0.6px;

            body.dark & {
              color: white;
            }
          }
        }

        .sidebar-menu-list {
          position: relative;
          width: 100%;

          &.pined {
            order: -1;

            .ri-pushpin-2-line {
              visibility: visible;
            }

            .sidebar-header {
              .ri-puzzle-line {
                display: none;
              }
            }
          }

          .ri-pushpin-2-line {
            visibility: hidden;
            position: absolute;
            font-size: 17px;
            top: 7px;
            right: 42px;
            color: $primary-color;
            z-index: 9999;

            body.dark & {
              color: white;
            }
          }

          .dropdown-arrow {
            margin-left: auto;
            transition: all 0.2s ease;
            transform: rotate(0deg);
            // color: $white !important;
          }

          .sidebar-header {
            font-size: $sidebar-font-size;
            letter-spacing: $sidebar-letter-spacing;
            padding: 6px 10px 6px 10px !important;
            text-transform: $sidebar-txt-transform;
            font-weight: $sidebar-font-weight;
            color: #222222;
            display: flex;
            align-items: center;
            position: relative;
            transition: $sidebar-transition;
            gap: $sidebar-gap;
            transition: all 0.4s ease-in-out;

            body.dark & {
              color: white;
            }

            span {
              line-height: 1;
            }

            i {
              font-size: 18px;
              color: #222222;

              body.dark & {
                color: white !important;
              }

              &.plugin {
                color: $white !important;
              }
            }

            svg {
              margin-right: $sidebar-icon-margin;
              stroke-width: $sidebar-icon-stroke-width;
              vertical-align: text-bottom;
            }
          }

          .sidebar-submenu {
            margin-left: 10px !important;
            margin-top: 6px;
            position: relative;
            display: none;
            animation: 0.3s alternate sidebar-menu-open forwards;

            &:before {
              content: "";
              width: 1px;
              height: 100%;
              border-left: 1px solid rgba($dark-color, 0.19);
              position: absolute;
              left: 0;
              top: 0;


            }

            >li {
              display: block;
              position: relative;

              &:before {
                content: "";
                position: absolute;
                top: 50%;
                transform: translateY(-50%);
                width: 14px;
                height: 1px;
                border-bottom: 1px solid #222;
                left: 1px;
                background: transparent;

                body.dark & {
                  border-color: white !important;
                }
              }

              &::after {
                content: "";
                position: absolute;
                top: 50%;
                transform: translateY(-50%);
                width: 4px;
                height: 4px;
                background-color: #222;
                left: 14px;
                border-radius: 100%;

                body.dark & {
                  background-color: white !important;
                }
              }

              >a {
                font-size: 14px;
                // color: rgba($white, 0.55);
                color: #222222b0;
                text-transform: $sidebar-text-transform;
                position: relative;
                line-height: 1.5;
                letter-spacing: 0.7px;
                padding: 6px 16px;
                display: flex;
                align-items: center;
                gap: 6px;
                margin: 0 12px;
                border-radius: 4px;
                transform: translateX(0);
                transition: all 0.2s ease;
                justify-content: space-between;

                body.dark & {
                  color: rgba(255, 255, 255, 0.493);
                }

                .sidebar-badge {
                  background-color: var(--primary-color);
                  width: 20px;
                  height: 20px;
                  border-radius: 4px;
                  display: flex;
                  align-items: center;
                  justify-content: center;
                  line-height: 1;
                  color: $white;
                  font-size: 14px;
                  font-weight: 500;
                }
              }

              &:hover {
                a {
                  font-weight: 500;
                  transform: translateX(2px);
                  transition: all 0.2s ease;
                }
              }
            }

            &.menu-open {
              display: block;

              &:before {
                border-color: #676767;
              }

              li {
                &.active {
                  a {
                    color: #222222;
                    font-weight: 500;

                    body.dark & {
                      color: white !important;
                    }
                  }
                }
              }
            }
          }

          &:hover {
            .ri-pushpin-2-line {
              visibility: visible;
              cursor: pointer;
            }

            .ri-puzzle-line {
              display: none;
            }

            .sidebar-header {
              // background-color: rgba($primary-color, 1);
              border-radius: 0 10px 10px 0;
              overflow: hidden;
              color: #222;
              transition: all 0.4s ease-in-out;

              &::before {
                content: "";
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: linear-gradient(270deg, $primary-color 0%, rgb(241 241 241 / 0%) 100%);
                opacity: 0.33;
                transition: all 0.4s ease-in-out;
                border-radius: 0 10px 10px 0;

                body.dark & {
                  background: linear-gradient(270deg, $white 0%, rgb(241 241 241 / 0%) 100%) !important;
                }
              }

              // &::after {
              //   content: "";
              //   border-left: 3px solid #fff;
              //   position: absolute;
              //   left: 0;
              //   top: 0;
              //   height: 100%;
              // }
            }
          }

          &.active {
            .sidebar-header {
              // color: rgba($white, 1);
              color: #222222;
              font-weight: 700;
              position: relative;
              z-index: 0;
              // background-color: var(--primary-color);
              border-radius: 0 10px 10px 0;
              overflow: hidden;
              transition: all 0.4s ease-in-out;

              // &::after {
              //   content: "";
              //   border-left: 3px solid #fff;
              //   position: absolute;
              //   right: 0;
              //   top: 0;
              //   height: 100%;
              // }

              &::before {
                content: "";
                position: absolute;
                top: 0;
                left: 0;
                z-index: -1;
                width: 100%;
                height: 100%;
                background: linear-gradient(270deg, $primary-color 0%, rgb(241 241 241 / 0%) 100%);
                opacity: 0.33;

                body.dark & {
                  background: linear-gradient(270deg, $white 0%, rgb(241 241 241 / 0%) 100%) !important;
                }
              }

              .dropdown-arrow {
                color: $primary-color !important;

                body.dark & {
                  color: white !important;
                }
              }

              i {
                color: #222222;
                font-weight: 400;
              }

              &.active {
                color: $white;
              }
            }

            .dropdown-arrow {
              transition: all 0.2s ease;
              transform: rotate(90deg);
              color: $dark-color !important;
            }
          }

          &:last-child {
            padding-bottom: 40px;
          }
        }
      }

      ~.page-body {
        margin-left: $sidebar-width;
        transition: $sidebar-transition;
      }

      @media (min-width: 1200px) {
        &.open {
          ~.page-body {
            margin-left: 120px;
            transition: $sidebar-transition;

            .search-box {
              left: 120px;
              width: calc(100% - 120px);

              .location-map {
                width: calc(100vw - 120px - 422px);
              }
            }
          }

          ~footer {
            margin-left: 120px;
            padding-right: 15px;
            width: calc(100% - 120px);

            &:has(a) {
              margin-left: 120px;
            }
          }
        }
      }

      @media (min-width: 992px) {
        &.open {
          display: block;
          width: 120px;

          &:hover {
            width: 253px;

            .sidebar {
              .sidebar-top {
                justify-content: space-between;

                .logo-wrapper {
                  a {
                    img {
                      width: 144px;
                      height: 32px;
                    }
                  }
                }

                a {
                  display: flex;
                }
              }

              .sidebar-menu {
                li {
                  &.pin-title {
                    display: none !important;

                    &.show {
                      display: block !important;
                    }
                  }

                  &.sidebar-main-title {
                    display: flex;
                  }
                }
              }
            }

            .sidebar-menu {
              .sidebar-menu-list {
                &:hover {
                  .sidebar-header {
                    .ri-puzzle-line {
                      display: none;
                    }
                  }
                }

                .ri-pushpin-2-line {
                  display: block;
                }

                .sidebar-submenu {
                  &.menu-open {
                    display: block !important;
                  }
                }
              }
            }

            .search-menu {
              display: block;
            }

            .sidebar-menu {
              .sidebar-menu-list {
                .dropdown-arrow {
                  display: block;
                }

                .sidebar-header {
                  justify-content: unset;

                  .plugin {
                    display: block;
                  }

                  span {
                    display: block;
                  }
                }
              }
            }
          }

          .sidebar {
            .sidebar-top {
              justify-content: center;
              margin-bottom: 15px;

              .logo-wrapper {
                a {
                  display: block;

                  img {
                    width: unset;
                    height: unset;
                  }
                }
              }

              a {
                display: none;
              }
            }

            .sidebar-menu {
              li {
                &.pin-title {
                  display: none !important;
                }

                &.sidebar-main-title {
                  display: none;
                }
              }
            }
          }

          .sidebar-menu {
            .sidebar-menu-list {
              .ri-pushpin-2-line {
                display: none;
              }

              &:last-child {
                padding-bottom: unset;
              }

              .sidebar-submenu {
                &.menu-open {
                  display: none !important;
                }
              }
            }
          }

          .search-menu {
            display: none;
          }

          .sidebar-menu {
            .sidebar-menu-list {
              .dropdown-arrow {
                display: none;
              }

              .sidebar-header {
                justify-content: center;

                .plugin {
                  display: none;
                }

                span {
                  display: none;
                }
              }
            }
          }

          ~.page-body {
            margin-left: 120px;
            transition: $sidebar-transition;
          }

          ~footer {
            margin-left: 120px;
            padding-right: 15px;
            width: calc(100% - 120px);

            &:has(a) {
              margin-left: 120px;
            }
          }
        }
      }
    }

    .sidebar-close {
      .page-sidebar {
        transition: $sidebar-transition;
        transform: translate(-$sidebar-width);
      }

      .page-body {
        transition: $sidebar-transition;
        margin-left: 0 !important;
      }
    }
  }
}

/* sidebar search loader css */
.loader-wrapper,
.media-loader-wrapper {
  display: none;
  align-items: center !important;
  justify-content: center !important;
  margin: auto;
  margin-top: 50px;
}

.loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 35px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid $primary-color;
  animation: l20-1 0.9s infinite linear alternate, l20-2 1.8s infinite linear;
}

.no-data {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;

  img {
    width: 40%;
    height: auto;
  }

  h6 {
    color: rgba($dark-color, 0.6);
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    border-bottom: none !important;
  }
}

/**=====================
    Sidebar CSS Ends
==========================**/