///////////////////////////////// Outliner /////////////////////////////////

// CONTAINER

#outliner .toolbar-button {
  border-radius: 0.125rem;
}

#outliner-content {
  overflow: hidden;
  position: absolute;
  bottom: 2.5rem;
  left: 0rem;
  right: 0rem;

  top: 0rem;

  &:hover header [role='toolbar'] {
    opacity: 1;
  }
}

.section {
  // margin-bottom: 1rem;

  // Show an outline to indicate the section needs attention
  &.attention {
    > div {
      padding: 1rem;
      i {
        text-decoration: none;
        color: var(--text-color);
      }
    }
    // Show all buttons, even without hover
    header div {
      opacity: 1;
    }
  }
}

// HIERARCHY

#tree-footer {
  flex: 1;
  min-height: 1rem;
}

#tag-hierarchy,
#location-list, 
#saved-searches-list {
  .btn-icon {
    display: none;
  }

  .tree-content-label:hover > .btn-icon,
  .tree-content-label > .btn-icon[aria-hidden='false'] {
    display: flex;
  }
}

// HEADER

#outliner-content header {
  height: 1.5rem;
  display: flex;
  align-items: center;
  padding: 0 0.5rem 0 1rem;
  background: var(--background-color);
  outline: 0.0625rem solid var(--border-color);

  h2 {
    cursor: pointer;
    flex-grow: 1;
  }

  [role='toolbar'] {
    opacity: 0;
  }

  [role='toolbar']:focus-within {
    opacity: 1;
  }

  .toolbar-button {
    min-height: 1.5rem;
    min-width: 1.5rem;

    &[aria-pressed='true'],
    &[aria-checked='true'] {
      color: var(--accent-color);
    }
  }
}

// LIST

.tree-content-label {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  height: 1.5rem;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;

  span {
    display: inline-flex;
  }

  // Invisible border for elimitating content resizing when adding border
  border: 2px solid transparent;
  margin-left: -2px;

  &[data-dnd-target='true'] {
    color: var(--accent-color);
    border: 2px solid transparent;

    &.center {
      border: 2px solid var(--accent-color);
    }

    &.top {
      border-top: 2px solid var(--accent-color);
    }

    &.bottom {
      border-bottom: 2px solid var(--accent-color);
    }
  }

  &[data-dnd-source='true'] {
    opacity: 0.25;
  }

  // For the folder/tag icon on the left of the label
  > .custom-icon,
  > span > .custom-icon {
    margin-right: 0.375rem;
    pointer-events: none;
  }

  > .btn-icon {
    cursor: pointer;
    margin-left: 0.25rem;

    &:disabled {
      cursor: not-allowed;
    }
  }

  > .label-text {
    flex: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: clip visible;
    line-height: 1;
    padding-bottom: 0px;
  }

  > .indicator {
    padding: 0.5rem;
  }

  input {
    width: 100%;
  }
}

// ACTIONBAR

#actionbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2rem;
  justify-content: center;

  .toolbar-button {
    margin: 0.25rem;
    padding: 0 0.25rem;
    min-height: 1.5rem;

    &:active,
    &:hover,
    &[aria-pressed='true'],
    &[aria-checked='true'] {
      color: var(--accent-color);
    }
  }

  span {
    margin: 0 0.125rem;
    font-size: 0.6875rem;
    font-weight: bold;
  }
}

#new-location {
  overflow: auto;
  max-height: 500px;
}

// Modals
.form-error {
  color: var(--accent-color-red);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}
