@use 'sass:math';

.pwv-AppBar {
  .pwv-Toolbar {
    margin-bottom: 2px;
  }
}

.pwv-DocumentBar {
  margin-right: auto;
}

.pwv-NavigationBar {
  .pwv-WebViewer--sm & {
    .pwv-ToolbarButton {
      min-width: math.div($toolbarItem__MinWidth, 2);
    }
  }
}

.pwv-ZoomBar {
  .pwv-WebViewer--sm & {
    display: none;
  }
}

.pwv-ViewBar {
  .pwv-WebViewer--sm & {
    display: none;
  }
}

.pwv-AddonsBar {
  margin-left: auto;
}

.pwv-SearchBar {
  justify-content: flex-end;
  .pwv-WebViewer--md &,
  .pwv-WebViewer--sm & {
    margin-top: -($toolbarItem__height + 2px);
  }
}

.pwv-AnnotationMenu {
  .pwv-DropdownPanel {
    right: 0;
  }
}

.pwv-search-toolbar-result-index {
  padding: 0 10px;
  min-width: 100px;
  text-align: center;
}

.pwv-navigation-toolbar-pageinput {
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
  justify-content: space-between;

  input {
    width: 2.2rem;
    text-align: right;
    background-color: transparent;
    color: $toolbarItem__SelectedTextColor;
    padding-left: 0;
    padding-right: 0.2rem;
    &:hover,
    &:focus {
      background-color: #ffffff;
    }
  }
  > span {
    display: block;
    padding: 3px;
  }
  > label {
    display: block;
    min-width: 2.2rem;
    padding-left: 0.2rem;
  }
  // .pwv-WebViewer--sm & {
  //   font-size: 0.8rem;
  //   height: math.div($toolbarItem__height, 1.5);
  //   input {
  //     height: 20px;
  //   }
  // }
}

.pwv-Dropdown-zoom {
  width: 84px;
  > button {
    justify-content: flex-end;
  }

  &.pwv-Dropdown {
    .pwv-Dropdown-text {
      padding: 0 4px 0 4px;
    }
  }
}

.pwv-page-layout-mode {
  .pwv-DropdownPanel {
    left: auto;
    right: 0;
  }
}

.pwv-page-layout-mode-item {
  display: flex;
  align-items: center;
}

.pwv-page-layout-mode-icon {
  display: block;
  height: $toolbarItem__IconSize;
  svg {
    height: $toolbarItem__IconSize;
  }
}

.pwv-WebViewer {
  &.pwv-WebViewer--sm {
    .pwv-canvas-toolbar {
      .pwv-Toolbar {
        margin-top: -($toolbarItem__height + 2px);
      }
    }
  }
}
