// Chart element table.
.fusion-builder-main-settings {

  .fusion-builder-chart-button {
    display: inline-block;
    background: #198fd9;
    padding: 8px 15px;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    border-radius: 3px;
    width: auto;
    font-family: "Noto Sans", Roboto, "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;
    line-height: 26px;
    clear: both;
    margin-bottom: 20px;
    margin-top: 20px;
    width: 100%;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.1s ease;

    &:hover {
      background: #0e7abd;
    }

    &.fusion-table-builder-add-column,
    &.fusion-table-builder-add-row {
      display: inline-block;
      margin-top: 0;
      margin-bottom: 0;
      width: auto;
    }

    &.fusion-table-builder-add-column {
      margin-left: 10px;
      margin-right: 10px;
    }
  }

  .fusion-table-builder-chart {

		&#fusion-table-builder-chart-edit-table {
			padding-bottom: 0;

			.fusion-builder-option {
				border-bottom: none;
			}
		}

    &,
    & input {
      font-family: "Noto Sans", Roboto, "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;
    }

    .fusion-builder-layouts-header-info {
      padding-top: 40px;
      padding-bottom: 50px;
      text-align: center;
      border-bottom: 1px solid #f2f3f5;

      h2 {
        display: inline-block;
        margin-left: 15px;
        margin-right: 15px;
      }

      .fusion-builder-chart-button {
        background-color: #198fd9;

        &:hover {
          background-color: #0e7abd;
        }
      }
    }

    .fusion-chart-bar {
        padding-bottom: 40px;
    }

    .fusion-builder-table {
      th {
        font-weight: 400;
      }
      .fusion-builder-option  {
        input {
          margin-bottom: 0;
        }
      }
    }

    /* Display color pickers based on selected chart type */
    .fusion-builder-table.showX {
      thead tr:nth-child(2),
      thead tr:nth-child(3),
      thead tr:nth-child(4) {
        display: table-row;
      }

      .th-2,
      .th-3,
      .th-4,
      .td-2,
      .td-3,
      .td-4 {
        display: none;
      }

    }

    .fusion-builder-table.showY {
      thead tr:nth-child(2),
      thead tr:nth-child(3),
      thead tr:nth-child(4) {
        display: none;
      }

      .th-2,
      .th-3,
      .th-4,
      .td-2,
      .td-3,
      .td-4 {
        display: table-cell;
      }
    }

    /* Styling */
    &.fusion-table-builder {
      .fusion-builder-table-wrap {
        margin-top: 70px;
        padding-left: 40px;
      }

      .fusion-builder-table {
        margin-right: auto;
        margin-left: auto;

        border-collapse: collapse;
        border-spacing: 0;

        border-bottom: 1px solid #f2f3f5;

        th, td {
          border-top: 1px solid #f2f3f5;
          border-right: 1px solid #f2f3f5;
        }

        tr:first-child .th-1 {
          border-top: none;
        }

        tr:nth-child(2) .th-1,
        tbody {
          border-left: 1px solid #f2f3f5;
        }

        input {
          text-align: center;
          border: none;
          box-shadow: none;
        }
      }
    }

    .fusion-builder-table-column-options {
      position: absolute;
      top: -50px;
      left: 0;
      width: 100%;
      padding: 6px 0;
      text-align: center;
      font-size: 16px;
    }

    &.fusion-table-builder {

      .fusion-builder-table > thead > tr > th,
      .fusion-builder-table > tbody > tr > td {
        vertical-align: middle;
        text-align: center;
      }

      .fusion-builder-table > thead > tr:first-child > th {
        height: 50px;
        font-weight: 400;
      }
      .fusion-builder-table > thead > tr > th:first-child {
        height: 35px;
      }

      .fusion-builder-table > thead > tr:first-child > .th-2,
      .fusion-builder-table > thead > tr:nth-child(2) > th:first-child {
        font-size: 12px;
        text-transform: uppercase;
        color: #93999f;
        letter-spacing: 1px;
        font-weight: 700;
      }

      .fusion-builder-table > thead > tr:first-child > th.th-2,
      .fusion-builder-table > thead > tr:first-child > th.th-3,
      .fusion-builder-table > thead > tr:first-child > th.th-4 {
        min-width: 110px;
        padding-left: 5px !important;
        padding-right: 5px !important
      }

      .fusion-builder-table > thead > tr:first-child > th input {
        height: 48px;
      }

      .fusion-builder-table > thead > tr:first-child > th.th-1 > div,
      .fusion-builder-table > thead > tr:first-child > th.th-1 > div.option-field {
        clear: both;
      }

      .fusion-builder-table > thead > tr:first-child > th.th-1 div.option-field .wp-picker-active {
        float: left;
      }

      .fusion-builder-table > thead > tr:first-child > th.th-1 input {
        padding: 5px;
        width: 50px;
        height: 30px;
        border: 1px solid #e9e8e7;
        background-color: #f4f3f3;
      }

      .fusion-builder-table > thead > tr:first-child > th.th-1 input,
      .fusion-builder-table > thead > tr:first-child > th.th-1 strong {
        display: inline-block;
        margin-left: 2px;
        margin-right: 2px;
      }

      input {
        height: 47px;
      }

      .fusion-builder-table > thead > tr > th,
      .fusion-builder-table > tbody > tr > td {
        padding: 0;
        position: relative;
      }
    }

    .fusion-builder-table-column-options {
      top: -40px;

      .fusion-builder-table-delete-column {
        cursor: pointer;
      }
    }

    .fusion-builder-table-delete-row {
        display: block;
        margin: 0;
        position: absolute;
        top: 50%;
        left: -33px;
        transform: translateY(-50%);
        cursor: pointer;
      }

      .fusion-builder-table-delete-row,
      .fusion-builder-table-delete-column {
        transition: color 0.1s ease;

        &:hover {
          color: #e0284f;
        }
      }

    /* Color picker */
    &.fusion-table-builder {

      .fusion-builder-option.colorpickeralpha {
        position: relative;
        display: inline-block;
        margin-right: 5px;
        margin-left: 5px;
        margin-top: 3px;

        &.fusion-color-picker-opened {
          overflow: visible;
          .fusion-builder-option-container {
            display: block;
          }

          &.fusion-color-picker-flip {
            .fusion-builder-option-container {
              right: -10px;
              left: auto;
            }
          }
        }

        .wp-picker-holder {
          clear: both;
        }
        .option-field {
          .iris-square,
          .iris-strip {
            height: 140px !important;
          }

        }

        .wp-picker-container {

          .iris-picker {
            margin-top: 0;
            border-left: none;
            border-right: none;
            border-bottom: none;
            border-top: 1px solid #f2f3f5;
            width: 300px !important;
            height: 170px !important;
            box-shadow: none;
          }
        }

        input.button.button-small.wp-picker-clear,
        .wp-color-result {
          display: none;
        }

        .wp-picker-input-wrap {
          display: block !important;
          width: 100% !important;
          float: left;
          position: relative;
          margin-left: 0;
        }
      }

      .fusion-builder-option-container {
        position: absolute;
        top: 30px;
        left: -10px;
        background: #fff;
        z-index: 2;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
        width: 300px;
        border-radius: 5px;
        display: none;

        .fusion-builder-colorpicker-title {
          display: block;
          padding-left: 12px;
          height: 37px;
          line-height: 37px;
          font-size: 11px;
          color: #93999f;
          font-weight: 700;
          letter-spacing: 1px;
          text-align: left;
          text-transform: uppercase;
          background-color: #f2f3f5;
        }
      }

      .fusion-builder-open-colorpicker {
        display: inline-block;
        width: 25px;
        height: 25px;
        padding: 6px 5px 6px 7px;
        border-radius: 50%;
        margin-left: auto;
        margin-right: auto;
        background-size: 40%;
        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==");
        text-decoration: none;
        text-align: center;
        color: #fff;
        font-size: 0.8em;
        position: relative;

        &:before {
          content: "";
          display: block;
          width: 25px;
          height: 25px;
          position: absolute;
          background-color: inherit;
          top: -1px;
          left: -1px;
          z-index: 1;
          border-radius: 50%;
          border: 1px solid #efefef;
        }

        span {
          position: relative;
          opacity: 0;
          transition: opacity 0.1s ease;
          pointer-events: none;
          display: block;

          &:before {
            content: attr(aria-label);
            top: -30px;
            background: #1d2226;
            color: #ffffff;
            border: 1px solid #1d2226;
            white-space: nowrap;
            padding: 10px;
            font-size: 11px;
            font-family: "Noto Sans", Roboto, "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            border-radius: 4px;
            margin: 0;
            z-index: 200;
            transition: all 0.2s ease 0.2s;
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            opacity: 0;
          }
          &:after {
            content: "";
            border: 5px solid transparent;
            border-top-color: #1d2226;
            top:2px;
            z-index: 2;
            transition:all 0.2s ease 0.2s;
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            opacity: 0;
          }
        }

        &:hover span {
            opacity: 1;
            z-index: 2;

            &:before {
              opacity: 1;
              top: -50px;
              transition: all 0.2s ease 0.2s;
            }
            &:after {
              top:-17px;
              opacity: 1;
              transition: all 0.2s ease 0.2s;
            }
        }
      }

      .fusion-color-picker-opened {
        .fusion-builder-open-colorpicker {
          span {
            opacity: 1;
            z-index: 2;
          }
        }
      }

      .fusion-colorpicker-icon {
        border-radius: 0;
        position: absolute;
        top: 37px;
        right: 0;
      }

      input.fusion-builder-color-picker-hex,
      input.color-picker-placeholder {
        border: none;
        height: 40px;
        border-radius: 5px;
        text-align: left;
      }
    }
  }
  .rtl {
    .fusion-table-builder-chart {

      &.fusion-table-builder .fusion-builder-table {
        margin-left: 0;
        margin-right: 20px;
      }

      .fusion-builder-table-delete-row {
        left: auto;
        right: -35px;
      }
    }
  }
  .fusion-table-builder-chart {
    .option-field {
      .fusion-colorpicker-container {
        .wp-picker-input-wrap {
          .wp-picker-clear {
            position: absolute;
            top: 4px;
            right: 6px;
            letter-spacing: 1px;
            text-transform: uppercase;
            color: rgb(158, 160, 165);
            font-size: 11px;
            height: 28px;
            line-height: 28px;
            border-radius: 4px;
            background: rgb(242, 242, 244);
            display: block;
          }
        }
      }
    }
    .fusion-builder-option {
      .fusion-builder-option-container {
        .fusion-colorpicker-container {
            .fusion-colorpicker-icon {
              border-radius: 0;
              position: absolute;
              top: 0;
              right: 0;
              left: auto;
              box-shadow: rgba(0, 0, 0, 0.14) 1px 1px 4px 1px;
              color: rgb(255, 255, 255);
              background: rgb(25, 143, 217);
            }
        }
      }
    }
  }
}
