@import "./vars.scss";

.rule-manage-root {
  float: right;
  width: 100%;
  height: 100%;

  .rule-lib-header {
    position: relative;
    width: 100%;
    height: 50px;
    font-size: 1.2rem;
    line-height: 50px;
    color: black;
    background: #E3E3E3;

    .rule-lib-header-content {
      .rule-lib-header-left {
        padding: 5px 20px;
        font-size: 15px;
        text-align: center;
      }
    }
  }
}


.rule-lib-design {
  width: 100%;
  height: 100%;

  .rule-lib-container {
    display: inline-block;
    width: 100%;
    height: 100%;
    vertical-align: top;

    .giot-content-card {
      background: white;
      border: 1px solid lightgray;
      border-radius: 5px;
    }

    .rule-lib-header {
      .rule-lib-header-right {
        .rule-lib-all-switch {
          float: right;
          width: 100px;
          margin: 15px 30px;
        }

        .search-rule {
          float: right;
        }
      }
    }

    .rule-lib-content {
      float: left;
      width: calc(100% - 20rem);
      height: calc(100% - 4.5rem);

      .rule-lib-list {
        .rule-lib-list-inner {
          .rule-lib-item-add {
            float: left;
            width: 206px;
            height: 263px;
            margin: 20px 0 0 20px;
            border-radius: 16px;
            border-bottom-right-radius: 0;
            border-bottom-left-radius: 0;

            &:hover {
              box-shadow: 0 0 5px 3px #B4B4B4;
            }

            .rule-lib-item-title {
              position: relative;
              height: 2.5rem;
              padding: 0 2rem;
              font-size: 1.3rem;
              line-height: 2.5rem;
              color: white;
              text-align: center;
              background: $blue-linear-bg;
              border-radius: 1rem 1rem 0 0;

              .rule-lib-item-del {
                position: absolute;
                right: 0;
                width: 2.5rem;
                height: 100%;
                background: #2572B3;
                border-radius: 0 1rem 0 0;

                &:hover {
                  color: red;
                }
              }
            }

            .rule-lib-item-content {
              display: flex;
              height: calc(100% - 2.5rem);
              background: #DBDBDB;
              flex-direction: column;
              -webkit-transition: height 1s;
              -moz-transition: height 1s;
              -o-transition: height 1s;
              transition: height 1s;

              &:hover {
                cursor: pointer;
              }
            }
          }

          .rule-lib-item {
            float: left;
            width: 206px;
            height: 263px;
            margin: 20px 0 0 20px;
            border-radius: 16px;
            border-bottom-right-radius: 0;
            border-bottom-left-radius: 0;
            box-shadow: 0 0 5px 3px lightgray;

            .rule-lib-item-content-root {
              width: 100%;
              height: calc(100% - 2.5rem);
              overflow: hidden;
              background: #DBDBDB;
            }

            .rule-operate-row {
              width: 100%;
              height: 57px;
              background-color: #EDEDED;
              border-bottom: 1px solid #345FA6;

              .rule-operate-cell {
                width: 100%;
                height: 100%;
                font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
                font-size: 14px;
                font-style: normal;
                font-weight: 700;
                line-height: 57px;
                color: rgb(52, 95, 166);
                text-align: center;
                border-right: 1px solid #345FA6;

                .obj-publish-switch {
                  width: 100%;
                  height: 56px;
                  line-height: 56px;
                  vertical-align: inherit;
                  border: 0;
                  border-radius: 0;

                  .amos-switch-inner {
                    padding-left: 7px;
                    font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
                    font-size: 14px;
                    font-style: normal;
                    font-weight: 700;
                  }
                }

                .obj-startuse-switch {
                  width: 100%;
                  height: 56px;
                  line-height: 56px;
                  vertical-align: inherit;
                  border: 0;
                  border-radius: 0;

                  .amos-switch-inner {
                    padding-left: 7px;
                    font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
                    font-size: 14px;
                    font-style: normal;
                    font-weight: 700;
                  }
                }

                .amos-switch {
                  &::after {
                    position: absolute;
                    width: 0;
                    height: 100%;
                    cursor: pointer;
                    background-color: white;
                    content: ' ';
                    -webkit-transition: left 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86), width 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
                    transition: left 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86), width 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
                  }
                }

                .amos-switch-checked {
                  .amos-switch-inner {
                    padding-left: 24px;
                    font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
                    font-size: 14px;
                    font-style: normal;
                    font-weight: 700;
                  }

                  &::after {
                    left: 100%;
                  }
                }

                &:hover {
                  height: calc(100% - 1px);
                  line-height: 56px;
                  cursor: pointer;
                  background-color: white;
                }
              }

              .rule-operate-cell-right {
                width: 100%;
                height: 100%;
                font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
                font-size: 14px;
                font-style: normal;
                font-weight: 700;
                line-height: 57px;
                color: rgb(52, 95, 166);
                text-align: center;

                .obj-publish-switch {
                  width: 100%;
                  height: 56px;
                  line-height: 56px;
                  vertical-align: inherit;
                  border: 0;
                  border-radius: 0;

                  .amos-switch-inner {
                    padding-left: 7px;
                    font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
                    font-size: 14px;
                    font-style: normal;
                    font-weight: 700;
                  }
                }

                .obj-startuse-switch {
                  width: 100%;
                  height: 56px;
                  line-height: 56px;
                  vertical-align: inherit;
                  border: 0;
                  border-radius: 0;

                  .amos-switch-inner {
                    padding-left: 7px;
                    font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
                    font-size: 14px;
                    font-style: normal;
                    font-weight: 700;
                  }
                }

                .amos-switch {
                  &::after {
                    position: absolute;
                    width: 0;
                    height: 100%;
                    cursor: pointer;
                    background-color: white;
                    content: ' ';
                    -webkit-transition: left 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86), width 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
                    transition: left 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86), width 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
                  }
                }

                .amos-switch-checked {
                  .amos-switch-inner {
                    padding-left: 24px;
                    font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
                    font-size: 14px;
                    font-style: normal;
                    font-weight: 700;
                  }

                  &::after {
                    left: 100%;
                  }
                }

                &:hover {
                  height: calc(100% - 1px);
                  line-height: 56px;
                  cursor: pointer;
                  background-color: white;
                }
              }
            }

            &:focus {
              border-color: rgba(52, 95, 166, 1);
              border-style: solid;
              border-width: 3px;
              border-radius: 16px;
              border-bottom-right-radius: 0;
              border-bottom-left-radius: 0;
              outline: none;
            }

            &:hover {
              border-color: rgba(52, 95, 166, 1);
              border-style: solid;
              border-width: 3px;
              box-shadow: 0 0 5px 3px #B4B4B4;

              .rule-lib-item-content {
                height: 0;
                -webkit-transition: height 1s;
                -moz-transition: height 1s;
                -o-transition: height 1s;
                transition: height 1s;

                .rule-lib-item-descr {
                  height: 0;
                  overflow: hidden;
                }

                .item-photo-wrapper {
                  height: 0;
                  overflow: hidden;
                  border: 0;
                }
              }

              .rule-lib-item-operate {
                position: relative;
                top: 0;
                left: 0;
              }
            }

            .rule-lib-item-title {
              position: relative;
              height: 2.5rem;
              padding: 0 2rem;
              font-size: 1.3rem;
              line-height: 2.5rem;
              color: white;
              text-align: center;
              background: $blue-linear-bg;
              border-radius: 1rem 1rem 0 0;

              .rule-lib-item-del {
                position: absolute;
                right: 0;
                width: 2.5rem;
                height: 100%;
                background: #2572B3;
                border-radius: 0 1rem 0 0;

                &:hover {
                  color: red;
                }
              }
            }

            .rule-lib-item-operate {
              position: relative;
              top: -228px;
              left: 0;
            }

            .rule-lib-item-content {
              position: relative;
              z-index: 1;
              display: flex;
              height: 100%;
              background: #DBDBDB;
              flex-direction: column;
              -webkit-transition: height 1s;
              -moz-transition: height 1s;
              -o-transition: height 1s;
              transition: height 1s;

              .item-photo-wrapper {
                height: 9rem;
                padding: 1rem 1rem 0 0.5rem;
                margin: 9px;
                border: 1px solid #345FA6;

                .item-photo-inner {
                  width: 100%;
                  height: 100%;
                  background: url("./../../assets/iot/rule/topology.png") no-repeat;
                }
              }

              .rule-lib-item-descr {
                width: calc(100% - 20px);
                margin: 8px 10px;
                font-family: 'Arial Normal', 'Arial';
                font-weight: 400;
                font-style: normal;
                font-size: 13px;
                color: #333333;
              }

              &:hover {
                cursor: pointer;
              }
            }
          }
        }

        .rule-lib-create {
          .rule-lib-create-icon {
            font-size: 5rem;
          }
        }
      }
    }
  }
}

.amos-switch-checked {
  &::after {
    left: calc(100% - 19px);
  }
}

.rule-lib-modal {
  overflow: inherit;

  .amos-modal-close {
    color: white;
  }

  .amos-modal-header {
    background-color: #345FA6;

    .amos-modal-title {
      color: white;
    }
  }

  .amos-modal-container {
    overflow: initial;

    .amos-modal-content {
      overflow: initial;

      .create-libaray {
        .amos-form-footer {
          height: 22px;

          .create-cancel-btn {
            position: relative;
            left: 100px;
            width: 72px;
            height: 30px;
            font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
            font-weight: 700;
            font-style: normal;
            font-size: 15px;
            color: #FFFFFF;
            background-color: #E3E3E3;
            border-radius: 61px;
            text-align: center;
            line-height: 30px;

            &:hover {
              cursor: pointer;
              background-color: lightgray;
            }
          }

          .create-submit-btn {
            position: relative;
            top: -30px;
            left: 200px;
            width: 72px;
            height: 30px;
            font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
            font-weight: 700;
            font-style: normal;
            font-size: 15px;
            color: #FFFFFF;
            background-color: #345FA6;
            border-radius: 61px;
            text-align: center;
            line-height: 30px;

            &:hover {
              cursor: pointer;
              background-color: rgb(78, 127, 206);
            }
          }
        }
      }
    }
  }
}
