body.dark-mode_page_dracula-toggle-builder {

  #wpfooter {
    display: none;
  }
}

.dracula-toggle-builder {

  * {
    box-sizing: border-box;
  }

  &-header {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
    width: calc(100% + 20px);
    margin-left: -20px;
    position: sticky;
    top: 32px;
    justify-content: space-between;
    z-index: 99;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;

    .header-title {
      display: flex;
      align-items: center;
      font-size: 1.2rem;
      cursor: pointer;

      img {
        width: 20px;
        margin-right: 5px;
      }

      .toggle-title {
        font-size: .85rem;
        margin-right: 15px;
        border-color: #ddd;
        padding: 5px 12px;
        border-radius: 7px;
        min-width: 200px;
        height: 40px;
        margin-left: 15px;
      }

    }

    .header-actions {
      display: flex;

      button {
        margin-left: 10px;
        line-height: 1;

        &.back-btn {
          background: #5c637e;
          color: #fff;
          border-color: darken(#5c637e, 10%);

          &:hover {
            background: #4b5069;
          }
        }
      }
    }

    @media (max-width: 767px) {
      padding: 10px;
      margin-left: -10px;
      width: calc(100% + 10px);
      justify-content: center;
      top: -40px;
      flex-direction: column;

      .header-actions {
        flex: 1;
        justify-content: center;
        gap: 10px;

        button {
          margin-left: auto;
        }
      }

      &.is-edit {
        flex-direction: column;

        .header-actions {
          margin-top: 10px;
        }
      }

    }
  }

  &-form {
    margin-top: 20px;
    margin-right: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;

    .form-footer {
      margin-top: 30px;
      display: flex;
      justify-content: space-between;
      align-items: center;

      button:last-child {
        i {
          margin-right: 0;
          margin-left: 5px;
        }
      }
    }

    @media (max-width: 767px) {
      margin-top: 0;
      margin-right: 10px;

      .form-header {
        justify-content: center;
        margin-bottom: 1rem;

        .shortcode-wrap {
          display: none;
        }
      }
    }

  }

  .no-item-placeholder {
    padding: 2rem 3rem;
    border-radius: 10px;
    border: 1px solid #ddd;
    margin: 50px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background-color: #f5f5f5;
    width: 400px;
    max-width: 100%;
    text-align: center;

    img {
      max-width: 250px;
      margin-bottom: 1.5rem;
    }

    h3 {
      margin-top: 0px;
      margin-bottom: 5px;
    }

    p {
      margin-top: 5px;
      margin-bottom: 5px;
      color: #777;
    }

    button {
      margin-top: 10px;
    }
  }

  .selection-actions-wrap {
    display: flex;
    align-items: center;
    margin: 30px 0;

    .selection-count {
      font-weight: 500;
      background: rgba(#2FB44B, 0.1);
      padding: 10px 10px;
      border-radius: 5px;
      height: 35px;
      border: 1px solid rgba(#2FB44B, 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: .9rem;
      white-space: nowrap;
    }

    .dracula-btn {
      margin-left: 10px;
      height: 35px;
      white-space: nowrap;
    }
  }

  .dracula-toggle-list {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    box-shadow: 0 1px 1px #ccc;
    border: solid #ccc 1px;
    overflow: hidden;

    &-wrap {
      margin-right: 20px;
    }

    &-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 30px;
      margin-bottom: 15px;

      .dracula-toggle-list-title {
        font-size: 1.2rem;
        font-weight: 600;
        margin: 0;
        display: flex;
        align-items: center;

        .toggle-list-count {
          font-size: 1rem;
          font-weight: 400;
          color: #777;
          margin-left: 7px;
        }

      }

      .dracula-list-column-settings {
        i {
          width: 25px;
          height: 25px;
          font-size: 25px;
          color: #5c637e;
          cursor: pointer;
        }

        .list-settings-tooltip {
          display: flex;
          flex-wrap: wrap;
          justify-content: space-between;
          max-width: 430px;

          .settings-columns {
            width: 100%;
            margin-bottom: 10px;
          }

        }

        .settings-wrap {
          margin-bottom: 5px;
          width: 48%;

          h4 {
            margin-top: 0;
            margin-bottom: 7px;
          }

          .components-select-control {
            min-width: 100px;
          }

          .components-select-control__input {
            height: 35px;
          }

          .components-input-control__backdrop {
            border-color: #eee;
          }

        }

        .column-options {
          display: flex;

          .dracula-column-setting {
            margin-bottom: 10px;
            margin-right: 10px;
            border: 1px solid #eee;
            padding: 5px 10px 5px 7px;
            border-radius: 5px;

            .components-base-control__field {
              display: flex;
              align-items: center;
              margin-bottom: 0;

              .components-h-stack {
                align-items: center;
              }

            }

          }

        }

      }

    }

    thead {
      background: #FAFAFA;
      border: 1px solid #ddd;


      th {
        padding: 15px;
        font-size: .875rem;
        color: #555;
        border-left-width: 0;
        border-right-width: 0;

        &:first-child {
          border-left-width: 2px;
        }

        &:last-child {
          border-right-width: 2px;
        }

        .sortable {
          cursor: pointer;
          display: inline-flex;
          align-items: center;
          justify-content: center;

          i {
            opacity: .5;
            margin-left: 5px;
            color: #999;
            transition: all .3s ease;
          }

          &.asc {
            i {
              transform: rotate(180deg);
            }
          }

          &.desc {
            i {
              transform: rotate(0deg);
            }
          }

          &.active,
          &:hover {
            color: $dracula_color;

            i {
              opacity: 1;
              color: $dracula_color_light;
            }
          }

        }

      }
    }

    tbody {
      th, td {
        padding: 10px 15px;
        font-size: .875rem;
        color: #555;
        border: 1px solid #ddd;
        border-left-width: 0;
        border-right-width: 0;
        text-align: center;
        white-space: nowrap;

        &:first-child {
          border-left-width: 1px;
        }

        &:last-child {
          border-right-width: 1px;
        }
      }
    }

    &-item {
      transition: all .3s ease;

      &:nth-child(even) {
        background: #FFF;
      }

      &:nth-child(odd) {
        background: whitesmoke;
      }

      &:hover {
        background: #EAF2FA;
      }
    }

    .col-selection {
      width: 40px;
      text-align: center;
      padding-right: 0;

      .components-base-control__field {
        margin-bottom: 0;
      }

    }

    .col-id {
      width: 70px;
    }

    .col-title {
      text-align: left;
    }

    .col-preview {
      .dracula-toggle-wrap {
        text-align: center;

        .dracula-toggle {
          margin: auto;
        }

      }
    }

    .col-code {
      & > div {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: relative;

        code {
          color: #f54d4e;
          padding: 10px 10px 10px 35px;
          border-radius: 5px;
          display: flex;
          align-items: center;
        }

        i {
          position: absolute;
          left: 10px;
          margin-right: 5px;
          color: $dracula_color_light;
          border-radius: 30px;
          height: auto;
          width: auto;
          cursor: pointer;
          transition: all .3s ease;

          &:hover {
            color: $dracula_color;
          }
        }
      }
    }

    .col-actions {

      button {
        margin-left: 10px;
        padding: 7px 10px;
        display: inline-flex;
        cursor: pointer;
        border: 1px solid rgba(#ddd, .5);

        i {
          margin-right: 0;
        }

        &:first-child {
          margin-left: 0;
        }
      }
    }

    @media (max-width: 767px) {
      &-wrap {
        overflow-x: auto;
        margin-right: 10px;
      }
    }

  }

  /**---- Promo ----**/
  .dracula-pro-modal-wrap {
    min-height: 100vh;
    position: absolute;
    width: calc(100% + 20px);
    margin-left: -20px;

    .dracula-pro-modal {
      align-self: flex-start;
      margin-top: 200px;
    }

  }

}

.form-builder {
  display: flex;
  flex-direction: column;
  margin-right: 1.5rem;
  flex: 1;

  &-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 20px;
    background: #fff;
    border-radius: .5rem;
    padding: 1rem;
  }

  &-body {
    background: #FFF;
    border-radius: 7px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  }

  &-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
  }

  &-settings {
    display: flex;
    flex-direction: column;
    margin-top: 1rem;
    border: 1px solid #ddd;
    padding: 1rem;
    border-radius: 0.5rem;
    background: #FAFAFA;

    .settings-field {
      display: flex;
      align-items: center;
      border: 1px solid rgba(#ddd, .5);
      background: #FFF;
      padding: 10px 15px;
      border-radius: 10px;

      &:not(:last-child) {
        margin-bottom: 15px;
      }

      &-sub {
        display: flex;
        flex-direction: column;
        margin-top: 5px;
        border: 1px dashed #ddd;
        padding: 10px;
        border-radius: 5px;

        .settings-field {
          flex-direction: column;
          align-items: flex-start;
          border: none;
          padding: 0;

          &-label {
            width: 100%;
            margin-bottom: 10px;

            &:after {
              display: none;
            }
          }

          .settings-field-content {
            margin-left: 0;

            .description {
              &:last-child {
                margin-bottom: 0;
              }
            }
          }

          &:last-child {
            margin-bottom: 0;
          }
        }

      }

      &-label {
        width: 20%;
        max-width: 180px;
        font-size: .875rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        margin-right: 1.5rem;
        color: #555;

        &:after {
          content: ":";
          margin-left: auto;
        }
      }

      &-content {
        display: flex;
        flex-direction: column;
        flex: 1;

        .description {
          margin-top: .5rem;
        }
      }

      .sub_group {
        margin-top: 1rem;
      }

      &.choose-icon {
        flex-direction: column;
        align-items: flex-start;

        .settings-field-label {
          margin-bottom: 0;

          &:after {
            display: none;
          }
        }

        .settings-field-content {
          margin-top: 10px;
        }

      }

    }

    .settings-header {
      margin-top: 0;
      color: #555;
      font-size: 1rem;
    }

    @media (max-width: 767px) {
      .settings-field {
        flex-direction: column;
        align-items: flex-start;

        &-label {
          width: 100%;
          margin-bottom: 10px;

          &:after {
            content: "";
            display: none;
          }
        }

        &-content {
          width: 100%;
        }

        &-sub {
          border: none;
          padding: 0;
        }

      }
    }

  }

  /*---- Toggle Icons -----*/
  .toggle-icons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;

    .icon-wrap {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 80px;
      height: 80px;
      background: #fff;
      border: 1px solid #ddd;
      position: relative;
      border-radius: 5px;
      cursor: pointer;

      &.active {
        background: rgba(#7c5dee, .3);
        border-color: $dracula_color;

        .icon-index {
          color: $dracula_color;
        }
      }

      &:hover:not(.active) {
        background: rgba(#7c5dee, .1);
      }

      .toggle-icon {
        width: 30px;
        height: 30px;
      }

      .icon-index {
        position: absolute;
        top: 0;
        left: 0;
        color: #5c637e;
        padding: 1px 5px;
        border-top-left-radius: 5px;
        border-bottom-right-radius: 5px;
      }

      .active-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        background: #7c5dee;
        padding: 3px 7px;
        color: #FFF;
        border-radius: 50%;
        height: 20px;
        width: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #7c5dee;
      }

    }
  }

  /*----- Toggle Layouts -----*/
  .toggle-layouts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;

    .layout-wrap {
      display: flex;
      align-items: center;
      justify-content: center;
      background: #fff;
      border: 1px solid #ddd;
      position: relative;
      border-radius: .5rem;
      cursor: pointer;
      padding: 25px 30px;

      &.active {
        border-color: $dracula_color;

        .toggle-icon {
          background-color: #fff;
        }
      }

      .layout-icon {
        max-width: 100%;
        height: 40px;
      }

      .layout-index {
        position: absolute;
        top: 0;
        left: 0;
        background: #7c5dee;
        padding: 3px 7px;
        color: #fff;
        border-top-left-radius: 5px;
        border-bottom-right-radius: 5px;
      }

      .active-badge {
        position: absolute;
        top: 5px;
        right: 5px;
        color: #FFF;
        padding: 3px 7px;
        background: #7c5dee;
        border-radius: 50%;
        height: 20px;
        width: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #7c5dee;
      }

      &.layout-5 {
        padding: 1rem 1.5rem;

        img {
          height: 60px;
        }
      }

    }

    &.state-dark {
      .layout-wrap {
        background: #2C3E50;

        &.active {
          border-color: lighten($dracula_color, 15%);
        }
      }

    }

  }

  .svg-upload-btns {
    display: flex;
    margin-top: 15px;

    button {
      margin-right: 1rem;
    }
  }

  .svg-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #ccc;
    border: 1px solid #ddd;
    position: relative;
    border-radius: 5px;
    margin-top: 15px;

    &.active {
      border-color: #675ED5;
    }

    img {
      width: 30px;
      height: 30px;
    }

  }

  .dracula-range-control {
    width: 400px;
    max-width: 100%;

    .components-base-control__field {
      margin-bottom: 0;
    }

    .components-range-control__mark {
      top: -6px;

      &-label {
        top: 20px;
      }
    }

    .components-range-control__wrapper {
      margin-bottom: 0;
    }
  }

  .components-base-control__field {
    margin-bottom: 0;
  }

  .components-text-control__input {
    width: 300px;
    max-width: 100%;
    border-color: #ccc;
    border-radius: .5rem;
    height: 40px;
  }

  .components-circular-option-picker__custom-clear-wrapper {
    margin-top: 0;
  }

  @media (max-width: 767px) {
    width: 100%;
    margin-right: 5px;
    margin-bottom: 15px;

    &-tabs {
      flex-direction: column;

      .dracula-button-group {
        margin-bottom: 10px;
      }
    }

    .dracula-range-control {
      width: 100%;
    }


    .toggle-layouts {
      gap: 10px;
    }

    .toggle-icons {
      gap: 10px;

      .icon-wrap {
        width: 30%;
        aspect-ratio: 1;
      }

    }

  }

}

.form-builder-preview {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 100px;
  min-width: 20%;

  .preview-header {
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
    padding: 15px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: space-between;

    &-title {
      margin-right: 10px;
    }

    i {
      margin-right: 5px;
    }

    .shortcode-wrap {
      display: flex;
      align-items: center;
      margin-left: auto;
      position: relative;

      code {
        color: #f54d4e;
        border-radius: 5px;
        font-size: .8rem;
        font-weight: 400;
        padding: 10px 10px 10px 35px;
        white-space: nowrap;
      }

      i {
        height: auto;
        width: auto;
        font-size: 1.5rem;
        position: absolute;
        left: 10px;
        color: $dracula_color_light;
        cursor: pointer;
      }

    }

  }

  .form-actions {
    background: #fff;
    border-radius: 7px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .form-preview {
    background: #fff;
    border-radius: 7px;

    &.state-dark {
      background: #2C3E50;
      color: #fff;

      .preview-header {
        border-color: rgba(#ddd, .15);

        .shortcode-wrap {
          border: 1px solid rgba(#ddd, .15);
          border-radius: 5px;
        }
      }
    }

    .preview-content {
      padding: 20px 20px 40px 20px;
    }

    .dracula-toggle {
      margin: auto;


      &-wrap {
        text-align: center;
        width: max-content;
        margin: auto;
      }
    }
  }

}