@use '../abstracts' as *;

/* Organism - widget */
.o-widget {
  height: 100%;

  &__header {
    position: relative;
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: toRem(60);
    box-sizing: border-box;
    overflow: auto;
    z-index: 0;

    &__content {
      display: flex;
      align-items: center;

      &__title{
        color: white;
        font-size: toRem(16);
        font-weight: 500;
        padding-bottom: 0;
        padding-left: toRem(15);
      }

      &__query {
        margin-left: toRem(15);
        display: flex;
        align-items: center;

        &__icon {
        }

        &__name {
          padding-left: toRem(10);
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        &__color-point {
          width: toRem(8);
          height: toRem(8);
          margin-right: toRem(8);
          border-radius: toRem(50);
        }
      }
    }

    .m-btn-group {
      padding-right: toRem(15);

      .a-btn {
        color: white;

        &:not(:last-child) {
          margin-right: 5px;
        }
      }

      yap-settings {
        display: flex;
        align-items: center;
      }
    }

    /* .container-settings-button {
      display: flex;
    }*/
  }

  &__choose-parameters {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 65%;

    .a-p {
      font-size: toRem(15);
      padding-bottom: toRem(30);
    }
  }

  &--table {
  }

  .no-result {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;

    &__search {
      width: 40%;
      margin-bottom: toRem(40);
    }

    &__text {
      max-width: toRem(294);
      text-align: center;
      line-height: toRem(20);
    }
  }

  &__menu {
    @extend %overlay-panel-fixed-right;
    right: auto;
    bottom: auto;
    position: absolute;
    width: 300px;
    padding: toRem(5) toRem(10);
    transform: translateX(-20px);
    border-radius: toRem(5);

    .m-actions-list{
      flex-direction: column;
      padding: toRem(5) 0;
      @extend %list-unstyled;

      &__item{
        width: 100%;
        &:not(:last-of-type){
          margin-bottom: toRem(5);
        }
      }

      .a-btn{
        justify-content: flex-start;
        gap: toRem(7);
        width: 100%;
        height: auto;
        min-height: toRem(40);
        margin: 0;
        padding: toRem(5);
        text-align: left;
        border-radius: toRem(5);
        font-weight: 400;
      }
    }

  }

  // Resultset displayed in popup/panel
  &__choose-resultset {
    @extend %overlay-panel-fixed-right;
    width: 280px;
    padding: 0 0 toRem(10) 0;

    .m-namedqueries-wrapper {
      height: auto;
      overflow: auto;
      overflow-x: hidden;
      padding: toRem(30) toRem(20) 0 toRem(20);

      .m-namedqueries {
        @extend %list-unstyled;

        &__item {
          display: flex;
          flex-direction: row;
          justify-content: space-between;
          align-items: center;
          margin-bottom: toRem(15);

          .a-checkbox {
            margin-bottom: 0;
          }

          .a-checkbox__text {
            padding-right: toRem(10);
          }
        }
      }
    }

    .m-btn-group {
      min-height: 65px;
      min-height: 65px;
      padding: toRem(10) toRem(20) toRem(10) toRem(20);
    }
  }

  &__choose-form {
    @extend %overlay-panel-fixed-right;
    bottom: auto;
    min-width: 260px;
  }

  .m-btn-group.-selection-choice {
    position: fixed;
    z-index: 400;
    padding: toRem(7);
    gap: toRem(10);
    background: white;
    border-radius: toRem(6);
    border-width: 1px;
    border-style: solid;

    .a-btn {
      @include outlineOnFocus($border-radius: 4px);
    }
  }
}

.widget-below-header {
  height: toRem(60);
}
