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

:global {
  .branch-list {
    border: 1px solid var(--border--neutral);
    border-radius: 4px;
    height: 100%;
    position: relative;

    &-empty-state-trigger {
      color: var(--text--brand);
      cursor: pointer;
      font-weight: 400;
      height: 18px;

      &:hover,
      &:focus-visible {
        text-decoration: underline;
        background: none !important;
      }
    }

    &-no-results {
      min-height: 82px;
    }

    .view-state-wrapper {
      width: 100%;
      height: 100%;
      position: absolute;
    }

    &-name {
      height: 36px;
      border-top-left-radius: 4px;
      border-top-right-radius: 4px;
      padding: 8px;
      background: var(--fill--secondary);
      font-size: 14px;
      font-weight: 600;
    }

    &-container {
      height: calc(100% - 36px);
    }
    &-menu-item {
      width: 160px;
      &-delete {
        color: var(--fill--danger--solid);
      }
    }

    &-item {
      padding: 16px;
      display: flex;
      height: 100%;

      &-divider {
        width: 1px;
        height: 24px;
        margin: 0 8px;
        background-color: var(--border--neutral);
      }
      &-container {
        cursor: pointer;
        border-bottom: 1px solid var(--border--neutral);
        height: 82px;

        &:hover,
        &:focus-visible {
          background-color: var(--fill--primary--hover);
          .branch-list-item-icons {
            opacity: 1;
          }
        }

        &:focus-within {
          .branch-list-item-icons {
            opacity: 1;
          }
        }

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

      &-content {
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: flex;
        font-size: 14px;
        flex-direction: column;
        justify-content: center;
        &-bottom {
          display: flex;
          align-items: center;
          padding-top: 4px;
          &-commit {
            display: flex;
            align-items: center;
          }
          .commitEntryHash {
            margin-left: 2px;
            text-decoration: none;
          }
        }
      }

      &-name {
        color: var(--text--primary);
        font-weight: 600;
        text-decoration: none;
        &:hover,
        &:focus {
          text-decoration: none;
        }
      }

      &-message {
        &-container {
          display: inline-flex;
        }
        &-tooltip {
          display: flex;
          max-height: 200px;
          overflow: auto;
        }
        width: auto;
        max-width: 440px;
      }

      &-by {
        color: var(--text--faded);
        margin-left: 2px;
        margin-right: 6px;
      }
      &-author {
        margin-left: 4px;
      }

      &-settings-icon .settings-button {
        background: transparent;
        border: none;
        &:hover {
          color: var(--icon--hover);
        }
      }
      &-icons {
        display: flex;
        align-items: center;
        white-space: nowrap;
        color: var(--icon--primary);
        opacity: 0;
      }
    }
  }
}
