/**
 * @license
 * Copyright Endlessjs. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */

@import '../../../styles/core/mixins';

::ng-deep el-layout.modal-half {
  .layout {
    transition: transform 0.6s, opacity 0.6s;
    transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
  }
}

::ng-deep el-layout.modal-half.with-search {
  .layout {
    transform: scale3d(0.8, 0.8, 1);
    pointer-events: none;
  }
}

:host.modal-half {

  .search {
    text-align: center;
    position: fixed;
    z-index: 1050;
    top: 0;
    left: 0;
    overflow: hidden;
    width: 100%;
    height: 100vh;
    background: none;
    pointer-events: none;

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.6s;
      transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
    }

    button {
      font-size: 2.5rem;
      position: absolute;
      top: 3rem;
      @include el-ltr(right, 3rem);
      @include el-rtl(left, 3rem);
      display: block;
      z-index: 100;
      opacity: 0;
      transform: scale3d(0.8, 0.8, 1);
      transition: opacity 0.6s, transform 0.6s;
      transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
    }

    .form-wrapper {
      position: absolute;
      display: flex;
      justify-content: center;
      align-items: center;
      width: 100%;
      height: 50%;
      transition: transform 0.6s;
      transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
      transform: translate3d(0, -100%, 0);
    }

    form {
      width: 75%;
      margin: 0 auto;
    }

    input {
      font-size: 7vw;
      width: 100%;
    }
  }

  &.show {
    .search {
      pointer-events: auto;

      &::before {
        opacity: 1;
      }

      button {
        opacity: 1;
        transform: scale3d(1, 1, 1);
      }

      .form-wrapper {
        transform: translate3d(0, 0, 0);
      }
    }
  }
}
