@import "ui-variables";
@import "octicon-mixins";

@close-icon-size: 12px;

.tab-bar {
  display: -webkit-flex;
  -webkit-user-select: none;
  margin: 0;

  .tab {
    font-size: 11px;
    position: relative;
    padding-left: 10px;
    padding-right: 10px + @close-icon-size + 2px;
    -webkit-user-drag: element;
    -webkit-flex: 1;
    max-width: 175px;
    min-width: 40px;

    &.active {
      -webkit-flex: 2;
      width: -webkit-fit-content;

      .title {
        padding-right: 10px;
      }
    }

    .title {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .hide-icon {
      &.icon:before {
        display: none;
      }
    }

    .close-icon {
      .octicon(x, @close-icon-size);
      position: absolute;
      top: 1px;
      right: 10px;
      cursor: default;
    }

    &.modified:hover .close-icon {
      color: @background-color-info;
    }

    &.modified:not(:hover) .close-icon {
      &:before { display: none; }
      top: 11px;
      right: 11px;
      width: 8px;
      height: 8px;
      border: 2px solid @background-color-info;
      border-radius: 12px;
    }
  }

  /* Drag and Drop */
  .placeholder {
    position: absolute;
    top: 0;
    z-index: 999;
    display: inline-block;
    width: 2px;
    margin: -1px; padding: 0;

    height: @tab-height;
    display: inline-block;
    background: @background-color-info;

    list-style: none;

    &:after {
      content: "";
      position: absolute;
      top: @tab-height;
      margin: -1px;
      z-index: 9999;
      width: 4px;
      height: 4px;
      background: @background-color-info;
      border-radius: 4px;
      border: 1px solid transparent;
    }
  }

  &.hidden {
    display: none;
  }
}
