@PN-VIEWS-WIDTH: 300px;
@PANEL-TITLE-HEIGHT: 40px;
@FONT-SIZE: 14px;
@BLOCK-SEARCH-HEIGHT: 28px + 8px * 2;
@FAVORITE-BUTTON-HEIGHT: 40px;

.dashboard-buttons {
  margin-right: 20px;

  >.btn {
    float: left;
    padding: 1px 8px 2px;
    font-weight: normal;
    background-color: #34343c;
    border-color: transparent;
    box-shadow: none;
    border-radius: 0;
    transition: all 0.3s ease;
    color: #fff !important;

    // opacity: .6;
    &:first-child {
      border-top-left-radius: 3px;
      border-bottom-left-radius: 3px;
    }

    &:last-child {
      border-top-right-radius: 3px;
      border-bottom-right-radius: 3px;
      margin-left: -1px;
    }

    &:hover,
    &.active {
      border-color: #34343c;
      background-color: darken(#34343c, 40%);
      color: fade(#fff, 80%) !important;
    }
  }

  .collapsed & {
    left: 0;
  }
}

.gjs-frame-wrapper__top {
  padding: 0 !important;
}

.gjs-frame {
  overflow: hidden;
}

.front-panel {
  width: 100%;
  height: 100%;
  display: flex;
  background-color: #000;

  .panels {
    width: 100%;
    color: #bcc9d4;
    background-color: #1e2127;
    overflow: hidden;
    z-index: auto;

    .panel-title {
      margin: 0;
      height: @PANEL-TITLE-HEIGHT;
      background-color: #2e343b;
      font-size: @FONT-SIZE;
      line-height: @PANEL-TITLE-HEIGHT;
      padding-right: 16px;
      padding-left: 20px;
      text-align: left;
      color: currentColor;
      cursor: pointer;
      border-top: 1px solid rgba(0,0,0,0.25);
      border-bottom: 1px solid rgba(0,0,0,0.25);
    }
  }

  .left-section {
    width: 300px;
    height: 100%;
    position: relative;

    .block-container {
      height: ~"calc(100% - 40px)";
      position: absolute;
      top: 0;
      z-index: 1;

      .block-search {
        position: relative;
        padding: 8px 16px;
        border-bottom: 1px solid #121a2c;
        background-color: fade(#000, 20%);

        >input {
          padding: 2px 12px;
          width: 100%;
          border: 1px solid fade(#fff, 15%);
          background: none;
          border-radius: 13px;

          &:focus {
            outline: none;
          }
        }

        >.spicon {
          position: absolute;
          top: 8px;
          right: 16px;
          display: block;
          width: 28px;
          height: 28px;
          line-height: 28px;
          text-align: center;
          cursor: pointer;
          opacity: 0.65;
          transition: all .3s ease;

          &.icon-close {
            display: none;
            top: 14px;
            right: 42px;
            width: 16px;
            height: 16px;
            line-height: 16px;
            font-size: 12px;
            opacity: 0.45;
          }

          &:hover {
            color: #1890ff;
            opacity: 1;
          }
        }
      }

      .favorite-filter-buttons {
        .favorite-button {
          display: inline-block;
          width: 50%;
          background: transparent;
          padding-top: 8px;
          padding-bottom: 8px;
          outline: none;
          border: none;
          cursor: pointer;

          &:hover {
            background: #343436;
          }

          &.active {
            background: #343436;
            color: #1890ff;
          }
        }
      }

      #blocks {
        width: 100%;
        height: calc(~"100% - @{PANEL-TITLE-HEIGHT} - @{BLOCK-SEARCH-HEIGHT} - @{FAVORITE-BUTTON-HEIGHT}");
        overflow-y: auto;

        .gjs-blocks-cs {
          .gjs-block-categories {
            font-size: @FONT-SIZE;

            .gjs-blocks-c {
              .gjs-block {
                width: 23.4%;
                margin: 4px 2px 4px 2px;
                padding: 0px;
                justify-content: center;
                min-height: 70px;
                position: relative;

                &.fa {
                  font-size: 20px;
                  color: #1890ff;
                  line-height: 30px;
                  padding: 2px;
                }

                .gjs-block-label {
                  font-size: 10px;
                  color: white;
                }
              }
            }

            .iconfont::before {
              font-size: 28px;
              line-height: 28px;
              padding-top: 8px;
            }
          }
        }

        svg {
          height: 30px;
          width: auto;
          color: #1890ff;
          padding: 2px;
        }
      }
    }

    .layers-container {
      padding: 0;
      height: 40px;
      position: absolute;
      bottom: 0;
      top: ~"calc(100% - 40px)";
      overflow-y: hidden;
      z-index: 2;

      &.open {
        top: 40px;
        height: ~"calc(100% - 40px)";
        overflow-y: auto;
      }

      #layers {
        padding: 0px;
        height: calc(~"100% - @{PANEL-TITLE-HEIGHT}");
        overflow-y: auto;

        .gjs-layer {
          .gjs-layer-title-c {
            .gjs-layer-title {
              font-size: @FONT-SIZE;
              line-height: @FONT-SIZE;

              .fa-chevron-down {
                transform: rotate(90deg);
                padding-left: 0px;
                margin-top: -1px;
              }
            }
          }
        }
      }
    }
  }

  .main-section {
    height: 100%;
    flex: 1;
    position: relative;

    .editor-container {
      width: 100%;
      height: 100%;
      padding: 0px;
      position: relative;
      overflow: hidden;
      background-color: #292c32;

      .editor-viewport {
        width: calc(~"100% - 40px");
        height: calc(~"100% - 70px");
        position: absolute;
        top: 50px;
        left: 20px;
        z-index: 2;

        .frontpanel-canvas {
          height: 100% !important;
          position: relative;
          overflow: hidden;

          .gjs-devices-c {
            padding: 0;
          }

          .gjs-pn-panel {
            position: relative;
          }

          .gjs-cv-canvas {
            width: 100% !important;
            height: 100%;
            top: 0;
          }

          .gjs-block-label {
            display: none;
          }
        }
      }
    }

    .rg-overlay {
      position: absolute;
      top: 0;
      left: 0;
      overflow: hidden;
      z-index: 1;
    }

    .guide {
      position: absolute;
      top: 0;
      left: 0;
      z-index: 9991;
      font-size: 0;
    }

    .guide.v {
      width: 1px;
      height: 7000px;
      border-right: solid 1px #00f;
      cursor: col-resize;
    }

    .guide.h {
      width: 3000px;
      height: 1px;
      border-bottom: solid 1px #00f;
      cursor: row-resize;
    }

    .info {
      width: 50px;
      height: 25px;
      line-height: 25px;
      text-align: center;
      position: relative;
      font-size: 13px;
      background-color: #eee;
      border: solid 1px #ccc;
      color: #000;
    }

    .guide.v .info {
      left: 2px;
    }

    .guide.h .info {
      top: 2px;
    }

    .unselectable {
      -moz-user-select: none;
      -khtml-user-select: none;
      -webkit-user-select: none;
      -ms-user-select: none;
      user-select: none;
    }

    .ruler {
      background-color: #0f0f14;
      color: #90a0af;
      position: absolute;
      top: 0;
      left: 0;
      z-index: 9990;
    }

    .ruler .label {
      font: 12px Arial;
      color: #90a0af;
    }

    .ruler,
    .ruler span {
      font-size: 0;
    }

    .ruler.h {
      width: 3000px;
      height: 28px;
      left: -1px;
      padding-left: 48px;
      border-bottom: solid 1px #000;
    }

    .ruler.v {
      height: 7000px;
      top: -1px;
      padding-top: 48px;
      width: 28px;
      border-right: solid 1px #000;
    }

    .ruler.h span {
      border-left: solid 1px #0f0f0f;
      height: 9px;
      width: 1px;
      vertical-align: top;
      display: inline-block;
      *display: inline;
      zoom: 1;
    }

    .ruler.v span {
      display: block;
      margin-right: 0;
      border-top: solid 1px #0f0f0f;
      width: 9px;
      height: 1px;
    }

    .ruler.v span.major {
      border-top: solid 1px #90a0af;
      width: 6px;
    }

    .ruler.v span.milestone {
      position: relative;
      border-top: solid 1px #90a0af;
      width: 8px;
    }

    .ruler.v span.label {
      border: 0;
      font-size: 9px;
      position: absolute;
      text-align: center;
      width: 9px;
      transform: rotate(-90deg);
    }

    .ruler.h span.major {
      border-left: solid 1px #90a0af;
      height: 6px;
    }

    .ruler.h span.milestone {
      position: relative;
      border-left: solid 1px #90a0af;
      height: 8px;
    }

    .ruler.h span.label {
      border: 0;
      font-size: 9px;
      position: absolute;
      text-align: center;
      top: 10px;
      width: 9px;
    }

    .ruler.h .l10 {
      left: -5px;
    }

    .ruler.h .l100 {
      left: -7px;
    }

    .ruler.h .l1000 {
      left: -10px;
    }

    .ruler.v .l10,
    .ruler.v .l100,
    .ruler.v .l1000 {
      top: -7px;
    }

    .ruler.v .l10 {
      left: 8px;
    }

    .ruler.v .l100 {
      left: 8px;
    }

    .ruler.v .l1000 {
      left: 8px;
    }

    .menu-btn {
      position: fixed;
      left: 3px;
      top: 2px;
      line-height: 9px;
      z-index: 9998;
      width: 20px;
      height: 20px;
      background-color: red;
      opacity: 0.5;
      font-size: 20px;
      text-align: left;
      color: #fff;
      font-weight: 700;
      cursor: pointer;
      border-radius: 2px;
    }

    .rg-menu {
      position: fixed;
      top: 22px;
      left: 3px;
      padding: 0;
      margin: 0;
      list-style: none;
      display: none;
      font: 13px Arial;
      z-index: 9999;
      box-shadow: 2px 2px 10px #ccc;
    }

    .rg-menu li {
      text-align: left;
      border-bottom: solid 1px #999;
      padding: 0;
    }

    .rg-menu a {
      background-color: #777;
      display: block;
      padding: 5px;
      text-decoration: none;
      color: #fff;
      line-height: 18px;
    }

    .rg-menu a:hover,
    .rg-menu a.selected {
      color: #fff;
      background-color: #3b94ec;
    }

    .rg-menu a.disabled {
      color: #ccc;
    }

    .rg-menu .desc {
      display: inline-block;
      width: 170px;
    }

    .dialog {
      position: fixed;
      background-color: #777;
      z-index: 9999;
      color: #fff;
      font-size: 13px;
      display: none;
      box-shadow: 2px 2px 10px #ccc;
    }

    .dialog button {
      border: 0;
      color: #333;
      cursor: pointer;
      background-color: #eaeaea;
      background-image: linear-gradient(#fafafa, #eaeaea);
      background-repeat: repeat-x;
      border-radius: 3px;
      text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .dialog input,
    .dialog select,
    .dialog button {
      font-size: 13px;
      margin: 3px;
      padding: 3px;
    }

    .dialog .title-bar {
      padding: 5px;
      background-color: #aaa;
      font-weight: 700;
    }

    .dialog .wrapper {
      padding: 10px;
    }

    .open-dialog select,
    .open-dialog button {
      float: left;
      display: block;
    }

    .open-dialog .ok-btn,
    .open-dialog .cancel-btn {
      margin: 10px 3px;
    }

    .open-dialog .ok-btn {
      clear: both;
    }

    .snap-dialog label {
      font-weight: 700;
      padding: 3px;
    }

    .snap-dialog .ok-btn {
      margin-left: 18px;
    }

    .snap-dialog .ok-btn,
    .snap-dialog .cancel-btn {
      margin-top: 10px;
    }

    .snap-dialog .rg-y-label {
      margin-left: 10px;
    }

    #rg-x-snap,
    #rg-y-snap {
      width: 50px;
    }

    .info-block-wrapper {
      position: absolute;
      z-index: 9989;
    }

    .info-block {
      position: absolute;
      text-align: left;
    }

    .info-block.even {
      background: 0 0;
      background-color: rgba(0, 0, 255, 0.2);
      -ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#330000FF, endColorstr=#330000FF);
      filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#330000FF, endColorstr=#330000FF);
      zoom: 1;
    }

    .info-block.odd {
      background: 0 0;
      background-color: rgba(255, 0, 0, 0.2);
      -ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#33FF0000, endColorstr=#33FF0000);
      filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#33FF0000, endColorstr=#33FF0000);
      zoom: 1;
    }

    .info-block-txt {
      padding: 5px;
      display: inline-block;
      vertical-align: top;
      background-color: #777;
      color: #fff;
      font-size: 13px;
      *display: inline;
      zoom: 1;
    }
  }

  .right-section {
    width: 300px;
    height: 100%;
    position: relative;
    box-shadow: -2px 0 0 #000;

    .style-container,
    .trait-container {
      height: 100%;
      overflow-y: auto;

      #gjs-sm-sector-position,
      #gjs-sm-sector-font,
      #gjs-sm-sector-style {
        .gjs-sm-title {
          color: #ffcc66;
        }

        .gjs-sm-properties {
          display: none;
        }

        &~[id^="gjs-sm-sector-pos-child"],
        &~[id^="gjs-sm-sector-font-child"],
        &~[id^="gjs-sm-sector-style-child"] {
          display: none !important;

          .gjs-sm-title {
            padding-left: 36px;
          }
        }
      }

      #gjs-sm-sector-position.gjs-sm-open {
        &~[id^="gjs-sm-sector-pos-child"] {
          display: block !important;
        }
      }

      #gjs-sm-sector-font.gjs-sm-open {
        &~[id^="gjs-sm-sector-font-child"] {
          display: block !important;
        }
      }

      #gjs-sm-sector-style.gjs-sm-open {
        &~[id^="gjs-sm-sector-style-child"] {
          display: block !important;
        }
      }

      .gjs-sm-label {
        font-size: @FONT-SIZE;
        line-height: @FONT-SIZE;
      }

      #traits {
        .gjs-trt-traits {
          .gjs-trt-trait {
            font-size: @FONT-SIZE;
            line-height: @FONT-SIZE;
          }

          .gjs-trt-trait--hide {
            display: none;
          }

          .gjs-field-wrp--switch {
            .gjs-field-switch {
              background-color: unset;

              .switch {
                position: relative;
                width: 40px;
                height: 30px;

                .switch-track {
                  position: relative;
                  top: 20%;
                  width: 100%;
                  height: 60%;
                  border-radius: 2px;
                  background-color: rgba(0, 0, 0, 0.2);
                  border: 1px solid rgba(0, 0, 0, 0.25);
                }

                .switch-thumb-underlay {
                  position: absolute;
                  top: 0;
                  width: 100%;
                  height: 100%;

                  .switch-thumb {
                    position: absolute;
                    top: e('calc(20% + 2px)');
                    left: 2px;
                    width: 50%;
                    height: e('calc(60% - 4px)');
                    border-radius: 2px;
                    background-color: rgba(255, 255, 255, 0.12);
                  }

                  input[type="checkbox"] {
                    position: absolute;
                    width: 100%;
                    height: 100%;
                    opacity: 0;
                    z-index: 6;
                    cursor: pointer;
                  }
                }

                &.checked .switch-thumb {
                  right: 2px;
                  left: auto;
                  background-color: #3498db;
                }
              }
            }
          }

          .gjs-trt-trait--authorInfo {
            align-items: flex-start;
          }

          .gjs-field-wrp--key-value {
            background-color: unset;

            .gjs-field-key-value {
              background-color: unset;

              .key-value {
                &__item {
                  margin: 8px 0;
                  display: flex;

                  >.key-value__key,
                  >.key-value__value {
                    width: 50%;
                    flex: 1 1 50%;
                    background-color: rgba(0, 0, 0, 0.2);
                  }

                  >span {
                    display: inline-block;
                    width: 16px;
                    text-align: center;
                    line-height: 29px;
                  }

                  option {
                    background-color: #444;
                    color: #ddd;
                  }
                }

                &__remove {
                  display: inline-block;
                  width: 24px;
                  text-align: right;
                  line-height: 29px;
                }
              }
            }
          }

          .gjs-field-imageSelector {
            .gjs-image-selector {
              .gjs-input-holder input {
                padding-right: 22px;
              }

              .gjs-btn-prim {
                position: absolute;
                top: 1px;
                right: 1px;
                bottom: 1px;
                z-index: 9;
                font-size: 0.75rem;
              }
            }
          }
        }
      }
    }
  }
}

.front-panel *::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.front-panel *::-webkit-scrollbar-thumb {
  -webkit-border-radius: 10px;
  border-radius: 10px;
  background-color: fade(#fff, 20%);
}

.front-panel *::-webkit-scrollbar-thumb:hover {
  background-color: fade(#fff, 10%);
}

.front-panel *::-webkit-scrollbar-track {
  background-color: fade(#fff, 10%);
}

.gjs-cv-canvas::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.gjs-cv-canvas::-webkit-scrollbar-button {
  display: none;
}

.gjs-cv-canvas::-webkit-scrollbar-track {
  background-color: fade(#fff, 10%);
  -webkit-border-radius: 10px;
  border-radius: 10px;
}

.gjs-cv-canvas::-webkit-scrollbar-thumb {
  background-color: fade(#fff, 20%);
  min-height: 50px;
  min-width: 50px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
  -webkit-transition: background-color 0.2s;
  -o-transition: background-color 0.2s;
  transition: background-color 0.2s;
}

.gjs-cv-canvas::-webkit-scrollbar-thumb:hover {
  background-color: fade(#fff, 10%);
}

.gjs-cv-canvas::-webkit-scrollbar-corner {
  background-color: transparent;
}

.sp-container {
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 7px rgba(0, 0, 0, 0.2);
  border-radius: 3px;

  button {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 0, 0, 0.2);
    color: #ddd;
    text-shadow: none;
    box-shadow: none;
    padding: 3px 5px;
  }

  .sp-palette-container {
    border: none;
    float: none;
    margin: 0;
    padding: 5px 10px 0;
  }

  .sp-picker-container {
    border: none;
  }

  .sp-button-container {
    float: none;
    width: 100%;
    position: relative;
    text-align: right;
  }

  .sp-cancel,
  .sp-cancel:hover {
    bottom: -8px;
    color: #777 !important;
    font-size: 25px;
    left: 0;
    position: absolute;
    text-decoration: none;
  }
}

.gjs-one-bg {
  background-color: #2f2f2f !important;
}

.gjs-two-color {
  color: #dcdcdc !important;
}

.gjs-three-color {
  color: #dcdcdc !important;
}

.gjs-four-color {
  color: #00c1de !important;
}

.gjs-four-color-h:hover {
  color: #00c1de !important;
}

.gjs-editor {
  // height: e('calc(100% - 50px)') !important;
  height: 100% !important;
}

.resize {
  &-item {
    display: inline-block;
    position: relative;
    width: 80px;
    background-color: fade(#000, 12%);
    border-radius: 2px;
    border: 1px solid fade(#fff, 20%);
  }

  &-input {
    width: 100%;
    border: none;
    background: none;
    padding: 2px 20px 2px 6px;
  }

  &-unit {
    position: absolute;
    right: 4px;
    bottom: 0;
    top: 0;
    border: none;
    appearance: none;
    background: none;

    &:focus {
      outline: none;
    }
  }
}
