// Object Browser Container

@media only screen and (max-width: @largestMobileScreen) {
  .has-toolbar {
    .sidebar-container {
      top: 100px;
      bottom: 0;
      height: calc(100vh - 100px);
    }
  }

  .has-toolbar-collapsed {
    .sidebar-container {
      top: 20px;
      bottom: 0;
      height: calc(100vh - 20px);
    }
  }
}

.sidebar-container {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  width: 375px;
  height: 100vh;
  background-color: #fff;
  box-shadow: 0 1px 2px 0 #c7d5d8;
  transition: right 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045),
    height 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045),
    top 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);

  &.collapsed {
    right: -355px;

    .tabs-wrapper {
      opacity: 0;
      transition: opacity 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);
    }
  }

  .ui.raised.segments {
    display: flex;
    height: 100%;
    flex-direction: column;
  }

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

    &:focus {
      outline: none;
    }
  }

  .trigger,
  .trigger:focus,
  .trigger:hover {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 0;
    width: 20px;
    height: 80px;
    padding: 0;
    margin-top: -40px;
    background: transparent;
    border-radius: 0;
    opacity: 0.05;
    transition: opacity 0.3s;
  }

  .trigger:hover {
    opacity: 0.3;
    transition: opacity 0.3s;
  }

  .trigger:before {
    position: relative;
    left: 8px;
    display: block;
    width: 4px;
    height: 100%;
    background: @blue;
    content: '';
  }

  .tab-wrapper {
    height: calc(100% - 61px);
    padding: 0;
    border-bottom: none;
    overflow-x: hidden;
    overflow-y: auto;

    > * {
      display: none;
    }

    > :last-child {
      display: block;
    }
  }

  .tabs-wrapper {
    height: 100%;
  }

  .tab-forbidden {
    margin: calc(50% - 24px) auto;
    color: #bac5c7;
  }

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

    .icon {
      padding-right: 10px;
    }

    h2 {
      flex: 1 0 auto;
      margin: 0 !important;
      color: #517776;
      font-size: 16px;
    }

    form {
      flex: 1 0 auto;
    }

    .search {
      width: 100%;

      input {
        border: none;
      }
    }

    a {
      display: flex;
    }

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

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

  .ui.segment:not(.tab) {
    border-bottom: 1px solid #b8c6c8;
  }

  .ui.segment.tabbed-actions {
    display: flex;
    justify-content: space-around;
    padding: 0;
    border-top: 1px solid #b8c6c8;
    border-bottom: 1px solid #b8c6c8;

    .ui.buttons {
      width: 100%;

      .button:last-child {
        border-radius: 0;
      }
    }

    .ui.basic.active.button {
      background-color: #edf1f2 !important;
    }
  }

  .ui.segment.object-listing {
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: scroll;
  }

  ul {
    flex: 1 0 auto;
    margin: 0;

    li {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 0 10px 5px;
      cursor: pointer;

      &.selected-item {
        background-color: @tealBackground;
      }

      &.disabled {
        opacity: 0.5;
      }

      span {
        display: flex;
        align-items: center;

        .icon {
          padding-right: 10px;
        }
      }
    }
  }

  .ui.segment.form.actions,
  .ui.segment.form.sidebar-image-data {
    padding-bottom: 1em;
  }

  .ui.accordion {
    .title {
      display: flex;
      justify-content: space-between;
    }

    .content {
      padding: 0;
    }
  }
}

#sidebar .pusher.expanded {
  margin-left: 375px;
}

#sidebar .pusher {
  margin-left: 20px;
  transition: margin-left 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);
}

#sidebar-properties {
  header {
    border-bottom: 2px solid #b8c6c8;
  }
}

// Animation
.sidebar-container {
}

.sidebar-container-enter {
  .sidebar-container;

  transform: translate(100%, 0%);
}

.sidebar-container-enter.sidebar-container-enter-active {
  .sidebar-container;

  transform: translate(0%, 0%);
  transition: transform 0.5s cubic-bezier(0.09, 0.11, 0.24, 0.91);
}

.sidebar-container-enter-done {
  .sidebar-container;
}

.sidebar-container-exit {
  .sidebar-container;

  transform: translate(0%, 0%);
  transition: transform 0.5s cubic-bezier(0.09, 0.11, 0.24, 0.91);
}

.sidebar-container-exit.sidebar-container-exit-active {
  .sidebar-container;

  transform: translate(100%, 0%);
  transition: transform 0.5s cubic-bezier(0.09, 0.11, 0.24, 0.91);
}

.sidebar-metadata-container {
  display: flex;
  justify-content: space-between;
}

.field-file-name {
  display: flex;
  align-items: flex-end;
  padding: 20px 0;
}

.align-tools {
  display: flex !important;
  align-items: center;

  .ui.icon.button {
    padding: 4px;
    margin-left: 4px;
    border-radius: 1px;
    color: @brown !important;

    &:hover {
      background-color: #edf1f2 !important;
    }
  }

  .ui.buttons:first-child .ui.icon.button {
    margin-left: 0;
  }

  .ui.active.basic.icon.button {
    border: 1px solid #2996da;
    background: transparent !important;
  }
}

.ui.icon.input + button {
  position: absolute;
  top: 0;
  right: 10px;
  width: 2.67142857em;
  height: 100%;
  padding: 4px;
  margin: 0;
  border-radius: 1px;
  color: @brown !important;
  line-height: 1;
  text-align: center;

  &:hover {
    background-color: #edf1f2 !important;
  }
}
