/*
 * Copyright 2015-2016 Imply Data, Inc.
 * Copyright 2017-2019 Allegro.pl
 *
 * 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.
 */

@import '../../imports';

.side-drawer {
  $drawer-v-padding: 10px;

  @include pin-left($side-drawer-width);
  background: $white;
  font-size: 13px;
  box-shadow: 1px 0 2px 0 hsla(0, 0, 0, 0.13), 2px 0 12px 0 hsla(0, 0, 0, 0.26);
  overflow: auto;
  z-index: 80;

  .data-cubes__message {
    border-top: 1px solid #ddd;
    padding: 8px 18px;
  }

  .data-cubes__list {
    .search-input {
      border-top: 1px solid #ddd;
      padding: 8px 18px;

      .clearable-input .clear {
        top: 1px;
      }
    }
  }

  .home-container {
    padding-top: $drawer-v-padding;
    padding-bottom: $drawer-v-padding;
    border-top: 1px solid #ddd;
  }

  .home-link {
    line-height: 34px;
    padding: 0 $nav-padding;
    cursor: pointer;

    .svg-icon {
      opacity: 0.6;
      height: 19px;
      width: 19px;
      display: inline-block;
      top: 7px;
      left: 0;
      margin-right: 9px;

      path {
        @include css-variable(fill, brand);
      }
    }

    &:hover,
    &.selected {
      @include css-variable(background-color, brand-hover);

      .svg-icon {
        opacity: 1;
      }
    }

    &.selected {
      svg path {
        @include css-variable(fill, brand);
      }
    }
  }

  .nav-list {
    padding-top: $drawer-v-padding;
    padding-bottom: $drawer-v-padding;

    .items {
      .item {
        .icon {
          opacity: 0.6;

          svg path {
            @include css-variable(fill, brand);
          }
        }

        &:hover,
        &.selected {
          .icon {
            opacity: 1;
          }
        }
      }
    }
  }
}

.side-drawer-enter {
  transform: translate(-$side-drawer-width - 1, 0);

  &.side-drawer-enter-active {
    transform: translate(0, 0);
    transition: transform .2s cubic-bezier(.4, 0, .2, 1) .1s;
  }
}

.side-drawer-exit {
  transform: translate(0, 0);

  &.side-drawer-exit-active {
    transform: translate(-$side-drawer-width - 1, 0);
    transition: transform .2s cubic-bezier(.4, 0, .2, 1) .1s;
  }
}
