/*
 * Copyright (C) 2017-2019 Dremio Corporation
 *
 * 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.
 */
@import "~#oss/uiTheme/less/mixins.less";

:global {
  // DX-11429 TODO reafactor component to use css modules instead fo global classes

  .finder-nav-item {
    &:hover,
    &:focus,
    &:focus-within {
      background-color: var(--fill--primary--hover);
    }
    &:disabled {
      background-color: inherit;
    }

    .pin {
      opacity: 0;

      &:focus-visible {
        opacity: 1;
      }
    }

    &:hover {
      .pin {
        opacity: 1;
      }
    }

    .entity-link-wrapper {
      width: 100%;
    }

    .nav-item-ellipsed-text {
      display: flex;
      align-items: center;
      margin-right: 5px;
      width: 191px;
      span {
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }

    cursor: pointer;
    height: 32px;
    display: flex;
    align-items: center;

    a.finder-nav-item-link {
      //
      width: 100%;
      height: 100%;
      padding-left: var(--dremio--spacing--1);
      padding-right: var(--dremio--spacing--2);
      font-size: 14px;
      text-decoration: none !important;
      display: flex;
      flex-direction: row;
      align-items: center;

      &:hover,
      &:focus {
        .EllipsedText {
          text-decoration: underline !important;
        }
      }
      &.active {
        font-weight: 600;
        background-color: var(--fill--primary--selected);
      }
    }

    &.withExtra {
      .entity-link-wrapper {
        .flex-center;
      }
      a.finder-nav-item-link {
        .nav-item-ellipsed-text {
          width: auto;
          max-width: 55%;
          flex-grow: 0;
          flex-shrink: 0;
          span {
            overflow: hidden;
            text-overflow: ellipsis;
          }
        }
      }
    }

    .extra-content {
      margin-left: 8px;
      margin-right: 8px;
      flex: 1;
      max-width: fit-content;
      min-width: 0;
      .branchPickerTag {
        max-width: 100%;
      }
    }

    &.readonly {
      opacity: 0.5;
    }

    .fa {
      &.off {
        color: var(--fill--danger--solid);
      }
      &.on {
        color: var(--color--green--300);
      }
      &.in-border {
        font-size: 10px;
        margin: 0 5px 0 0;
        border: 1px solid #111;
        color: #111;
        display: flex;
        justify-content: flex-end;
        align-items: flex-end;
        width: 14px;
        height: 14px;
        float: left;
        border-radius: 2px;
        line-height: 6px;
      }
    }

    .count {
      font-size: 12px;
      color: var(--text--faded);
    }
  }
}
