// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) KALEIDOS INC

@import "refactor/common-refactor.scss";

.workspace-header-left {
  display: flex;
  align-items: center;
  height: $s-48;
  padding: $s-8 $s-8 $s-4 $s-8;
  .main-icon {
    @include flexCenter;
    width: $s-32;
    height: $s-32;
    margin-right: $s-4;
    svg {
      height: $s-32;
      fill: var(--icon-foreground-hover);
    }
  }
  .project-tree {
    flex-grow: 1;
    max-width: calc(100% - $s-64);
    position: relative;
    .project-name,
    .file-name {
      @include tabTitleTipography;
      @include textEllipsis;
      height: $s-16;
      width: 100%;
      padding-bottom: $s-2;
      margin-top: -2px;
      color: var(--title-foreground-color);
      cursor: pointer;
    }
    .file-name {
      @include medTitleTipography;
      text-transform: none;
      color: var(--title-foreground-color-hover);
    }
    .file-name-input {
      @include flexCenter;
      height: 100%;
      width: 100%;
      margin: 0;
      border: 0;
      border-radius: $br-4;
      background-color: var(--input-background-color);
      font-size: $fs-14;
      color: var(--input-foreground-color);
      z-index: 20;
      white-space: break-spaces;
      &:focus {
        outline: none;
      }
    }
  }
  .shared-badge {
    @include flexCenter;
    width: $s-16;
    height: $s-32;
    margin-right: $s-4;
    svg {
      stroke: var(--button-secondary-foreground-color-rest);
      fill: none;
      height: $s-16;
      width: $s-16;
    }
  }
  .menu-btn {
    @extend .button-tertiary;
    height: $s-32;
    width: calc($s-24 + $s-4);
    padding: 0;
    border-radius: $br-8;
    svg {
      @extend .button-icon;
      stroke: var(--icon-foreground);
    }
  }
  .menu {
    @extend .menu-dropdown;
    top: $s-48;
    left: calc(var(--width, $s-256) - $s-16);
    width: $s-192;
    margin: 0;

    .menu-item {
      @extend .menu-item;
      cursor: pointer;
    }
    .separator {
      height: $s-12;
    }
    .shortcut {
      @extend .shortcut;
    }
    .shortcut-key {
      @extend .shortcut-key;
    }
    .menu-item {
      @extend .menu-item;
      .open-arrow {
        @include flexCenter;
        svg {
          @extend .button-icon;
          stroke: var(--icon-foreground);
        }
      }
      &:hover {
        color: var(--menu-foreground-color-hover);
        .open-arrow {
          svg {
            stroke: var(--menu-foreground-color-hover);
          }
        }
        .shortcut-key {
          color: var(--menu-shortcut-foreground-color-hover);
        }
      }
    }
  }
  .sub-menu {
    @extend .menu-dropdown;
    left: calc(var(--width, $s-256) + $s-180);
    width: $s-192;
    min-width: calc($s-272 - $s-2);
    width: 110%;
    .shortcut {
      @extend .shortcut;
    }

    .shortcut-key {
      @extend .shortcut-key;
    }
    .submenu-item {
      @extend .menu-item;
      &:hover {
        color: var(--menu-foreground-color-hover);
        .shortcut-key {
          color: var(--menu-shortcut-foreground-color-hover);
        }
      }
    }

    .shortcut {
      @extend .shortcut;
    }

    .shortcut-key {
      @extend .shortcut-key;
    }

    &.file {
      top: $s-48;
    }

    &.edit {
      top: $s-76;
    }

    &.view {
      top: $s-116;
    }

    &.preferences {
      top: $s-148;
    }

    &.help-info {
      top: $s-196;
    }
  }
}
