/*
 * 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.
 */

.main {
  padding: 0 var(--spacing-large) var(--spacing-large) !important;

  .spaceSelector {
    height: 53px;
    border-radius: 4px;
    padding: 5px 10px;
    border: 1px solid var(--grey-100);
    background: var(--white) !important;
    margin-bottom: var(--spacing-medium) !important;

    &.selected,
    &:hover {
      background: var(--primary-1) !important;
      border-radius: 4px;
      border: 1px solid var(--primary-3);
      box-shadow: 0px 2px 4px 0px rgba(96, 97, 112, 0.16), 0px 0px 1px 0px rgba(40, 41, 61, 0.04);

      .icon {
        svg path {
          fill: var(--primary-7);
        }
      }
    }

    .label {
      flex-grow: 1;
    }

    .spaceLabel {
      color: var(--gray-500);
      font-size: 8px;
      font-weight: 600;
      line-height: 17px;
    }

    .spaceName {
      color: var(--black);
      font-size: 13px;
      line-height: 20px;
      padding-left: 17px;
    }

    .icon {
      display: flex;
      align-items: center;
      padding-top: 3px;
    }
  }

  .repoLinks {
    border-left: 1px solid var(--grey-200);
    margin-left: 17px;
  }
}

.popoverPortal {
  width: min(calc(100vw - var(--nav-menu-width)), 840px) !important;
  height: 100vh;
  position: fixed;
  left: 5px;
  top: -5px;

  > div {
    height: 100%;
    width: 100%;
  }
}

.popoverTarget {
  display: block !important;
}

.popoverContent {
  position: relative;
  height: 100%;
  width: min(calc(100vw - var(--nav-menu-width)), 840px) !important;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0px 2px 4px rgba(96, 97, 112, 0.16)) drop-shadow(0px 0px 1px rgba(40, 41, 61, 0.04));

  &::before {
    position: fixed;
    content: '';
    top: 0;
    left: 233px;
    width: 100vw;
    height: 100vh;
    background-color: rgba(26, 26, 26, 0.4);
  }

  > div {
    height: 100%;
    width: 100%;
    max-width: inherit !important;
    border-radius: 0 !important;

    &::before {
      box-shadow: none !important;
      filter: drop-shadow(0px 2px 4px rgba(96, 97, 112, 0.16)) drop-shadow(0px 0px 1px rgba(40, 41, 61, 0.04));
    }
  }
}
