/*!
 * Thunderstorm is a full web app framework!
 *
 * Typescript & Express backend infrastructure that natively runs on firebase function
 * Typescript & React frontend infrastructure
 *
 * Copyright (C) 2020 Adam van der Kruk aka TacB0sS
 *
 * Licensed 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 '@nu-art/ts-styles' as styles;

$headerHeight: 40px;

.ts-app-tools {
  width: 100%;
  height: 100%;
  background: styles.gray(6);

  .ts-app-tools__header {
    width: 100%;
    height: $headerHeight;
    align-items: center;
    background: styles.gray(2);
    gap: 16px;

    .ts-app-tools__header__title {
      min-width: 0;
      flex-shrink: 1;
      overflow: hidden;
      color: white;
      font: {
        size: 20px;
        weight: bold;
      }
    }

    .ts-app-tools__header__caret {
      width: 40px;
      height: 40px;
      padding: 6px;
      cursor: pointer;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-shrink: 0;
      @include styles.color-svg(white);
    }
  }

  .ts-app-tools__main {
    width: 100%;
    height: calc(100% - $headerHeight);
  }

  .ts-app-tools__nav-bar {
    height: 100%;
    width: 300px;
    transition: width 200ms ease-out;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid styles.gray(4);
    @include styles.hide-scroll-bar;

    .ts-collapsable-container {
      width: 100%;

      .ts-collapsable-container__header {
        box-shadow: none;
        background: styles.gray(3);
        border: none;
        font: {
          size: 16px;
          weight: bold;
        }
        color: white;
        padding-left: 8px;
        position: relative;

        .ts-collapsable-container__header__caret {
          @include styles.color-svg(white);

          &:not(.collapsed) {
            transform: rotateZ(90deg);
          }
        }

        &:after {
          content: '';
          height: 2px;
          background: white;
          translate: -50%;
          width: 0;
          position: absolute;
          bottom: 0;
          left: 50%;
          transition: width 100ms ease-out, transform 100ms ease-out;
        }

        &.collapsed:after {
          width: 100%;
        }
      }
    }

    .ts-app-tools__nav-bar__item {
      width: 100%;
      height: 30px;
      text-decoration: none;
      display: flex;
      align-items: center;
      gap: 8px;

      @include styles.mouseInteractiveBackground(styles.gray(6), styles.gray(4), styles.gray(2));
      @include styles.mouseInteractiveIcon(black, black, white);
      @include styles.mouseInteractiveText(black, black, white);

      .ts-app-tools__nav-bar__item__title {
        color: inherit;
        font: {
          size: 16px;
          weight: bold;
        }
      }

      .icon--wrapper {
        width: 30px;
        height: 30px;
        padding: 4px 0;
      }

      &.selected {
        background: styles.gray(2);
        color: white;

        .icon--wrapper {
          @include styles.color-svg(white);
        }
      }
    }

    &.ts-app-tools__nav-bar-collapsed {
      width: 30px;
    }
  }

  .ts-app-tools__page {
    height: 100%;
    flex-grow: 1;
    display: inline-block;

    .app-tools-page__page__header {
      padding: 8px 0;
      margin: 0 16px 8px;
      border-bottom: 2px solid black;
      font: {
        size: 28px;
        weight: bold;
      }
    }
  }
}

#app-tools-default {
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;

  .title {
    font: {
      size: 40px;
      weight: bold;
    }
  }

  .sub-title {
    font: {
      size: 32px;
      weight: bold;
    }
  }
}