@import 'breakpoints';

.xtd-search-flight{
  &[v-cloak] {
    display:none;
  }

  @include media-breakpoint-down(md) {
    .btn{
      display: block;
      width: 100%;
      margin-top: .5rem;
      font-size: 90%;
    }
    .btn-primary{
      font-size: 120%;
    }
  }
  &__leg{
    margin-bottom: 1rem;
    width: 100%;
    display: flex;
    flex-wrap: wrap;

    @include media-breakpoint-up(md) {
      align-content: stretch;
      position: relative;
      flex-wrap: nowrap;
    }


    label{
      text-transform: uppercase;
      font-size: 80%;
    }

  }
  &__from,
  &__to{
    flex-grow: 1;
    flex-basis: 100%;
    margin-bottom: 1rem;

    @include media-breakpoint-up(md) {
      flex-basis: 25%;
      display: flex;
      align-content: stretch;
      flex-direction: column;
      margin-bottom: 0;
    }

    .v-select{
      flex-grow: 1;

      .dropdown-toggle{
        height: 100%;
        border: 0;
        position: relative;
        border-radius: 0;

        .selected-tag{
          & + .form-control{
            width: 4px !important;
          }
        }
      }
    }
  }
  &__to{
    @include media-breakpoint-up(md) {
      margin-left: 10px;
    }
  }
  &__pax{
    flex-basis: 120px;
    margin-left: 10px;

    input{
      min-height: 3rem;
    }
    @include media-breakpoint-up(md) {
      flex-basis: 80px;
      display: flex;
      align-content: stretch;
      flex-direction: column;
      input{
        flex-grow: 1;
      }
    }
  }
  &__date{
    flex-grow: 1;
    flex-shrink: 1;

    input{
      min-height: 3rem;
    }
    @include media-breakpoint-up(md) {
      margin-left: 10px;
      display: flex;
      align-content: stretch;
      flex-direction: column;

      flex-basis: 15%;

      input{
        flex-grow: 1;
      }
    }
  }
  &__remove{
    margin-top: 1rem;
    display: inline-block;
    width: 1.75rem;
    height: 1.75rem;
    position: absolute;
    right: -2.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid currentColor;
    border-radius: 100px;
    line-height: 1rem;
    text-align: center;
    opacity: 0.75;

    &:hover{
      opacity: 1;
    }

    a,
    a:hover{
      text-decoration: none;
    }
  }
  &__requirements{
    margin-bottom: 1rem;
    position: relative;
  }
  &__airport-select{
    font-size: 90%;
    line-height: 1.3;

    small{
      display: block;
      opacity: 0.6;
    }
  }

  .v-select input[type=search],
  .v-select input[type=search]:focus{
    height: 3rem;
    line-height: 3;
    padding: 0 1rem;
  }
  .v-select .dropdown-toggle .clear,
  .v-select .dropdown-toggle .open-indicator{
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
  }
  .v-select .dropdown-toggle .spinner{
    bottom: auto;
    top: 30%;
  }
  .v-select .dropdown-toggle .open-indicator{
    transform: translateY(-30%);
  }
  .v-select .selected-tag{
    margin: .5rem 0 0 .5rem;
  }
}


.xtd-search-flight{

  &--modal{
    padding: 10vh 2rem;
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 1200px;
    top: 100%;
    transition: transform 360ms ease;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  &__toggle-modal{
    position: absolute;
    height: 3rem;
    line-height: 3rem;
    left: 0;
    right: 0;
    bottom: 100%;
    display: flex;
    flex-direction: row-reverse;
    padding: 0 1rem;
    transition: all 120ms ease;
    cursor: pointer;

    .fa{
      transform: rotate(270deg);
    }
    > div:last-child{
      flex-grow: 1;
    }

  }

  &--modal-opened{
    top: 0;
    bottom: 0;

    .xtd-search-flight__toggle-modal{
      top: 0;
      bottom: auto;
    }
  }


  @include media-breakpoint-up(lg) {

    &--modal{
      padding: 11vh 10vh;
      left: auto;
      right: 100%;
      top: 50%;
      transform: translateY(-50%);
      display: block;
    }

    &__toggle-modal{
      display: flex;
      flex-direction: column;
      position: absolute;
      left: 100%;
      transform-origin: bottom left;
      width: 2rem;
      height: auto;
      top: 0;
      bottom: 0;
      line-height: 2rem;
      padding: 0;

      .fa{
        transform: rotate(0deg);
      }

      > div:first-child{
        align-self: flex-start;
        text-align: center;
        width: 100%;
      }
      > div:last-child{
        align-self: flex-end;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding-bottom: 1rem;

        span{
          transform: rotate(270deg) translateX(-100%);
          display: inline-block;
          transform-origin: top left;
          white-space: nowrap;

          strong{
            display: inline-block;
            margin-right: 1rem;
          }
        }
      }
    }

    &--modal-opened{
      transform: translate(100%, -50%);
      box-shadow: 12.25rem 1.375rem 24.75rem 0rem rgba(0, 0, 0, 0.42) !important;
      bottom: auto;

      .xtd-search-flight__toggle-modal{
        top: 0;
        bottom: 0;
      }
    }

  }

}
