/*
 * Copyright 2023 Harness, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

html[class=''] {
  .button:focus {
    --border: 1px solid var(--primary-7) !important;
  }
}

.branchContainer {
  :global(> .bp3-button-text) {
    display: flex !important;
    > .branchSpan {
      display: flex !important;
      align-items: center !important;
      padding-right: var(--spacing-tiny);
    }
  }
}

.button {
  --border: 1px solid var(--grey-200) !important;
  --background-color-active: var(--white) !important;
  --box-shadow: none !important;
  white-space: nowrap !important;

  &:active,
  &:hover,
  &[class*='bp3-active'] {
    --border: 1px solid var(--primary-7) !important;
  }

  .prefix {
    color: var(--grey-450) !important;
    font-weight: normal;
    padding-right: var(--spacing-xsmall);
  }

  :global {
    .bp3-button-text {
      max-width: 250px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}

.main {
  .input {
    margin-bottom: 0 !important;

    span[data-icon],
    span[icon] {
      margin-top: 10px !important;
    }
  }

  .tabContainer {
    margin-top: 0 !important;

    [role='tablist'] {
      background-color: var(--white) !important;
      padding-left: 0;
      padding-right: 0;
      border-bottom: 1px solid var(--grey-200);
    }

    [role='tabpanel'] {
      margin-top: 0;
    }

    &.branchesOnly {
      [role='tablist'] {
        display: none;
      }
    }
  }
}

.popover {
  > div[class*='popover-arrow'] {
    display: none;
  }

  .listContainer {
    min-height: 50px;
    max-height: 200px;
    overflow-y: auto;

    :global {
      a.bp3-menu-item:hover {
        background: var(--primary-1) !important;
        color: var(--grey-1000) !important;
      }

      .bp3-menu-item {
        max-width: 600px;
      }
    }
  }

  .newBtnText {
    font-weight: normal;
  }
}
