@teal-blue: #007eb1;
@background-content: #f2f5f6;
@silver-blue: #b8c6c8;
@silver: #c7d5d8;
@darkHotPink: #e40166;
@toolbar-text: #252525;

.has-toolbar {
  .pusher {
    height: 100px;
    transition: height 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);
  }
}

.has-toolbar-collapsed {
  .pusher {
    height: 20px;
    transition: height 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);
  }
}

#toolbar {
  .toolbar {
    position: fixed;
    z-index: 100;
    display: flex;
    width: 100%;
    height: 20px;
    flex-direction: column;
    background-color: #fff;
    box-shadow: 0 1px 2px 0 #c7d5d8;
    transition: height 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);

    &.expanded {
      height: 100px;

      .toolbar-actions {
        opacity: 1;
        transition: opacity 0.1s 0.2s;

        &.hidden {
          opacity: 0;
          transition: opacity 0.1s 0.2s;
        }
      }

      .toolbar-body {
        height: 100px;
      }

      .toolbar-handler {
        button {
          opacity: 0.3;
        }

        // State colors
        .published:before {
          background: @teal-blue;
        }

        .private:before {
          background: @darkHotPink;
        }
      }

      .toolbar-bottom {
        a {
          opacity: 1;
        }
      }

      .toolbar-bottom {
        .minipastanaga {
          bottom: 10px;
          opacity: 0;
          transition: bottom 0.3s 0.3s, opacity 0.3s;
        }
      }

      .toolbar-button-spacer {
        margin-left: auto;
      }
    }

    &-content {
      overflow: hidden;
      max-height: 0;
      background-color: #fff;
      box-shadow: 0 1px 2px 0 #c7d5d8;
      opacity: 0;
      // Removing this because is causing grey scroll appears
      // overflow-y: scroll;
      transition: max-height 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045),
        opacity 0.3s 0.3s;

      &.show {
        max-height: 900px;
        opacity: 1;
        transition: max-height 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045),
          opacity 0.3s 0.3s;
      }
    }

    &-body {
      display: flex;
      height: 0;
      flex-direction: row-reverse;
      transition: height 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);

      a,
      button {
        margin-left: 20px;
        color: @brown;
        cursor: pointer;
      }

      button {
        // Default reset for button
        padding: 0;
        border: 0;
        background: transparent;
        text-align: initial;

        &:focus {
          outline: none;
        }
      }
    }

    &-actions {
      display: flex;
      height: 100%;
      flex: 1;
      flex-direction: row-reverse;
      align-items: center;
      padding: 0 20px;
      opacity: 0;
      transition: opacity 0.1s 0.2s;

      .contents {
        color: @teal-blue;
      }

      .save {
        color: @teal-blue;
      }

      .cancel {
        color: @darkHotPink;
      }

      .edit {
        color: @teal-blue;
      }

      a,
      button {
        display: block;
      }
    }

    &-handler {
      position: absolute;
      bottom: 0;
      display: flex;
      width: 100%;
      justify-content: center;

      button {
        width: 80px;
        height: 20px;
        padding: 0;
        border: 0;
        background-color: transparent;
        cursor: pointer;
        transition: opacity 0.3s;

        &::before {
          position: relative;
          display: block;
          width: 100%;
          height: 4px;
          background-color: red;
          content: '';
        }
      }
    }

    &-bottom {
      display: flex;
      // flex: 1;
      align-items: center;

      a {
        opacity: 0;
      }

      .user {
        display: none;
      }

      .divider {
        display: none;
      }

      .pastanagalogo {
        display: none;
      }

      .minipastanaga {
        position: absolute;
        bottom: 2px;
        height: 14px;
        padding: 0 6px;
        opacity: 1;
        transition: bottom 0.3s 0.3s, opacity 0.3s 0.3s;
      }
    }
  }

  .toolbar-content,
  .toolbar {
    button {
      // Default reset for button
      padding: 0;
      border: 0;
      background: transparent;
      cursor: pointer;
      text-align: initial;

      &:focus {
        outline: none;
      }
    }
  }

  .toolbar-content {
    z-index: 12;
    box-shadow: 0 1px 2px 0 #c7d5d8;
    overflow-y: auto;
  }

  .pusher-puller {
    position: relative;
    z-index: 2;
    display: flex;
    width: 2000px;
    // min-height: 500px;
    transition: transform 300ms linear;
    will-change: transform;

    > * {
      // position: absolute;
      // width: 100%;
      // height: 100%;
      // top: 0;
      // left: 0;
    }

    // > *:first-child {
    //   position: relative;
    // }
  }

  @media only screen and (min-width: @largestMobileScreen) {
    .toolbar {
      width: 20px;
      height: 100%;
      flex-direction: row;
      justify-content: flex-end;
      transition: width 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);

      & + .pusher {
        margin-right: 20px;
        transition: margin-right 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);
      }

      &.expanded {
        width: 80px;
        height: 100%;

        & + .pusher {
          margin-right: 80px;
          transition: margin-right 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);
        }

        .toolbar-body {
          height: 100%;
        }

        .toolbar-actions {
          flex-direction: column;
        }

        .toolbar-bottom {
          .user {
            opacity: 1;
            transition: opacity 0.1s 0.2s;
          }

          .pastanagalogo {
            display: block;
          }

          .divider {
            width: 40px;
            height: 20px;
            border-top: 1px solid #c7d5d8;
            opacity: 1;
            transition: opacity 0.1s 0.2s;
          }
        }
      }

      &-content {
        position: fixed;
        left: 84px;
        width: 320px;
      }

      &-body {
        display: flex;
        width: 100%;
        height: 100%;
        flex-direction: column;
        transition: width 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);

        a,
        button {
          margin-bottom: 20px;
          margin-left: 0;
        }
      }

      &-actions {
        flex: 1;
        flex-direction: column;
        padding: 20px 0;

        .more {
          flex: 0;
        }
      }

      &-bottom {
        flex: 1;
        flex-direction: column;
        justify-content: flex-end;

        .user {
          display: block;
          opacity: 0;
        }

        .divider {
          display: block;
          opacity: 0;
        }

        .minipastanaga {
          bottom: 10px;
        }

        .pastanagalogo {
          display: block;
          padding-right: 6px;
          padding-left: 6px;
          margin-bottom: 10px;

          img {
            width: 100%;
          }
        }
      }

      &-handler {
        display: flex;
        width: 20px;
        height: 100%;
        flex-direction: column;
        justify-content: center;

        button {
          width: 20px;
          height: 80px;

          &::before {
            left: 8px;
            width: 4px;
            height: 100%;
          }
        }
      }
    }

    .pusher-puller {
      > * {
        // TODO: look how to standard for all devices
        width: 320px;
      }
    }
  }

  // Personal Tools
  .pastanaga-menu {
    width: 100vw;
    height: calc(100vh - 100px);

    &.has-inner-actions {
      height: 100vh;

      @media only screen and (min-width: @largestMobileScreen) {
        height: auto;
      }
    }

    header {
      display: flex;
      height: 60px;
      align-items: center;
      justify-content: space-between;
      padding: 8px 20px;
      border-bottom: 4px solid @silver-blue;

      h2 {
        flex: 1 0 auto;
        margin: 0;
        font-size: 16px;
        font-weight: 500;
      }

      a {
        display: flex;
      }

      &.pulled {
        justify-content: flex-start;
        padding-right: 10px;
        padding-left: 10px;

        button {
          margin-right: 10px;
        }
      }
    }

    .ui.form {
      height: 100%;
    }

    .ui.raised.segments {
      display: flex;
      height: calc(100vh - 60px);

      @media only screen and (min-width: @largestMobileScreen) {
        max-height: calc(520px - 60px);
      }

      .ui.segment:not(.actions) {
        flex: 1 1 auto;
        overflow-y: auto;
      }
    }

    @media only screen and (min-width: @largestMobileScreen) {
      width: 320px;
      height: auto;
    }
  }

  .pastanaga-menu-list {
    ul {
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: 10px 20px;
      margin-top: 0;
      list-style: none;
    }

    li {
      // padding: 5px 0;

      a,
      button {
        display: flex;
        width: 100%;
        height: 45px;
        align-items: center;
        justify-content: space-between;
        padding: 0;
        border: none;
        background-color: transparent;
        color: @toolbar-text;
        cursor: pointer;
        font-family: Poppins;
        font-size: 14px;
        font-weight: 500;
        text-align: left;
        text-transform: uppercase;

        svg {
          color: @teal-blue;
        }
      }
    }

    li:not(.state-select):not(.display-select) {
      border-bottom: 1px solid @silver-blue;
    }

    .pastanaga-menu-label {
      margin-right: 12px;
    }

    .pastanaga-menu-value {
      font-weight: 300;
      text-transform: initial;
    }
  }

  .personal-tools {
    header {
      .back,
      .vertical.divider {
        @media only screen and (min-width: @largestMobileScreen) {
          display: none;
        }

        margin-right: 10px;
      }

      .icon.logout {
        color: @darkHotPink;
      }
    }

    .avatar {
      height: 220px;
      background-color: #f2f5f6;

      img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: top;
      }

      &.default {
        display: flex;
        align-items: center;
        justify-content: center;
        color: @brown;
      }
    }

    .stats {
      ul {
        display: flex;
        justify-content: center;
        padding: 15px 0;
        margin: 0;
        background-color: #f2f5f6;
        color: #878f93;
        list-style: none;
      }

      li {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0 10px;

        span:first-child {
          font-size: 30px;
          font-weight: 200;
        }

        span:last-child {
          font-size: 12px;
          font-weight: 500;
          text-transform: uppercase;
        }
      }
    }
  }

  // Profile
  .vertical.divider {
    height: 30px;
    margin-right: 20px;
    border-left: 1px solid @silver;
  }

  .profile,
  .personal-tools {
    header {
      button {
        color: @teal-blue;
      }
    }
  }

  .menu-more {
    header {
      svg {
        color: #d12c67;
      }
    }

    .more-user {
      @media only screen and (min-width: @largestMobileScreen) {
        display: none;
      }
    }

    .state-select,
    .display-select {
      display: flex;
      width: 100%;

      .react-select-container {
        flex: 1 0 75%;
      }

      .field-wrapper-state-select {
        width: 100%;
      }
      .field-wrapper-display-select {
        width: 100%;
      }

      label {
        flex: 1 0 25%;
        padding-top: 18px;
        margin-right: 5px;
        border-bottom: 1px solid #edf1f2;
        font-size: 14px;
        font-weight: 500;
        text-transform: uppercase;
      }
    }
  }
}
// Orphaned CSS
.ui.dropdown .menu.left {
  right: 0;
  left: auto;
}

.ui.segment.dashed {
  border: 3px dashed #ccc;
  box-shadow: none;
}

@media only screen and (max-width: 767px) {
  .ui.menu.stackable > .menu,
  .ui.menu.stackable > .menu.right {
    display: block;
  }
}
// End Orphaned CSS
