/*
*   this file includes floating button styles for page, presentation, slides & zoom actions.
*   @giraykarasinir
*/

.floatingController {
  user-select: none;
  transition: all .4s ease-out;
  opacity: 1;
  &.hideElement {
    opacity: 0;
  }

  &-container {
    display: flex;
    flex-direction: column;
    background-color: $white;
    box-shadow: 0 0 4px rgba(10, 21, 81, 0.06);
    border-radius: 4px;

    .controllerItem {
      transition: $transition;

      &.isGray {
        background-color: $inputGray;
      }

      &.isWhite {
        background-color: $white;
      }

      &.isSingle {
        border-radius: 6px;
      }

      &:hover .jfReportSVG:not(.icon-trashLine) {
        fill: $blue;
      }
      &:hover .jfReportSVG.icon-trashLine {
        fill: $danger;
      }
    }

    .controllerIndicator {
      font-size: 0.75rem;
      font-weight: 500;
      margin: 15px auto;
      text-align: center;
      color: #0A1551;
    }

    & + .floatingController-container {
      margin-top: 8px;
    }
  }

  &.forBar, &.forZoom {
    z-index: 2;
  }

  &.forBar {
    height: 50px;
    background: #252D5B;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    max-width: 436px;
    padding: 12px;
    text-align: center;

    .divider {
      width: 1px;
      height: 20px;
      background: rgba(#FFFFFF, 0.1);
    }

    .select-zoom {
      height: 24px;
      width: 61px;
      color: #fff;
      background: #2E354A;
      border: none;
      font-size: 0.875rem;
      cursor: pointer;
      margin-right: 20px;
    }

    .forSlide {
      margin: 0 12px;
    }

    .jfReportButton, .controllerItem {
      height: 28px;
      width: 28px;
      padding: 0 4px;
    }

    .jfReportButton {
      &.download {
        background-color: rgba(120, 187, 7, 0.2);
        &:hover { background-color: rgba(120, 187, 7, 0.6); }
        .icon-download {
          width: 8px;
          height: 10px;
        }
      }
      &.print {
        border: 1px solid #6F76A7;
        background-color: rgba(111, 118, 167, 0.2);
        &:hover { background-color: rgba(111, 118, 167, 0.6); }
        .icon-print {
          width: 12px;
          height: 12px;
          fill: #FFF;
        }
      }
      &.isSuccess {
        border: 1px solid #78BB07;
        background-color: rgba(120, 187, 7, 0.2);
        &:hover { background-color: rgba(120, 187, 7, 0.6); }
        .icon-download {
          width: 11px;
          height: 14px;
          fill: #fff;
        }
      }
      &.forAction {
        .icon-close { fill: rgba(200, 206, 237, 0.6); }
        &:hover .icon-close { fill: #fff; }
      }
      .icon-fullscreen {
        width: 12px;
        height: 12px;
      }
    }

    .action-container {
      margin-left: 12px;
      .jfReportButton + .jfReportButton:not(.close) {
        margin-left: 8px;
      }
      .close {
        margin-left: 15px;
        stroke: 1px;

        &:hover {
          svg {
            fill: #fff;
            opacity: .7;
          }
        }
      }
    }

    :where(.controllerItem) {
      background: #343C6A;
      border-radius: 3px;
      border: none;
      transition: $transition;

      &:where(:hover) {
        background: rgba(111, 118, 167, 0.6);
      }
    }

    .navigation-container {
      color: #fff;
      display: flex;
      align-items: center;
    }

    .floatingController-container {
      display: inline-flex;
      flex-direction: row;
      border-radius: 6px;
    }

    .controllerItem .icon-navs {
      width: 5px;
      height: 8px;
      fill: #fff;
    }

    .controllerItem:last-child .icon-navs {
      transform: rotate(-180deg);
    }

    .controllerIndicator {
      letter-spacing: .7px;
      font-size: 0.875rem;
      line-height: 28px;
      min-width: 57px;
      padding: 0 5px;

      span {
        opacity: 0.5;
      }
    }
  }

  // Page Toolbar new styles //
  &.page-toolbar {
    position: absolute;
    top: 36px;
    right: -40px;
    gap: 4px;

    &.disabled {
      opacity: 0.25;
      pointer-events: all;
      cursor: not-allowed;
    }

    .controllerItem {
      max-width: 24px;
      max-height: 24px;
      min-width: 24px;
      min-height: 24px;

      .toolbar-icon {
        width: 16px;
        height: 16px;
      }
    }

    &.active:not(.disabled) {
      opacity: 1;
      pointer-events: all;
      transition: $transition;
    }

    &.inactive {
      opacity: 0;
      transition: $transition;
    }
  }

  // Zoom Toolbar new styles //
  &.zoom-toolbar {
    gap: 4px;

    .controllerItem {
      max-width: 32px;
      max-height: 32px;
      min-width: 32px;
      min-height: 32px;

      .toolbar-icon {
        width: 20px;
        height: 20px;
      }
    }
  }

  // Slides Navigator Toggle new styles //
  &.slides-navigator-toggle {
    .controllerItem {
      max-width: 32px;
      max-height: 32px;
      min-width: 32px;
      min-height: 32px;

      .toolbar-icon {
        width: 20px;
        height: 20px;
        color: #0a1551;
        fill: #0a1551;

        &.angles-left {
          animation: fadeInAnglesLeft 0.3s ease-out;
        }

        &.slides {
          animation: fadeInSlides 0.3s ease-out;
        }

        path {
          color: #0a1551;
          fill: #0a1551;
        }
      }
    }
  }

  &.page-toolbar,
  &.zoom-toolbar,
  &.slides-navigator-toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    transition: $transition;
    border-radius: 3px;

    .floatingController-container {
      display: flex;
      padding: 4px;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 4px;
      box-shadow: 0 4px 8px 0 rgba(84, 95, 111, 0.15), 0 0 2px 0 rgba(37, 45, 91, 0.1);
    }

    :where(.floatingController-container + .floatingController-container) {
      margin-top: 0;
    }

    .controllerItem {
      width: 100%;
      height: 100%;
      display: flex;
      padding: 4px;
      flex-shrink: 0;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      border-radius: 4px;
      background-color: #F9F9FF;
      transition: $transition;

      .toolbar-icon {
        color: #0A1551;
        fill: #0A1551;
        transition: $transition;
      }

      &:where(:hover) {
        background-color: #E3E5F5;
        transition: $transition;
      }

      &:hover.primary {
        background-color: #EDF8FF;

        .toolbar-icon {
          color: #0075E3;
          fill: #0075E3;
        }
      }

      &:hover.error {
        background-color: #FEF2F2;

        .toolbar-icon {
          color: #DC2626;
          fill: #DC2626;
        }
      }
    }
  }


  &.forZoom {
    left: 15px;
    bottom: 15px;

    .floatingController-container {
      border-radius: 6px;
      background-color: $inputGray;

      & > .controllerItem:not(.isSingle) {
        padding: 8px 6px;
      }
    }

    .controllerItem:not(.isSingle):first-child {
      border-radius: 6px 6px 0 0;
      border-bottom: 1px solid #F2F2F6;
    }
    .controllerItem:not(.isSingle):last-child {
      border-radius: 0 0 6px 6px;
      border-top: 1px solid #F2F2F6;
    }

    .isSingle {
      padding: 8px;
    }
  }

  &.forSlides {
    .floatingController-container {
      background-color: transparent;
      box-shadow: none;
    }
    .controllerItem:hover .jfReportSVG.icon-trashLine {
      fill: $danger;
    }
  }

  &.forSlides, &.forPageAction {
    .floatingController-container:not(.hasGroup) {
      padding: 4px;
      .controllerItem {
        padding: 0;
        border-radius: 3px;
      }
    }
  }

  &.forPageAction:not(.forSlides) {
    top: 60px;
    right: -36px;
    transition: $transition;

    .floatingController-container {
      border-radius: 3px;

      .controllerItem {
        width: 20px;
        height: 20px;
        &:hover { background-color: #F3F3FE; }
      }

      &.hasGroup {
        padding: 4px;
        .controllerItem {
          border-radius: 3px;
          padding: 0;
          margin-top: 4px;
          &:first-child { margin-top: 0; }
        }
        .isDanger:hover { background-color: rgba(235, 63, 63, 0.1); }
      }
    }
  }

  &:not(.forSlides):not(.forBar):not(.zoom-toolbar):not(.slides-navigator-toggle) {
    position: absolute;
  }

  &.forSlides, &.forBar {
    position: relative;
  }
}

.bottom-actions-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  bottom: 20px;
  left: 20px;
  gap: 4px;
  z-index: 2;
}


@keyframes fadeInAnglesLeft {
  from {
    opacity: 0.8;
    transform: scale(0.8) translateX(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
}

@keyframes fadeInSlides {
  from {
    opacity: 0.8;
    transform: scale(0.8) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
