/* THEME CLASSES
   -------------------------------------------------------------------------------------------------------------------------------------------- */

.#{ $theme-prefix }-addon-right {
  position: relative;

  input {
    padding-right: 35px;
  }

  [class*="icon"] {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: $secondary;
    font-size: 20px;
  }
}

.#{ $theme-prefix }-input {
  visibility: hidden;

  &--checkbox:checked+label::after {
    display: inline-block;
  }

  &--radio:checked+label::after {
    display: inline-block;
  }

  &:disabled+label {
    color: $secondary;
    cursor: not-allowed;

    &::before {
      border-color: $secondary;
    }
  }
}


.#{ $theme-prefix }-input-label {
  position: relative;
  padding-left: 30px;
  margin-left: -20px;
  cursor: pointer;
  color: txtColorSwitch($dark-theme: $isDarkTheme, $other-color: true, $dark-color: #fff);

  &::before {
    content: "";
    display: block;
    height: 20px;
    width: 20px;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid $primary;
  }

  &::after {
    @include fontawesome;
    display: block;
    height: 20px;
    width: 20px;
    position: absolute;
    left: 1px;
    top: 27%;
    transform: translateY(-50%);
    font-size: 22px;
    color: $primary;
    display: none;
  }

  &--checkbox {
    &::before {
      border-radius: 3px;
    }

    &::after {
      content: "\f14a";
    }
  }

  &--radio {
    &::before {
      border-radius: 50%;
    }

    &::after {
      content: "\f058";
    }
  }

}

.#{ $theme-prefix }-icon {
  font-size: 20px;
}

.#{ $theme-prefix }-accordion-container {
  overflow: auto;
  padding-right: 10px;
  padding-bottom: 40px;
  padding-top: 40px;
}

.#{ $theme-prefix }-heading-title {
  color: txtColorSwitch($dark-theme: $isDarkTheme, $other-color: true, $dark-color: $dark-secondary, $light-color: $primary);
}



// ACCORDION

.#{ $theme-prefix }-accordion {
  &__body {}

  &__parent {

    &--striped {
      .#{ $theme-prefix }-accordion__first-level {
        .card-header {
          padding: 0;
        }

        .#{ $theme-prefix }-accordion__col {
          padding: 15px 0;
        }

        &:nth-child(even) .#{ $theme-prefix }-accordion__row {
          background-color: $table-striped-even;
        }

        &:nth-child(odd) .#{ $theme-prefix }-accordion__row {
          background-color: $white;
        }

        &:hover .#{ $theme-prefix }-accordion__row {
          background-color: $table-striped-hover;
        }

        &.panel-open .#{ $theme-prefix }-accordion__row {
          background-color: $white;
        }

        & .panel-open .#{ $theme-prefix }-accordion__row {
          background-color: $white;
        }

        & .panel-collapse .#{ $theme-prefix }-accordion__row {
          background-color: $white;
        }

        & .card {
          border-bottom: 1px solid $table-striped-divider;
        }
      }
    }
  }

  &__header {
    padding: 0.75rem 0;
    border-bottom: 2px solid $secondary;
  }

  &__heading {
    cursor: pointer;

    &--with-arrow .#{ $theme-prefix }-accordion__col:first-child {
      position: relative;
      padding-left: 20px;

      &::before {
        content: "\f105";
        @include fontawesome;
        font-size: 22px;
        font-weight: 800;
        display: block;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
      }
    }
  }

  &__row {
    width: 100%;
    display: flex;
  }

  &__col {
    flex-grow: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;

    &--2 {
      width: calc(100% / 2);
    }

    &--3 {
      width: calc(100% / 3);
    }

    &--4 {
      width: calc(100% / 4);
    }

    &--tree {
      width: 60%;
      min-width: 400px;
    }

    &--no-arrow::before {
      display: none !important;
    }

    &--center {
      display: flex;
      justify-content: center;
    }

    &--right {
      display: flex;
      justify-content: flex-end;
    }
  }
}


// TABLE

.#{ $theme-prefix }-table {
  &-header {
    padding: 8px;
    border-bottom: 2px solid $secondary;
  }

  &__row {
    display: flex;
    width: 100%;
  }

  &__col {
    flex-grow: 1;

    &-1 {
      width: 100%;
    }

    &-2 {
      width: calc(100% / 2);
    }

    &-3 {
      width: calc(100% / 3);
    }

    &-4 {
      width: calc(100% / 4);
    }

    &-5 {
      width: calc(100% / 4);
    }
  }
}

// LOADER KEYFRAMES

@keyframes lds-ellipsis1 {
  0% {
    transform: scale(0);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes lds-ellipsis3 {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(0);
  }
}

@keyframes lds-ellipsis2 {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(19px, 0);
  }
}

@keyframes lds-ellipsis2-sm {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(8px, 0);
  }
}

// LOADER

.#{ $theme-prefix }-loading {
  display: inline-block;
  position: relative;
  width: 64px;
  height: 64px;

  div {
    position: absolute;
    top: 27px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: $primary;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);

    &:nth-child(1) {
      left: 6px;
      animation: lds-ellipsis1 0.6s infinite;
    }

    &:nth-child(2) {
      left: 6px;
      animation: lds-ellipsis2 0.6s infinite;

    }

    &:nth-child(3) {
      left: 26px;
      animation: lds-ellipsis2 0.6s infinite;
    }

    &:nth-child(4) {
      left: 45px;
      animation: lds-ellipsis3 0.6s infinite;
    }
  }

  &--sm {
    width: 35px;
    height: 15px;
  }

  &--sm div {
    top: 4px;
    width: 5px !important;
    height: 5px !important;
  }

  &--sm div {
    &:nth-child(1) {
      left: 6px;
      animation: lds-ellipsis1 0.6s infinite;
    }

    &:nth-child(2) {
      left: 6px;
      animation: lds-ellipsis2-sm 0.6s infinite;
    }

    &:nth-child(3) {
      left: 13px;
      animation: lds-ellipsis2-sm 0.6s infinite;
    }

    &:nth-child(4) {
      left: 20px;
      animation: lds-ellipsis3 0.6s infinite;
    }
  }

}

// SPINNER KEYFRAME

@keyframes lds-roller {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}


// SPINNER
.#{ $theme-prefix }-spinner {
  display: inline-block;
  position: relative;
  width: 64px;
  height: 64px;

  div {
    animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    transform-origin: 32px 32px;

    &::after {
      content: " ";
      display: block;
      position: absolute;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background-color: $primary;
      margin: -3px 0 0 -3px;
    }

    &:nth-child(1) {
      animation-delay: -0.036s;

      &::after {
        top: 50px;
        left: 50px;
      }
    }

    &:nth-child(2) {
      animation-delay: -0.072s;

      &::after {
        top: 54px;
        left: 45px;
      }
    }

    &:nth-child(3) {
      animation-delay: -0.108s;

      &::after {
        top: 57px;
        left: 39px;
      }
    }

    &:nth-child(4) {
      animation-delay: -0.144s;

      &::after {
        top: 58px;
        left: 32px;
      }
    }

    &:nth-child(5) {
      animation-delay: -0.18s;

      &::after {
        top: 57px;
        left: 25px;
      }
    }

    &:nth-child(6) {
      animation-delay: -0.216s;

      &::after {
        top: 54px;
        left: 19px;
      }
    }

    &:nth-child(7) {
      animation-delay: -0.252s;

      &::after {
        top: 50px;
        left: 14px;
      }
    }

    &:nth-child(8) {
      animation-delay: -0.288s;

      &::after {
        top: 45px;
        left: 10px;
      }
    }

  }


  &--sm div::after {
    height: 3px !important;
    width: 3px !important;
  }

  &--sm div {
    transform-origin: 26px 31px;

    &:nth-child(1) {
      animation-delay: -0.036s;

      &::after {
        top: 35px;
        left: 38px;
      }
    }

    &:nth-child(2) {
      animation-delay: -0.072s;

      &::after {
        top: 39px;
        left: 36px;
      }
    }

    &:nth-child(3) {
      animation-delay: -0.108s;

      &::after {
        top: 42px;
        left: 33px;
      }
    }

    &:nth-child(4) {
      animation-delay: -0.144s;

      &::after {
        top: 43px;
        left: 29px;
      }
    }

    &:nth-child(5) {
      animation-delay: -0.18s;

      &::after {
        top: 43px;
        left: 25px;
      }
    }

    &:nth-child(6) {
      animation-delay: -0.216s;

      &::after {
        top: 41px;
        left: 21px;
      }
    }

    &:nth-child(7) {
      animation-delay: -0.252s;

      &::after {
        top: 38px;
        left: 18px;
      }
    }

    &:nth-child(8) {
      animation-delay: -0.288s;

      &::after {
        top: 34px;
        left: 16px;
      }
    }
  }


}


// SIDEBAR

.#{ $theme-prefix }-sidebar {
  position: fixed;
  left: 0;
  height: 100%;
  z-index: 99;
  display: flex;
  overflow: auto;
  background-color: bgColorSwitch($dark-theme: $isDarkTheme, $surface: true);

  &--left {
    left: 0;
    box-shadow: 2px 0 5px -2px #888;
  }

  &--right {
    left: 120px;
  }

  &__col {
    min-height: 600px;

    &--nav {
      width: 120px;
    }

    &--content {
      width: 280px;
      padding: 50px 0 20px;
      background-color: bgColorSwitch($dark-theme: $isDarkTheme, $other-color: true, $color: $content-background);
    }
  }

  &__icon {
    display: block;
    width: 100%;
    margin: 0 auto;
    cursor: pointer;
  }

  &__links {
    padding: 0 30px;

    a,
    p {
      opacity: 0.5;
      color: $secondary;
    }

    a:hover {
      color: $white;
      opacity: 1;
      text-decoration: none;
    }
  }

  &__list {
    padding: 0;
    margin: 0;
    list-style: none;

    &-item {
      position: relative;

      &::after {
        content: "";
        display: block;
        height: 2px;
        width: 80%;
        opacity: 0.2;
        background-color: $secondary;
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
      }
    }

    &-item:hover &-link {
      color: $white;
      text-decoration: none;
      opacity: 1;
    }

    &-item:hover &-link::after {
      visibility: visible;
    }

    &-link {
      display: block;
      width: 100%;
      padding: 15px 30px;
      position: relative;
      color: $secondary;
      opacity: 0.5;

      &::after {
        content: "";
        display: block;
        width: 5px;
        height: 100%;
        border-radius: 1.5px;
        background-color: $primary;
        position: absolute;
        right: 0;
        top: 0;
        visibility: hidden;
      }

      &--active {
        color: $white;
        opacity: 1;

        &::after {
          visibility: visible;
        }
      }
    }
  }

  &__logo {
    margin-bottom: 60px;
    padding: 20px 20px 0;
  }

  &__menu {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  &__menu-icon {
    color: $secondary;
    display: block;
    font-size: 40px;
    margin-bottom: 3px;
    opacity: .4;
  }

  &__menu-item {
    text-align: center;
    position: relative;

    &::after {
      content: "";
      display: block;
      width: 40px;
      height: 2px;
      opacity: 0.2;
      border-radius: 0.5px;
      background-color: $secondary;
      position: absolute;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
    }
  }

  &__menu-link {
    color: txtColorSwitch($dark-theme: $isDarkTheme, $other-color: true, $light-color: $link-color, $dark-color: $dark-secondary);
    font-size: 14px;
    padding: 20px 0;
    display: block;
    position: relative;

    &--active {
      color: txtColorSwitch($dark-theme: $isDarkTheme, $other-color: true, $light-color: $link-color, $dark-color: $white);
    }

    &--active .pass-sidebar__menu-icon {
      opacity: 1;
      color: $primary;
    }

    &--active::after {
      content: "";
      display: block;
      width: 5px;
      height: 100%;
      border-radius: 5px;
      background-color: $primary;
      position: absolute;
      right: 0;
      top: 0;
    }

    &:hover {
      text-decoration: none;
      color: txtColorSwitch($dark-theme: $isDarkTheme, $other-color: true, $light-color: #2a2828, $dark-color: $white);
    }

    &:hover .pass-sidebar__menu-icon {
      opacity: 1;
    }
  }

  &__search {
    background-color: transparent !important;
    padding: 0 !important;
  }

  &__search-container {
    padding: 0 30px;
  }
}


// DROPDOWN

.#{ $theme-prefix }-dropdown {
  position: absolute;
  width: 100%;
  top: 45px;
  z-index: 9;
  background-color: $white;
  box-shadow: 0px 1px 10px 1px rgba(38, 38, 38, 0.5);
  border-radius: 3px;
  max-height: 400px;
  overflow: auto;

  &__ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  &__li {
    position: relative;
    cursor: pointer;

    &:nth-child(even) {
      background-color: $body-background;
    }

    &:nth-child(odd) {
      background-color: $white;
    }

    &:not(:last-of-type)::after {
      content: "";
      position: absolute;
      display: block;
      height: 1px;
      width: 95%;
      background-color: rgba(0, 0, 0, 0.1);
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
    }

    &:hover {
      background-color: rgba(0, 0, 0, 0.1);
    }
  }

  &__link {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: $primary !important;
  }

  &__span {
    display: block;
    color: gray;
    font-size: 14px;
  }
}

.btn-secondary {
  color: $white !important;
}