// terminal scss start
:root {
  --terminal-bg: rgb(28, 28, 28);
}

.ac-terminal {
  width: 100%;
  border-top: 1px solid $color-border-dark;
  padding: 0;
  position: fixed;
  width: calc(100% - 250px);
  bottom: 0;
  background-color: var(--terminal-bg);
  color: $white-100;
  font-size: 1rem;
  height: 360px;
  z-index: 999;
  transition: 0.3s ease-in-out;

  .terminal-body {
    font-family: "Inconsolata", monospace;
    background-color: $black-100;
    height: 100%;
    color: $white-100;

    strong {
      color: $white-100;
    }
  }

  &.is-collapsed {
    height: 40px !important;
    bottom: 0px;

    .terminal-setting,
    .terminal-body {
      opacity: 0;
      visibility: hidden;
    }
  }

  .resize-handler {
    width: 100%;
    position: absolute;
    background: transparent;
    z-index: 9;
    cursor: row-resize;
    top: -15px;

    &:hover {
      border-bottom: 3px solid $secondary-30;
    }
  }

  .terminal-header {
    border-top: 1px solid $secondary-30;
    box-shadow: 1px -2px 5px 1px rgba(0, 0, 0, 0.08%);
    background-color: $ac-secondary;

    .tabs {
      padding: 0 8px 0 0;
      background-color: $ac-secondary;
      overflow: inherit;
      height: 40px;

      ul {
        border-bottom: none;
        padding-left: 0;
        max-width: 1340px;
        overflow-x: auto;
        overflow-y: hidden;

        li {
          &.is-active {
            background-color: $secondary-30;
          }
          a {
            margin-bottom: 0 !important;
          }
        }

        &::-webkit-scrollbar {
          border-radius: 50px;
          height: 3px;
        }

        &::-webkit-scrollbar:hover {
          height: 7px;
        }

        &::-webkit-scrollbar-thumb {
          background-color: $gray-50;
          border-radius: 50px;
          height: 2px !important;
        }

        &::-webkit-scrollbar-thumb:hover {
          background-color: $gray-50;
        }

        &:hover::-webkit-scrollbar-corner {
          height: 40px;
        }

        .is-active {
          box-shadow: none !important;
          margin-right: 0 !important;

          &:after {
            height: 2px;
          }

          a {
            background-color: $white-100;
          }
        }

        li:not(.is-active) {
          margin-right: -1px;
          border-right: 1px solid $secondary-30;
        }

        li {
          a {
            margin-bottom: 0px;
            font-size: 1rem;
            border-radius: 0;
            padding: 8px 8px 8px 20px;
            border: none;
            height: 40px;
            background-color: transparent !important;
            color: $white-100;

            .name-of-tab {
              width: 120px;
              overflow: hidden;
            }

            .terminal-icon {
              img {
                width: 15px;
                margin-right: 10px;
                margin-top: 5px;
              }
            }

            .button {
              color: $secondary-60;
              &:hover {
                background: transparent;
                color: $danger;
              }
            }
          }
        }
      }

      .ac-options {
        position: relative;
        height: 40px;
        width: 40px;

        &:hover {
          background-color: transparent;
        }
        .button {
          &.ac-button {
            height: 100%;
            border-radius: 0 4px 4px 0;
            z-index: 9;
            width: 40px;
          }
        }

        .options-items {
          top: 5px;
          left: 35px;
          position: absolute;
          background: $secondary-20;
          width: 150px;
          border-radius: 4px;
          box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
          z-index: 99;
          border-color: $secondary-30;

          .items-inner {
            border: none;

            li {
              border: none;
              border-right: none !important;
              border-bottom: 1px solid $secondary-30;
              width: 100%;

              &:last-child {
                border-bottom: none;
              }

              a {
                font-size: 1rem;
                padding: 10px 20px;
                justify-content: flex-start;
                border-bottom: 1px solid $primary-20;
                color: $white-100 !important;

                &:last-child {
                  border-bottom: none;
                }

                &:hover {
                  color: $ac-primary !important;
                }
              }
            }
          }
        }
      }

      .right-control {
        .button {
          .fa {
            font-size: 20px;
          }

          img {
            width: 11px;
          }
        }
      }
    }
  }

  .terminal-setting {
    background-color: $secondary-5;
    padding: 5px 20px 5px 0;

    .left-content {
      .ac-select-box-wrapper {
        margin-right: 10px;

        .multi-select-wrapper {
          min-width: 200px;
        }

        .multiselect .multiselect__tags .multiselect__input,
        .multiselect .multiselect__tags .multiselect__single {
          background-color: $ac-secondary;
        }
      }
    }

    .right-content {
      .status-message {
        background-color: $color-text !important;
        text-align: center;
        padding: 4px 20px;
        border-radius: 4px;
        color: $white-100 !important;
        text-transform: uppercase;

        &.is-success {
          background-color: #27b064 !important;
        }

        &.is-danger {
          background-color: $danger !important;
        }
      }
    }
  }

  .terminal-body {
    p {
      font-family: Fira Code;

      .code-static {
        color: #0ff05c;
        font-weight: 500;
      }

      .code-input {
        color: #acd9ff;
      }
    }
  }

  .button {
    &.is-transparent {
      &:hover {
        background-color: $secondary-30;
      }
    }
  }

  .multiselect.multiselect--active {
    .multiselect__tags {
      border: 1px solid $color-border !important;

      .multiselect__input {
        color: $white-100 !important;
      }
    }
  }

  .multiselect .multiselect__tags {
    background-color: $ac-secondary;
    border: 1px solid $secondary-30;
    &:hover {
      border-color: $secondary-40;
    }

    span {
      color: $white-100;
    }
  }
}

.notification-inner {
  h3 {
    color: $primary-97;
  }
}

.sidebar-collapsed {
  .ac-terminal {
    width: calc(100% - 60px);
  }
}

// kubedb terminal
.kubedb-terminal {
  .terminal-setting {
    background-color: $secondary-dark-gray;
    .terminal-configs {
      display: flex;
      align-items: center;
      color: $white-100;
      li {
        padding: 8px 16px 8px 16px;
        margin: 0px 0px;
        border-right: 1px solid $secondary-20;
        &:first-child {
          border-left: 1px solid $secondary-20;
        }
        button {
          background-color: transparent;
          border: none;
          color: $white-100;
          cursor: pointer;
          opacity: 0;
          visibility: hidden;
          margin: 0;
          padding: 0 0 0 10px;
          transition: 0.3 ease-in-out;
        }
        &:hover {
          button {
            opacity: 1;
            visibility: visible;
          }
        }
        &:last-child {
          border-right: none;
        }
        &.terminal-config-step {
          font-weight: 600;
          font-style: oblique;
        }
      }
    }

    .right-content {
      .multi-select-wrapper {
        min-width: 250px;
        margin-right: 0px;
        label.show-label {
          display: none;
        }

        .multiselect {
          .multiselect__tags {
            background-color: $secondary-30;
            border: none;
            .multiselect__input {
              color: $ac-primary;
              background-color: $secondary-30;
            }

            .multiselect__single {
              top: 0;
              color: $white-100;
              background-color: $secondary-30;
            }
            .multiselect__element {
              display: block;
              .multiselect__option {
                display: block;
                align-items: center;
              }
            }
          }
        }
      }
    }
  }
}
