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

#sitemap,
.sitemap {
  height: var(--height, 200px);

  .element-list,
  .pages-list {
    li {
      align-items: center;
      display: flex;
      flex-direction: row;
      width: 100%;

      .page-icon {
        svg {
          fill: $color-gray-30;
          height: 13px;
          margin-right: $size-1;
          width: 13px;
        }
      }

      span {
        color: $color-gray-20;
        font-size: $fs12;
        max-width: 75%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .page-actions {
        align-items: center;
        display: none;
        margin-left: auto;

        button {
          border: none;
          background-color: transparent;
          svg {
            fill: $color-gray-60;
            height: 15px;
            margin-left: $size-1;
            width: 15px;
          }
        }
      }

      &:hover {
        background-color: $color-primary;

        .page-icon {
          svg {
            fill: $color-gray-60;
          }

          span {
            color: $color-gray-60;
          }
        }

        .page-actions {
          display: flex;
        }
      }

      &.selected {
        .page-icon {
          svg {
            fill: $color-primary;
          }
        }

        span {
          color: $color-primary;
        }
      }

      &:hover {
        .page-icon {
          svg {
            fill: $color-gray-60;
          }
        }

        span {
          color: $color-gray-60;
        }
      }
    }

    .element-list-body {
      align-items: center;
      display: flex;
      padding: $size-1 $size-2;
      transition: none;
      width: 100%;

      svg {
        fill: $color-gray-60;
        height: 13px;
        margin-right: 8px;
        width: 13px;
      }

      .element-actions {
        align-items: center;
        display: flex;
        flex-shrink: 0;
        width: 62px;
      }

      &.dragging {
        // TODO: revisit this
        background-color: $color-gray-10;
      }
    }
  }

  & .resize-area {
    position: absolute;
    width: 100%;
    height: 16px;
    bottom: -8px;
    left: 0;
    cursor: ns-resize;
  }
}

.add-page,
.collapse-pages {
  align-items: center;
  background-color: transparent;
  border-radius: $br3;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  justify-content: center;
  margin-left: auto;
  padding: $size-1;

  svg {
    fill: $color-gray-20;
    height: 0.7rem;
    width: 0.7rem;
  }

  &:hover {
    background-color: $color-primary;

    svg {
      fill: $color-gray-60 !important;
    }
  }
}

.title-actions {
  align-items: center;
  display: flex;
  justify-content: center;
  margin-left: auto;
  .layout-btns {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
  .remove-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 21px;
    width: 21px;
    padding: 4px;
    svg {
      height: 0.7rem;
      width: 0.7rem;
    }
  }
  button {
    background-color: transparent;
    border-radius: $br3;
    border: 1px solid transparent;
    cursor: pointer;
    color: $color-gray-20;
    svg {
      fill: $color-gray-20;
      height: 0.7rem;
      width: 0.7rem;
    }
    &.active {
      color: $color-primary;
    }

    &:hover {
      background-color: $color-primary;
      color: $color-gray-60;
      svg {
        fill: $color-gray-60 !important;
      }
    }
  }
}

.element-set-title-actions {
  display: flex;
  flex-direction: row;
  flex: 1;
  justify-content: flex-end;

  .add-page {
    margin: 0;
  }
}

.collapse-pages {
  margin-left: $size-2;

  svg {
    transform: rotate(90deg);
  }
}
