@import "../assets/styles/bootstrap/variables";

.worksheet {

  flex-grow:1;
  margin:15px;
  display:flex;
  flex-direction: column;

  .nav.nav-pills{
    margin-top: -60px;
    padding-top: 13px;
    background: $gray-lighter;
    position: relative;
    z-index: 101;
  }
  

  &.panel{
    box-shadow: none;
    margin-bottom: 0;

    &.panel-default{
      border: none;
    }

  }

  .content{
    .back-button{
      opacity: 0;
      transform: translateY(-60px);
      width: 200px;
      transition: transform ease-in-out .2s, opacity ease-in-out .1s .05s;
    }
  }

  .nav-scroll-fixed{
    height: 60px;
    background: $gray-lighter;
    transition: box-shadow ease-in-out .2s;
    margin-left: -15px;
    margin-right: -15px;
    position: relative;
    z-index: 100;
  }

  .fixed{
    &:before{
      content: "";
      display: block;
      height: 60px;
    }

    .nav-scroll-fixed{
      position: fixed;
      box-shadow: 0px 2px 0px $gray-lighter-shadow;
      width: 100%;
      top: 0;
      z-index: 100;

    }

    .nav.nav-pills{
      position: fixed;
      top: 60px;
      z-index: 101;
    }

    .back-button{
      position: fixed;
      z-index: 102;
      top: 60px;
      transform: translateY(0px);
      opacity: 1;
    }

  }

  .back-button{
    margin-top: -60px;
    height: 60px;
    line-height: 56px;
    font-size: 14px;
    vertical-align: middle;
    padding-left: 11px;

    a{
      color: $gray;
      text-decoration: none;
      cursor: pointer;

      &:first-child{
        i{
          display: none;
        }
      }

      &:hover{
        color: $gray-dark;

        i{
          color: $gray;
        }
      }

      &:last-child{
        .text{
          font-weight: bold;
          color: $gray-dark;
        }
      }
    }
    
    i{
      vertical-align: middle;
      font-size: 18px;
      margin-left: 5px;
    }

    .text{
      vertical-align: middle;
      padding-left: 5px;
      font-weight: normal;
    }
  }

  .worksheet-subtitle{
    padding-left: 15px;
    width: 80%;
    color: $gray-dark;
  }
}

.item-props{
  display: flex;
  margin-bottom: 30px;
  margin-top: 30px;
  padding-left: 15px;
  font-size: 9pt;

  &:empty{
    margin: 0;
  }

  .item-prop{
    margin-right: 10px;

    small{
      margin-right: 5px;
    }

    &.with-link{

    }

    &.no-link{
      cursor: default;
    }

    .icon{
      margin-right: 5px;
    }

    .icon-link{
      i{
        margin-left: 5px;
        margin-right: -5px;
        border-left: 1px solid rgba(255, 255, 255, 0.23);
        margin-top: -3px;
      }
    }
  }

  .btn-group {
    margin-right: 25px;

    & > .btn:last-child:not(:first-child){
      border-bottom-left-radius: $border-radius-small;
      border-top-left-radius: $border-radius-small;
    }
  }

  .icon-btn.btn {
    background: transparent;
    border: 1px solid transparent;
    color: $gray-dark;

    &:active, &.active, &:focus, &.focus{
      background: transparent;
      border: 1px solid transparent;
      color: $gray-dark;
      box-shadow: none;
      outline: 0;
    }
  }

  // .item-prop{
  //   margin-right: 30px;
  //   color: $gray-dark;

  //   i{
  //     font-size: 16px;
  //     margin-right: 12px;
  //     color: $gray;
  //     line-height: 28px;
  //     // border-right: 1px solid $gray;
  //     // padding-right: 10px;
  //   }
  // }
}

.nav-pills > li{
  &> a{
    border-radius: 0;
    border-bottom: 4px solid transparent;
    padding-bottom: 11px;
    color: $gray;
    height: 47px;
    text-transform: capitalize;
    font-weight: normal;

    &:hover{
      // border-color: $gray;
      color: $gray;
    }
  }

  &.active{
    &> a{
      background-color: transparent !important;
      border-color: $theme-primary;
      color: $gray-dark;
      font-weight: bold;

      &:hover{
        background: transparent;
        border-color: $theme-primary;

      }
    }
  }

}

.worksheet-header {

  flex-grow:1;

  color:white;
  background: var(--theme-primary);
  height:70px;
  padding-left:10px;
  font-size: x-large;

  display: flex;
  align-items: center

}

.worksheet-headertitle {

  flex-grow: 1;
  padding-left:15px;

  i {
    opacity: 0.4;
  }

  small{
    font-weight: normal;
    margin-left: 20px;
    padding-left: 15px;
    border-left: 2px solid $gray;
  }

}

.worksheet-headerbar {

  display: flex;
  justify-content: flex-end;
  position: relative;
  top: 35px;
  padding: 10px;
  padding-right: 15px;
  z-index:1000; /* never trumpled over by input fields scrolling up */

}




.worksheet-headerbar .circle-icon {
  padding: 10px;
  border-radius: 50%;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
}



.worksheet-headerbar .material-icons.md-24:hover { font-size: 26px; }


.worksheet-spinner {
}

.worksheet-spinner-group{
  .log{
    color: white;
    font-size: 16px;
    margin-top: 20px;
    font-weight: 100;
  }
}

.worksheet > .panel-heading {

     margin:0;
     padding:0 ;
     display:flex;

}

.worksheet > .panel-body {

     flex-grow:1;
     display:flex;
     flex-direction:column;
     flex-basis:0px;
     overflow: hidden;
     height: auto;

     .content{
      padding: 15px;
      padding-top: 0;
     }

}


/* buttons  */
.worksheet-button {
    border:solid 2px;
}


/* spinner  */
.worksheet-spinner-wrapper {

  position: fixed;

  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  z-index: 1050;
  background: rgba(0, 0, 0, 0.6);

}

.worksheet-spinner-group {

  position: absolute;
  top:calc(50vh - 45px);
  left:calc(50vw - 80px);
  z-index:1050;
  display:flex;
  flex-direction:column;
  align-items: center;
}

.worksheet-spinner-button {

  // background: var(--theme-background-dark) !important;
  height:40px;
  margin-top:20px;
  border:none;
  color:white;
  padding:10px;

}

.worksheet-spinner-button:hover {

  // color:var(--theme-app-primary) ;
  
}

.worksheet-spinner {
  background:transparent;
  font-size: 10px;
  text-indent: -9999em;
  border-top: .3em solid lightgrey;
  border-right: .3em solid lightgrey;
  border-bottom: .3em solid lightgrey;
  border-left: .3em solid var(--theme-app-primary);
  animation: load8 .8s infinite linear;
}

.worksheet-spinner,
.worksheet-spinner:after {
  border-radius: 50%;
  width: 5em;
  height: 5em;
}

@-webkit-keyframes load8 {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

@keyframes load8 {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

.worksheet {
    margin: 0;
    border: none;

    & > .panel-heading {
        border-bottom: none;
        padding-top: 60px;
        display: block;
    }

    & > .panel-body {
        padding: 0;
        display: block;
        flex: none;
        height: auto;
    }

    .worksheet-headertitle{
        font-size: 36px;
        font-weight: bold;
        padding-top: 10px;
        padding-left: 15px;
        padding-bottom: 0px;
    }

    .worksheet-header {
        height: auto;
        background: var(--theme-outline);
        color: var(--theme-text);
        flex: none;
        display: block;
    }

    .worksheet-headerbar{
        top: 0px;
        right: 0;
        position: fixed;
    }

    .circle-icon {
        // remove circle style
        border: none;
        transition: none;
        background: transparent !important;
        padding: 0;
        display: initial;
        width: auto;
        height: auto;
        color: inherit;
        box-shadow: none;
        //

        vertical-align: middle;

        &:hover{
            transform: scale(1.05);
        }

        &.material-icons.md-24{
            font-size: 19px;
        }
        
        &:hover{
            &.material-icons.md-24{
                font-size: 19px;
            }
        }
    }
}

.btn-topbar{

  &.btn {
    padding-left: 6px;
    font-size: 15px;
    min-width: 41px;
    padding-right: 6px;
    line-height: 15px;
    margin-left: 15px;

    &:active, &.active{
      box-shadow: none;
    }

    &.with-text{
      padding: 8px 15px;
      line-height: 21px;

      i{
        display: inline-block;
      }
    }

    .text{
      font-size: 14px;
      padding-right: 5px;
      font-weight: 400;
      padding-left: 5px;
    }

    &.disabled {
      opacity: .4;

      .material-icons {
        background: #868686
      }
    }
  }


  &.btn-group {
    margin-left: 15px;
  }

  &.btn-group .btn + .btn,
  &.btn-group .btn + .btn-group,
  &.btn-group .btn-group + .btn,
  &.btn-group .btn-group + .btn-group {
    margin-left: 0px;
  }



  &.with-error{
    &.disabled{
      opacity: 1;
    }
    .badge.badge-error{
      background: $theme-danger;
      padding: 2px 4px;
      margin-left: 6px;

      .material-icons{
        background: none;
        font-size: 15px;
        line-height: 13px;
        position: relative;
        top: 0px;
        right: 0px;
        color: white;
      }
    }
    .error-message-wrapper{
      transform: translateY(-15px);
      position: absolute;
      top: 40px;
      right: 0;
      opacity: 0;
      transform: translateY(-15px);
      transition: opacity .1s ease-in-out, transform .15s ease-in-out;
      padding-top:10px;
      display: block;
    }
    .error-message{
      background: $theme-danger;
      color: white !important;
      border-radius: 4px;
      padding-left: 7px;
      padding-right: 8px;
      text-align: right;
      padding-top: 4px;
      padding-bottom: 4px;
      display: block;
      position: relative;
      font-size: 9pt;

      &:after{
        content: "";
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 0px 5px 5px 5px;
        border-color: transparent transparent $theme-danger transparent;
        position: absolute;
        top: -4px;
        right: 23px;
      }
    }

    &:hover{
      .error-message-wrapper{
        opacity: 1;
        transform: translateY(-10px);
      }
    }
  }
}

a{
  &.btn-topbar{
    color: $btn-default-color;

  }
}

//animation
.worksheet-spinner-wrapper{
  $animation: cubic-bezier(0.190, 1.000, 0.220, 1.000); 
  $translateY: -60px;
  $translateYButton: -10px;
  $modalContentTransition: opacity .2s .05s ease-in, transform .3s .05s $animation;
  $btnTransition: opacity .1s $animation, transform .2s $animation;
  $bganimation: background .3s ease-in;
  background: rgba(0, 0, 0, 0.3);
  transition: $bganimation;

  .worksheet-spinner-spinner-wrapper{
    opacity: 1;
    transform: translateY(0);
    transition: $modalContentTransition;
  }

  .btn{
    opacity: 1;
    transform: translateY(0);
    transition: $btnTransition;
  }

  &.slide-enter {
    background: rgba(0, 0, 0, 0);
    transition: $bganimation;

    .worksheet-spinner-spinner-wrapper{
      opacity: 0;
      transform: translateY($translateY);
      transition: $modalContentTransition;
    }

    .btn{
      opacity: 0;
      transform: translateY($translateYButton);
      transition: $btnTransition;
    }


    &.slide-enter-active {
      background: rgba(0, 0, 0, 0.3);
      transition: $bganimation;
      
      .worksheet-spinner-spinner-wrapper{
        opacity: 1;
        transform: translateY(0px);
        transition: $modalContentTransition;
      }

      .btn{
        opacity: 1;
        transform: translateY(0);
        transition: $btnTransition;
      }
    }
  }

  &.slide-leave {
    background: rgba(0, 0, 0, 0.3);
    transition: $bganimation;
    .worksheet-spinner-spinner-wrapper{
      opacity: 1;
      transform: translateY(0);
      transition: $modalContentTransition;
    }
    .btn{
      opacity: 1;
      transform: translateY(0);
      transition: $btnTransition;
    }
    &.slide-leave-active {
      background: rgba(0, 0, 0, 0);
      transition: $bganimation;

      .worksheet-spinner-spinner-wrapper{
        opacity: 0;
        transform: translateY($translateY);
        transition: $modalContentTransition;
      }
      .btn{
        opacity: 0;
        transform: translateY($translateYButton);
        transition: $btnTransition;
      }
    }
  }
}

.form-group{

  &.form-group-sm{
    .input-group-addon{
      i{
        font-size: 20px;
        position: absolute;
        margin-top: -10px;
        margin-left: -10px;
      }
    }
  }
}