@import "../../ui-components/styles/variables";

.overlay-text {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateY(-50%) translateX(-50%);
  font-size: 14px;
  color: #fff;
  padding: 0 6px;
  background-color: $blue-400;
  border-radius: 4px;
  z-index: 2;
}

:host {
  display: block;
  position: relative;

  .whitebg {
    display: block;
    background: white;
    margin-left: -1px;
    overflow-y: hidden;
    overflow-x: auto;

    &.loading .chart {
      opacity: 0.3;
    }

    &.whitebg-table {
      height: unset;
      padding-bottom: 12px;
      margin-left: 24px;
      margin-right: 24px;

      .resize-handle-bottom, {
        bottom: -12px;
      }
    }

    .resize-overlay-text {
      display: none;
    }

    &.resize-active {
      z-index: 12;
    }

    &.resize-active.resize-ghost-element {
      filter: brightness(0.95);
      overflow: hidden;

      .chart {
        opacity: 0.5;
      }

      .resize-overlay-text {
        @extend .overlay-text;
      }
    }

  }

  .plot-loader {
    @extend .overlay-text;
  }

  // fix table content overflow 1px above header
  ::ng-deep svg #header .column-cell {
    transform: translate(0px, -1px);

    .cell-rect {
      height: 30px;
    }
  }

  ::ng-deep sm-color-picker-wrapper {
    display: block;
    top: 0px;

  }

  ::ng-deep .legendlines path, ::ng-deep .legendpoints path {
    cursor: url('../../../assets/icons/pallete-cursor.png') 6 0, pointer;
  }

  ::ng-deep .legendpoints path:not(.scatterpts) {
    d: path('M8,8H-8V-8H8Z') !important;
  }

  ::ng-deep .legendlines path {
    stroke-width: 12px !important;
  }

  ::ng-deep .legendpoints path.scatterpts {
    // chrome only
    d: path('M5.5,0A5.5,5.5 0 1,1 0,-5.5A5.5,5.5 0 0,1 5.5,0Z') !important;
  }

  .move-title {
    ::ng-deep .infolayer > .g-gtitle > .gtitle {
      transform: translateY(12px);
    }
  }

  ::ng-deep .modebar-container svg.icon {
    height: 1em;
    width: 1em;
    font-size: 16px;
  }

  // moving legend next to title without text
  ::ng-deep .legend.hide-text {
    .legendtext,
    .legendtoggle {
      display: none;
    }
  }

  mwlResizable {
    box-sizing: border-box; // required for the enableGhostResize option to work
  }

  [mwlResizable] {
    box-sizing: border-box; // required for the enableGhostResize option to work
  }

  .resize-handle-bottom, {
    position: absolute;
    height: 1px;
    cursor: row-resize;
    width: 100%;
    bottom: -6px;
    padding: 6px 0;
    z-index: 12;

    .bottom-line {
      position: absolute;
      width: 100%;
      height: 1px;
      background-color: #efefef;
    }

    .bottom-handle {
      position: absolute;
      height: 12px;
      width: 40px;
      left: 0;
      right: 0;
      margin: auto;
      transform: translateY(-50%);
      transition: background-color 0.3s;
      background-color: transparent;
      border-radius: 12px;
    }

    &:hover {
      .bottom-handle {
        background-color: darken(#efefef, 5);
      }
    }
  }

  .resize-handle-right {
    position: absolute;
    height: 100%;
    cursor: col-resize;
    width: 1px;
    right: 0;
    padding: 0 6px;
    z-index: 12;

    .right-line {
      position: absolute;
      height: 100%;
      width: 1px;
      background-color: #efefef;
    }

    .right-handle {
      position: absolute;
      height: 40px;
      width: 12px;
      top: 0;
      bottom: 0;
      margin: auto;
      transform: translateX(-50%);
      transition: background-color 0.3s;
      background-color: transparent;
      border-radius: 12px;
    }

    &:hover {
      .right-handle {
        background-color: darken(#efefef, 5);
      }
    }
  }

  .dark-theme {
    background: transparent !important;
    ::ng-deep .parcoords .tick text{
      text-shadow: rgb(0 0 0) 1px 1px 1px, rgb(0 0 0) -1px -1px 1px, rgb(0 0 0) 1px -1px 1px, rgb(0 0 0) -1px 1px 1px !important;
    }

    ::ng-deep .js-plotly-plot .plotly {
      .modebar-group {
        border-left: 1px solid $blue-500;

        &:last-child {
          .modebar-btn:last-child {
            border-left: 1px solid $blue-500;

            &:only-child {
              border-left: none;
            }
          }
        }
      }
      .svg-container {
        svg.main-svg {
          background: transparent !important;
          .scrollbar-kit .scrollbar .scrollbar-glyph{
            stroke-opacity: 1;
            stroke: $dark-grey-blue-nine;
          }
        }
      }
      svg a {
        fill: $blue-300;

        &:hover {
          fill: $blue-50;
        }
      }
    }
  }

  ::ng-deep .js-plotly-plot .plotly {
    .modebar-group {
      padding-left: 8px; /* instead of padding-right */
      padding-right: 0;
      margin-left: 8px;
      border-left: 1px solid #efefef;
    }

    .modebar-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .modebar {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      top: 6px;
      padding-right: 12px;

    }

    .modebar .modebar-group:last-child {
      .modebar-btn:last-child {
        margin-left: 12px;
        padding-left: 12px;
        border-left: 1px solid #efefef;
        &:only-child{
          border-left:none;
          margin-left: 0px;
          padding-left: 0px;
        }
      }
    }
  }
}
