@import "./../../../../template/assets/scss/all-var-fns-mix";

.toggler {
  display: flex;
  align-items: center;
}

.footer-page {
  font-size: 14px;
}

// CH5C - 1519 from line number 12-24 is iphone design css it will be uncommented  once crestron one app fixes it
// css is specific for iphone notch design
// .navbar-brand {
//   padding-left: env(safe-area-inset-left);
//   padding-right: env(safe-area-inset-right);

//   @supports(padding: max(0px)) {
//     .navbar-brand {
//       padding-left: max(12px, env(safe-area-inset-left));
//       padding-right: max(12px, env(safe-area-inset-right));
//     }
//   }
// }

// CH5C-15398 - Please DO NOT remove the below class
.ch5-hide-dis {
  display: none !important;
}

.page-height-vh {
  height: 100vh !important;
}

// To see transitionOut of page animation 
.ch5-show-vis-position {
  visibility: visible !important;
  position: fixed;
  left: 0;
}

ch5-button#infobtn[shape=circle] {
  overflow: visible; // This is required for info icon badge
}

#infobtn.warn {
  position: relative;

  &:after {
    content: "!";
    position: absolute;
    background: #dc3545;
    color: $white;
    border-radius: 50%;
    height: 13px;
    border: 1px solid #711c24;
    width: 13px;
    line-height: 12px;
    text-align: center;
    top: -2px;
    right: -2px;
    font-size: 0.8rem;
    font-weight: 600;
  }
}

// #template-index-import-page,
// #template-index-import-page > div {
//   max-height: 100%;
//   height: 100%;
// }

#wrapper {
  display: flex;
  max-height: 100%;
  height: 100%;
  flex-direction: column;
}

#template-page-import-page,
#template-page-import-page > div {
  max-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#header-index-page {
  height: $header-height;

  @include media-breakpoint-down(sm) {
    height: $header-height-sm;
  }
}

#template-content-background {
  --ch5-background--transition-duration: 0;
}

#content-index-page {
  flex: 1;
  overflow-y: hidden;
  overflow-x: hidden;
  display: flex;

  &div {
    height: 100%;
  }
}

#footer-page {
  padding: 10px;
  // CH5C - 1519 from line number 68-71 is iphone design css it will be uncommented  once crestron one app fixes it
  // padding-top: 10px;
  // padding-bottom: 10px;
  // padding-left: max(10px, env(safe-area-inset-left));
  // padding-right: max(10px, env(safe-area-inset-right));
}

// #template-content-page-wrapper,
// #template-content-page-content {
//   display: flex;
//   /* use the flex model */
//   max-height: 100%;
//   height: 100%;
//   flex-direction: column;
//   /* learn more: http://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ */
// }

#content-index-body {
  flex: 1;
  overflow-y: auto;
  // CH5C - 1519 from line number 90-98 is iphone design css it will be uncommented  once crestron one app fixes it
  // css is specific for iphone notch design (CH5C-1519)
  /* learn more about iphone notch design: https://webkit.org/blog/7929/designing-websites-for-iphone-x/ */
  // padding-left: env(safe-area-inset-left);
  // padding-right: env(safe-area-inset-right);

  // @supports(padding: max(0px)) {
  //   #content-index-body {
  //     padding-left: max(12px, env(safe-area-inset-left));
  //     padding-right: max(12px, env(safe-area-inset-right));
  //   }
  // }

  .swiper-wrapper {
    height: 100%;
  }

  .ch5-viewchild {
    display: block;
    overflow: hidden;
    overflow-y: auto;
    margin: 0;
    transform: translate3d(0px, 0px, 0px);

    ch5-import-htmlsnippet > div {
      height: 100%;
      min-width: 100%;
    }
  }
}

// The below CSS is used for setting a fixed panel height - without overflow-y (scrollbar)
// This is primarily used in Construct and must NOT be removed
.panel-height {
  #content-index-body {
    overflow: hidden;

    .ch5-viewchild {
      overflow: hidden;
    }
  }
}

#brandLogo {
  max-width: 100%;
  height: $header-brandlogo-height;
  outline: none;
  width: 90%;

  img {
    width: auto;
  }

  @include media-breakpoint-down(sm) {
    height: $header-brandlogo-height-sm;
  }
}

// Header Page
div#pageStatusIdentifier {
  background-color: #ffcc00;
  display: -webkit-flex;
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  height: 4px;
  width: 100%;
  margin: 0;

  &:before {
    height: 4px;
    width: 100%;
    margin: 0;
    content: "";
  }

  &.loading:before {
    background-color: #ff7f00;
    -webkit-animation: running-progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    animation: running-progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  }

  &.success:before {
    background-color: #01c851;
  }

  &.error:before {
    background-color: #ff3548;
  }

  &.warning:before {
    background-color: #ff8800;
  }

  &.hide {
    display: none;

    &::before {
      content: none !important;
    }
  }
}

@-webkit-keyframes running-progress {
  0% {
    margin-left: 0;
    margin-right: 100%;
  }

  50% {
    margin-left: 25%;
    margin-right: 0;
  }

  100% {
    margin-left: 100%;
    margin-right: 0;
  }
}

@keyframes running-progress {
  0% {
    margin-left: 0;
    margin-right: 100%;
  }

  50% {
    margin-left: 25%;
    margin-right: 0;
  }

  100% {
    margin-left: 100%;
    margin-right: 0;
  }
}

// Content page

.horizontal-footer-menu {
  line-height: 1.2;

  ch5-button-list {
    height: auto;

    // added this to apply padding-right to last button in the list for horizontal footer menu
    .ch5-button-list {
      .ch5-button-list--button-container:last-child {
        padding-right: 10px;
      }
    }
  }

  // thumbnail swiper
  .swiper-thumb {
    width: 100%;

    --ch5-button-list--container-padding: 0;

    >div {
      display: flex;
      justify-content: space-between;
      text-align: center;

      @media (min-width: 410px) {
        transform: translate3d(0px, 0px, 0px);
      }

      .ch5-button-list--button-container {
        min-height: 100px;
        border-radius: 0;
        flex: 1;
        min-width: 125px;
        padding: 10px 0 10px 10px;

        ch5-button {
          min-height: 100px;
          opacity: 0.35;
          border: 0;
          border-radius: 0;

          >button {
            justify-content: center;
          }

          &[selected]:not([selected="false" i]) {
            opacity: 1;
          }
        }

        // repeated .ch5-button class outranks the theme's [selected]/[pressed] font-size rules
        ch5-button.ch5-button.ch5-button {
          .ch5-button--label {
            font-size: rem-calc(20px);
            text-transform: uppercase;
            font-weight: 400;
            padding-top: 5px;
            letter-spacing: 1px;
            margin: 0;
            @include text-truncate;
          }

          .ch5-button--img {
            margin: 0 auto;
            margin-top: 2px;
            margin-bottom: 2px;
            @include size(63px);
          }

          .material-icons.ch5-button--icon,
          .material-icons-outline.ch5-button--icon,
          .material-icons-round.ch5-button--icon,
          .material-icons-sharp.ch5-button--icon,
          .material-icons-twotone.ch5-button--icon,
          .fa,
          .fas,
          .far,
          .fal,
          .fad,
          .fab {
            font-size: 55px;
          }
        }
      }

      &:last-child {
        .ch5-button-list--button-container {
          min-width: 130px;
          padding-right: 10px;
        }
      }
    }

    @include media-breakpoint-down(sm) {
      >div {
        .ch5-button-list--button-container {
          min-height: 100px;

          ch5-button {
            min-height: 100px;
          }

          .ch5-button--img {
            margin-top: 2px;
            margin-bottom: 2px;
            @include size(63px);
          }
        }

        &:last-child {
          .ch5-button-list--button-container {
            padding-right: 6px;
          }
        }
      }
    }
  }

  .thumb-action {
    display: none;
  }

  @include media-breakpoint-maxheight(460px) {
    .thumb-action {
      display: block;
      position: fixed;
      bottom: 0;
      left: 50%;
      margin-left: -16px;
      animation: floating 15s infinite ease-in-out;
      z-index: $zindex-fixed;

      svg {
        @include size(32px);
        transform: rotate(90deg);
      }
    }

    .swiper-thumb {
      position: fixed;
      left: 0;
      right: 0;
      top: 100%;
      transition: transform 300ms ease-out;
      -webkit-transform: none;
      transform: none;
      z-index: ($zindex-fixed - 2);

      &.open {
        transition: transform 300ms ease-out;
        -webkit-transform: translateY(-100%);
        transform: translateY(-100%);

        &+.thumb-action {
          display: none;
          animation: none;
        }
      }
    }
  }
}

.no-menu {
  @include size(100%);
}

.vertical-menu {
  @include size(100%);

  .vertical-menu-cols {
    position: relative;
    flex-wrap: nowrap;
    flex: auto;
    height: 100%;
    flex-direction: row;
    display: flex;
  }

  .vertical-menu-child-col {
    max-width: calc(100%);
    display: flex;
    flex-grow: 2;

    @include media-breakpoint-up(md) {
      max-width: calc(100% - 60px);
    }
  }

  // thumbnail swiper
  .nav-panel {
    position: relative;

    @include media-breakpoint-up(md) {
      width: 60px;
    }
  }

  .height-for-list-menu {
    height: 100%;
    background-color: #cacaca;
  }

  .swiper-thumb {
    --ch5-button-list--container-padding: 0;
   
    .ch5-button-list {
      &.ch5-button-list--orientation-vertical {
        .ch5-button-list--button-container {
          min-width: 50px;
        }
      }
    }

    @include list-unstyled();
    margin: 0;
    text-align: center;
    padding-top: 5px;
    transition: all 0.3s linear;
    position: absolute;
    top: 0;
    height: 100%;
    left: 0;
    width: 100%;
    z-index: 9;
    max-width: none !important;

    .ch5-button-list--button-container {
      height: auto;

      padding-left: 2px;

      ch5-button {
        display: block;
        opacity: 0.35;
        border: 0;
        border-radius: 0;
        @include size(100%, 54px);

        .ch5-button--btn {
          text-align: left;
          justify-content: flex-start;
          padding-left: 11px;
          @include size(100%);
        }

        &[selected]:not([selected="false" i]) {
          opacity: 1;
        }
      }

      // repeated .ch5-button class outranks the theme's [selected]/[pressed] font-size rules
      ch5-button.ch5-button.ch5-button {
        .ch5-button--label {
          font-size: rem-calc(20px);
          text-transform: uppercase;
          font-weight: 400;
          line-height: 1;
          letter-spacing: 1px;
          margin: 0 0 0 10px;
          @include text-truncate;
        }

        .ch5-button--img {
          text-shadow: 1px 1px 1px #777;
          min-width: 36px;
          min-height: 36px;
          width: 36px;
        }

        .material-icons.ch5-button--icon,
        .material-icons-outline.ch5-button--icon,
        .material-icons-round.ch5-button--icon,
        .material-icons-sharp.ch5-button--icon,
        .material-icons-twotone.ch5-button--icon,
        .fa,
        .fas,
        .far,
        .fal,
        .fad,
        .fab {
          font-size: 36px;
        }

        .ch5-button--icon {
          font-size: 36px;
          min-width: 36px;
          min-height: 36px;
          width: 36px;
        }
      }
    }

    &:last-child {
      .ch5-button-list--button-container {
        padding-bottom: 4px;
      }
    }

    &.open {
      width: 256px !important;
      left: 0;
    }

    @include media-breakpoint-down(sm) {
      left: -10px;

      .list-item .svgImg {
        @include size(36px);
      }

      &.open {
        width: 200px !important;
      }
    }
  }

  .trigger-view-col {
    flex-basis: 0;
    flex-grow: 1;
    max-width: 100%;
  }
}