@use '../../styles/defaults' as *;
@use '../../styles/variables' as *;

.expandRight {
  @extend .details;
  border-left: 1px solid $main-border-color;
  border-bottom: 1px solid $main-border-color;
  margin-top: -1em;
  display: flex;
  flex-direction: column;
  min-width: 375px;
  max-width: 375px;
  max-height: calc(100vh - 76px);
  overflow-y: scroll;
  padding: 1em 0.5em 2em 0.75em;

  > button {
    color: $main-color;
    left: 0.5rem;
    margin-right: auto;
    margin-bottom: 1em;
  }
}

.readonly {
  margin-bottom: 1rem;
}

.error {
  background-color: red;
  padding: 0.5rem;
  color: $main-background-color;
  text-align: center;
  margin-top: 0;
}

.retractRight {
  @extend .details;
  margin-top: -1em;
  padding-top: 1em;
  display: flex;
  flex-direction: column;

  > button {
    margin-left: 1em;
    margin-right: 1em;
  }

  .open {
    background-color: rgba(0, 0, 0, 0);
    white-space: nowrap;
  }
}

.sliderright {
  @extend .slider;

  > nav {
    text-align: left;
  }

  > div {
    text-align: right;

    > nav {
      p {
        @extend .clickable;
      }
    }

    > textarea {
      width: 100%;
      height: calc(100% - 8rem);
    }
  }
}

.toggle {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  font-size: 1.125rem;
  cursor: pointer;

  > label {
    cursor: pointer;
    font-weight: 500;
    user-select: none;
  }
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.yamlEditor {
  display: flex;
  flex-direction: column;

  > section {
    :global {
      .addToArray {
        margin: 0 0 1rem;
        padding: 0.5rem 1rem;
        background-color: #f0f0f0;
        border-top: 1px solid $main-border-color;
        border-bottom: 1px solid $main-border-color;
        cursor: pointer;
        color: $main-color;
      }

      .reactForm {
        display: flex;
        align-items: baseline;

        label {
          padding: 0.5em 1em;
          display: block;
          flex: 0 0 150px;
          margin: 2px;
          -webkit-box-shadow: 0 1px 1px #f0f0f0;
          box-shadow: 0 1px 1px #f0f0f0;
          background-color: #fff;
          text-align: right;
        }

        .lcheckbox {
          flex: 1 1 150px;
          text-align: left;
        }

        input,
        textarea,
        select {
          padding: 0.5em 1em;
          display: block;
          flex: 1 1 auto;
          margin: 2px;
          -webkit-box-shadow: 0 1px 1px #f0f0f0;
          box-shadow: 0 1px 1px #f0f0f0;
          background-color: #fff;
          text-align: left;
          border: none;
        }
      }

      .group {
        margin: 1em 0 0;
        border: 1px solid #f0f0f0;

        h1 {
          font-size: 1.15em;
          margin: 0;
          padding: 0.5rem 1rem;
          background-color: #f0f0f0;
          border-top: 1px solid $main-border-color;
          border-bottom: 1px solid $main-border-color;
        }

        .keywords {
          display: flex;
          align-items: baseline;
          flex-wrap: wrap;

          > input {
            padding: 0.5em 1em;
            display: block;
            -webkit-box-flex: 1;
            -ms-flex: 1 1 auto;
            flex: 1 1 auto;
            margin: 2px;
            -webkit-box-shadow: 0 1px 1px #f0f0f0;
            box-shadow: 0 1px 1px #f0f0f0;
            background-color: #fff;
            text-align: left;
            border: none;
          }

          > p:not(.addToArray) {
            margin-bottom: 1rem;
            padding: 0.5rem 1rem;
            cursor: pointer;
          }
        }

        > p:not(.addToArray) {
          margin-bottom: 1rem;
          padding: 0.5rem 1rem;
          cursor: pointer;
        }

        #modalWrapper {
          > main {
            h1 {
              margin-bottom: 1rem;
            }

            p {
              margin-bottom: 1rem;
            }

            textarea {
              width: 100%;
              padding: 0.5rem 1rem;
              height: 7rem;
            }

            > nav {
              margin-bottom: 1rem;

              button {
                display: inline-block;
                width: 50%;
              }
            }
          }
        }
      }

      section:not(.group) {
        h1 {
          font-size: 1.15em;
          margin: 0;
          padding: 0.5rem 1rem;
          background-color: #f0f0f0;
          border-top: 1px solid $main-border-color;
          border-bottom: 1px solid $main-border-color;
        }
      }
    }
  }
}

.rawYaml {
  overflow: auto;
}
