@brick-page-panel-left-width: 7rem;

.ub-panel-frame {

  .left-menu-shrink {
    display: none;
  }

  .left {
    position: fixed;
    left: 0;
    width: @brick-page-panel-left-width;
    top: 0;
    bottom: 0;
    background: var(--color-primary);
    overflow: hidden;
    z-index: 2000;
    box-shadow: 0 0 5px #999;
    transition: all 0.2s linear;

    .logo {
      height: 2.25rem;
      background: var(--color-primary);
      line-height: 2.25rem;
      color: #FFF;
      font-size: var(--font-size-medium);
      display: block;
      text-align: left;
      padding: 0 0.5rem;

      .icon {
      }

      .text {
      }
    }

    .menu {
      background: #222d32;
      position: fixed;
      top: 2.25rem;
      left: 0;
      width: @brick-page-panel-left-width;
      bottom: 0;
      overflow: auto;
      transition: all 0.2s linear;

      &::-webkit-scrollbar-track {
        background-color: #F8F8F8;
        border: 1px solid #EEE;
      }

      &::-webkit-scrollbar {
        width: 2px;
        height: 2px;
        background-color: #F5F5F5;
      }

      &::-webkit-scrollbar-thumb {
        border-radius: 2px;
        background-color: #CCC;
      }

      & > .menu-item {
        padding-left: 0 !important;

        .title {
          padding-left: 0.5rem;
        }
      }

      .menu-item {
        padding-left: 1.0rem;

        .menu-item {
          .menu-item {
            padding-left: 0.1rem;

            .title {
              font-size: var(--font-size-small);
              padding-right: 0.5rem;
            }
          }
        }

        &.active {
          & > .title {
            color: #FFF;
          }
        }

        .title {
          line-height: 2rem;
          display: block;
          position: relative;
          overflow: hidden;
          padding-right: 1rem;
          white-space: nowrap;
          text-overflow: ellipsis;
          font-size: var(--font-size);
          color: #87a2ae;

          &:hover {
            color: #FFF;
          }

          .icon {
            display: inline-block;
            width: 1.2em;
          }

          .arrow {
            width: 0px;
            height: 0px;
            display: block;
            border: 0.2rem solid #87a2ae;
            border-color: transparent transparent transparent #87a2ae;
            position: absolute;
            right: 0.5rem;
            top: 0.8rem;
            transition: all 0.2s linear;
            transform-origin: 25% 50% 0;
            transform: rotateZ(-90deg);
          }

          &.open {
            .arrow {
              transform: rotateZ(90deg);
            }
          }

          &.open + .children {
            max-height: 1000px;
            transition: max-height 0.2s ease-in;
          }
        }

        .children {
          display: block;
          max-height: 0;
          background: #2c3b41;
          overflow: hidden;
          transition: max-height 0.2s ease-out;
        }
      }
    }
  }

  .right {
    position: fixed;
    left: @brick-page-panel-left-width;
    right: 0;
    top: 0;
    bottom: 0;
    transition: all 0.2s linear;

    .top {
      height: 2.25rem;
      background: #FFF;
      border-bottom: 0.05rem solid #eee;
      transition: .5s;
      text-align: left;

      .right-menu-trigger {
        display: none;
      }

      .menu-right {
        float: right;
        padding-right: 1rem;

        .menu-item {
          display: inline-block;
          position: relative;

          .title {
            line-height: 2.25rem;
            color: #111;
            padding: 0 0.5rem;
            display: inline-block;

            &:hover {
              color: var(--color-primary);
            }
          }

          .dropdown {
            display: none;
            position: absolute;
            background: #FFF;
            padding: 0 0.25rem;
            box-shadow: 0 0 5px #ccc;
            border-radius: 3px;
            z-index: 1000;
            right: 0;
            top: 2.25rem;

            .dropdown-item {
              display: block;
              white-space: nowrap;
              height: 2rem;
              line-height: 2rem;
              padding: 0 0.5rem;
              color: #111;

              &:hover {
                color: var(--color-primary);
              }
            }
          }

          &:hover {
            .dropdown {
              display: block;
            }
          }
        }
      }

      .left-trigger {
        display: inline-block;
        line-height: 2.25rem;
        padding: 0 1rem;
        color: #999;
        font-size: var(--font-size-large);
        vertical-align: middle;
        transition: all 0.2s linear;

        &:hover {
          color: var(--color-primary);
        }
      }

      .menu {
        display: inline-block;
        vertical-align: middle;

        a {
          line-height: 2.10rem;
          color: #333;
          padding: 0 0.25rem;
          margin: 0 0.5rem;
          display: inline-block;
          border-bottom: 0.1rem solid #FFF;
          text-decoration: none;

          &.active {
            border-color: var(--color-primary);
            color: var(--color-primary);
          }

          &:hover {
            color: var(--color-primary);
          }
        }
      }
    }

    .content {
      &.fixed {
        position: fixed;
        top: 2.25rem;
        bottom: 0;
        left: @brick-page-panel-left-width;
        right: 0;
        overflow: auto;
        transition: all 0.2s linear;
        background: #ecf0f5;
        padding: 0.5rem;
      }
    }

    .content-fixed-bottom-toolbox {
      position: fixed;
      bottom: 0;
      right: 0;
      left: 7rem;
      background: #FFF;
      padding: 0.5rem;
      box-shadow: 0 0 4px #ccc;
      z-index: 1000;
      transition: all 0.2s linear;
    }

    .content-fixed-bottom-toolbox-placeholder {
      height: 2rem;
      clear: both;
      overflow: hidden;
    }


  }
}

@media (min-width: 38.35rem) {
  .ub-panel-frame {
    overflow: hidden;

    &.left-toggle {
      .left:not(:hover) {
        width: 2.25rem;

        .logo {
          .icon {
            font-size: var(--font-size-large);
          }

          .text {
            display: none;
          }
        }

        .menu {
          width: 2.25rem;

          .menu-item {
            .title {
              text-overflow: initial;
              padding: 0;
              text-align: center;

              .icon {
                text-align: center;
              }

              .arrow {
                display: none;
              }

              .text {
                display: none;
              }
            }
          }
        }
      }

      .right {
        left: 2.25rem;

        .top {
          .left-trigger {
            transform: rotateZ(90deg);
          }
        }

        .content {
          &.fixed {
            left: 2.25rem;
          }
        }

        .content-fixed-bottom-toolbox {
          left: 2.25rem;
        }

      }
    }
  }
}

@media (max-width: 38.35rem) {
  .ub-panel-frame {
    &.left-toggle {
      .left-menu-shrink {
        display: block;
      }

      .left {
        left: 0;

        .menu {
          left: 0;
        }
      }

      .right {
        left: 0;

        .content {
          &.fixed {
            left: 0;
          }
        }
      }
    }

    .left-menu-shrink {
      display: none;
      position: fixed;
      background: rgba(0, 0, 0, 0.5);
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 1999;
    }

    .left {
      left: -@brick-page-panel-left-width;

      .menu {
        left: -@brick-page-panel-left-width;

      }
    }

    .right {
      left: 0;

      .top {
        .right-menu-trigger {
          display: block;
          float: right;
          height: 2.25rem;
          width: 2.25rem;
          line-height: 2.25rem;
          text-align: center;
          color: #999;
          font-size: var(--font-size-large);
          transition: all 0.2s linear;

          &:hover {
            transform: rotateZ(90deg);
          }

          &:hover + .menu-right {
            display: block;
          }
        }

        .menu-right {
          width: 5rem;
          background: #FFF;
          position: fixed;
          top: 2.25rem;
          right: 0;
          border: #FFF;
          z-index: 1000;
          border-radius: 0 0 0.2rem 0.2rem;
          box-shadow: 0 0 3px #eee;
          padding-right: 0;
          display: none;

          &:hover {
            display: block;
          }

          .menu-item {
            .title {
              color: #999;
            }

            .dropdown {
              display: block;
              position: static;
              box-shadow: none;
            }
          }
        }
      }

      .content {
        &.fixed {
          left: 0;
        }
      }
    }
  }
}

.ub-panel-dialog {
  position: relative;

  .panel-dialog-body {
    background: #ecf0f5;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 2.5rem;
    padding: 0.5rem;
    overflow: auto;
  }

  .panel-dialog-foot {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    text-align: right;
    padding: 0.5rem;
    height: 2.5rem;
    box-sizing: border-box;
    background: #FFF;
    z-index: 1000;
    box-shadow: 0 0 10px #EEE;
  }
}
