// Licensed to Cloudera, Inc. under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  Cloudera, Inc. licenses this file
// to you 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.

@use 'variables' as vars;

$icon-width: 24px;
$icon-height: 24px;

.hue-path-browser {
  display: flex;
  width: 100%;

  .hue-path-browser__file-system-icon {
    object-fit: cover;
    width: $icon-width;
    height: $icon-height;
    margin: 0 vars.$fluidx-spacing-xs;
  }

  .hue-path-browser__toggle-breadcrumb-input-btn:empty {
    pointer-events: auto;
    width: 60px;
    visibility: visible;
    border: none;
    box-shadow: none;
    padding: 0;
    background-color: vars.$fluidx-white;

    &:hover {
      cursor: text;
      background-color: vars.$fluidx-gray-100;
    }

    &:focus {
      background-color: vars.$fluidx-gray-100;
    }
  }
}

.hue-path-browser__breadcrumbs {
  /* stylelint-disable no-invalid-position-at-import-rule */
  @import './OverflowingItem.scss';

  display: flex;
  gap: vars.$fluidx-spacing-xs;
  max-width: 60%;

  &:hover {
    cursor: pointer;
  }

  .hue-path-browser__dropdown-button {
    border: none;
    box-shadow: none;
    background-color: transparent;

    &:hover {
      background-color: vars.$fluidx-gray-100;
    }

    &:focus {
      background-color: vars.$fluidx-gray-100;
    }
  }

  .hue-path-browser__breadcrumb:last-of-type button:last-of-type {
    color: vars.$fluidx-gray-700;
  }
}

.hue-path-browser__breadcrumb-seperator {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
}

.hue-path-browser__dropdown {
  width: 200px;
  background-color: vars.$fluidx-gray-200;

  .ant-dropdown-menu {
    max-height: 200px;
    overflow-y: scroll;
  }

  .ant-dropdown-menu-title-content {
    display: inline-block;
    overflow-x: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

.hue-path-browser-panel {
  .hue-path-browser__input {
    width: 300px;
    flex: 0 0 auto;

    .ant-input-prefix {
      width: $icon-width;
      height: $icon-height;
      object-fit: cover;
    }
  }

  .hue-path-browser-panel__button {
    border: none;
    box-shadow: none;
    color: vars.$fluidx-blue-400;
    padding: 0;
    width: 100%;

    &:hover {
      border: vars.$fluidx-gray-300 solid 1px;
    }

    &:focus {
      border: vars.$fluidx-gray-300 solid 1px;
    }
  }
}
