/*

  Explorer Component Styles
  ~~~~~~~~~~~~~~~~~~~~~~~~~

*/

@import "../../styles/_global/all.scss";

#cabana {
  display: flex;
  height: 100%;
  flex-direction: column;
  flex-grow: 1;
  &.is-showing-modal {
    .cabana-window {
      filter: blur(1px);
    }
    .cabana-modal-backdrop {
      opacity: 1;
      pointer-events: auto;
    }
    .cabana-modal-container {
      margin-top: 0;
      opacity: 1;
      pointer-events: auto;
    }
    .cabana-modal.cabana-modal--not-closable {
      .cabana-modal-backdrop {
        pointer-events: none;
      }
    }
  }
}

.cabana-header {
  background: $color-grey-90;
  color: #fff;
  height: 55px;
  padding: 16px 22px;
  &-logo {
    color: #fff;
    font-family: monospace;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    text-transform: lowercase;
    pointer-events: none; // disable actual click
  }
  &-account {
    float: right;
    width: 177px;
    &-signout {
      cursor: pointer;
      font-size: 12px;
      color: rgba(255, 255, 255, 0.9);
      &:hover {
        text-decoration: underline;
      }
    }
    a {
      color: #fff;
      font-size: 14px;
      font-weight: 600;
      text-decoration: none;
      margin: -10px 0;
      width: 100%;
    }
  }
}

.cabana-window {
  display: flex;
  flex-grow: 1;
  overflow: hidden;
  transition-duration: 0.2s;
}

.cabana-explorer {
  display: flex;
  flex: 1;
  &-header {
  }
  &-select-prompt {
    background: $color-grey-10;
    height: 100%;
    padding-top: 50%;
    padding-left: 20%;
    width: 100%;
    h1 {
      position: relative;
      &:before {
        content: $fa-var-long-arrow-left;
        color: $color-grey-70;
        display: block;
        font-family: "FontAwesome";
        left: -50px;
        position: absolute;
        top: 3px;
      }
    }
  }
  &-signals {
    flex: 1;
    max-height: 100vh;
    &.is-expanded {
      .cabana-explorer-signals-subheader:before {
        transform: rotate(90deg);
        margin-top: -1px;
      }
    }
    &-wrapper {
      display: flex;
      height: 100%;
      flex-direction: column;
    }
    &-header {
      border-bottom: 1px solid rgba(0, 0, 0, 0.2);
      display: flex;
      flex-direction: row;
      min-height: 89px;
      padding: 5%;
      h6,
      h3 {
        margin: 0;
      }
      h6 {
        font-size: 13px;
        font-weight: normal;
        padding-bottom: 5px;
        text-transform: uppercase;
      }
      &-context {
        flex: 4;
      }
      &-action {
        flex: 1;
        button {
          width: 100%;
        }
      }
    }
    &-subheader {
      border-bottom: 1px solid $color-grey-30;
      color: $color-grey-70;
      cursor: pointer;
      font-size: 14px;
      padding: 3% 5% 3% 9%;
      position: relative;
      &:before {
        content: $fa-var-chevron-right;
        display: block;
        font-size: 12px;
        font-family: "FontAwesome";
        left: 4%;
        line-height: 45px;
        position: absolute;
        text-align: center;
        transition-duration: 0.1s;
        top: 0;
        width: 25px;
      }
    }
    &-window {
      overflow-x: hidden;
      overflow-y: scroll;
      height: 100%;
    }
    &-controller {
      padding: 5%;
    }
    &-matrix {
      table {
        border: 1px solid rgba(0, 0, 0, 0.2);
        border-radius: 5px;
        font-family: monospace;
        margin: 2% 0;
        width: 100%;
      }
      &-tooltip {
        position: absolute;
        top: 0px;
        left: 0px;
        z-index: 10;
        border-radius: 5px;
        background-color: rgba(0, 0, 0, 0.2);
        border: 1px solid rgba(0, 0, 0, 0.3);
        margin: 0;
        padding: 2px 5px;
        font-size: 0.8em;
      }
    }
    &-log {
      border-top: 1px solid $color-grey-30;
      padding: 0 5%;
      &-header {
        padding: 5% 0;
        strong {
          color: $color-grey-70;
          font-size: 14px;
        }
        button {
          float: right;
          text-transform: uppercase;
        }
      }
      &-body {
        background: $color-grey-10;
        border: 1px solid rgba(0, 0, 0, 0.2);
        border-radius: 5px;
      }
      &-list {
        padding: 3%;
      }
    }
  }
  &-visuals {
    background: $color-grey-10;
    flex: 1;
    max-height: 100vh;
    overflow-x: hidden;
    overflow-y: scroll;
    padding: 1.5% 3%;
    &-header {
      border-bottom: 1px solid rgba(0, 0, 0, 0.1);
      margin-bottom: 2%;
      padding: 2% 0;
    }
    &-camera {
      border: 5px solid #000;
      border-radius: 5px;
      max-height: 480px;
      max-width: 640px;
      background: #000;
      overflow: hidden;
      position: relative;
      &-wrapper {
      }
      video {
        cursor: pointer;
        width: 100%;
      }
    }
    &-segmentreset {
      cursor: pointer;
      background-color: RGB(63, 135, 255);
      border-radius: 5px;
      min-width: 80px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      &:hover {
        background-color: rgba(63, 135, 255, 0.5);
      }
      margin-top: 10px;
      padding: 10px 0;
      width: 160px;
    }
    &-plots {
      background: rgba(0, 0, 0, 0.02);
      border-radius: 5px;
      margin: 3% 0;
      position: relative;
      max-width: 640px;
      &:not(:empty) {
        border: 1px solid $color-grey-40;
      }
    }
    &-plot {
      $drag-anchor-width: 25px;
      $toggle-width: 80px;
      &-inner {
        background: #fff;
        border-bottom: 1px solid $color-grey-30;
        border-radius: 5px 5px 0 0;
        padding: 1.5% 3%;
        &:first-child,
        &:last-child {
          padding-top: 3%;
          padding-bottom: 3%;
        }
        &.is-droppable {
          background: $color-grey-50;
        }
      }
      &-draganchor {
        color: $color-grey-70;
        cursor: move;
        float: left;
        position: relative;
        -webkit-user-select: none;
        user-select: none;
        width: $drag-anchor-width;
        z-index: 1;
      }
      &-header {
        border-bottom: 1px solid $color-grey-20;
        margin-bottom: 2%;
        padding: 0 0 2% $drag-anchor-width;
        position: relative;
        &-copy {
          margin-right: $toggle-width;
        }
        &-toggle {
          float: right;
          width: $toggle-width;
          button {
            width: 100%;
          }
        }
      }
      &-message {
        color: $color-grey-50;
        font-size: 12px;
        padding-bottom: 3px;
      }
      &-signal {
        color: $color-grey-90;
        &-color {
          $signal-color-size: 14px;
          background: transparent;
          border-radius: $signal-color-size/2;
          height: $signal-color-size;
          float: left;
          margin: 1px -3px 0 -25px;
          opacity: 0.5;
          width: $signal-color-size;
        }
      }
      &-container {
        svg {
          height: auto;
          width: 100%;
        }
      }
    }
  }
}
