/* Latar belakang viewer */
body,
#outerContainer,
#viewerContainer {
  background-color: #1b1b1b !important;
  background-image: none !important;
}

/* Sembunyikan toolbar default */
.toolbar,
#secondaryToolbar {
  display: none !important;
}

/* Posisikan container viewer memenuhi layar dan sembunyikan horizontal scrollbar tapi fungsinya masih ada */
#viewerContainer {
  inset: 0 !important;
  overflow-x: auto !important;
  scrollbar-width: thin;
  scrollbar-color: #d8df2d #1b1b1b;
}

/* Sembunyikan scrollbar horizontal di WebKit (Chrome, Safari, Edge) */
#viewerContainer::-webkit-scrollbar:horizontal {
  display: none;
}

/* WebKit (Chrome, Safari, Edge) scrollbar styles */
#viewerContainer::-webkit-scrollbar {
  width: 10px;
}

/* Track scrollbar */
#viewerContainer::-webkit-scrollbar-track {
  background: #1b1b1b !important;
}

/* Thumb scrollbar */
#viewerContainer::-webkit-scrollbar-thumb {
  background-color: #d8df2d !important;
  border-radius: 5px;
  border: 2px solid #1b1b1b;
}

#viewerContainer::-webkit-scrollbar-thumb:hover {
  background-color: #b5bc26 !important;
}

/* Reposisi loading progress bar ke atas layar */
#loadingBar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 10000 !important;
}

/* Toolbar Melayang di Bawah Tengah */
#custom-floating-toolbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(32, 33, 36, 0.9);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-family: Roboto, Arial, sans-serif;
  font-size: 14px;
  z-index: 9999;
  user-select: none;
  -webkit-user-select: none;
}

.toolbar-label {
  font-weight: 500;
  color: #e8eaed;
}

#custom-page-input {
  background: transparent;
  border: none;
  color: #ffffff;
  width: 36px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  padding: 2px;
  outline: none;
  -moz-appearance: textfield;
}

#custom-page-input::-webkit-inner-spin-button,
#custom-page-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#custom-page-input:focus {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.toolbar-separator {
  color: #9aa0a6;
}

#custom-total-pages {
  color: #e8eaed;
  margin-right: 4px;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background-color: #5f6368;
  margin: 0 4px;
}

#custom-floating-toolbar button {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 20px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s;
  outline: none;
}

#custom-floating-toolbar button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

#custom-floating-toolbar button:active {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Tombol Fullscreen di Kanan Atas */
#custom-fullscreen-button {
  position: fixed;
  top: 16px;
  right: 16px;
  background-color: rgba(32, 33, 36, 0.7);
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  transition:
    background-color 0.2s,
    transform 0.2s;
  outline: none;
}

#custom-fullscreen-button:hover {
  background-color: rgba(32, 33, 36, 0.9);
  transform: scale(1.05);
}

#custom-fullscreen-button:active {
  transform: scale(0.95);
}

/* Tombol Reset Zoom / Fit di Tengah */
#custom-floating-toolbar #custom-zoom-reset {
  width: auto !important;
  min-width: 44px;
  padding: 0 8px;
  font-size: 13px !important;
  border-radius: 14px !important;
}

/* Tombol Spread di Kanan Atas (di bawah Fullscreen) */
#custom-spread-button {
  position: fixed;
  top: 60px;
  right: 16px;
  background-color: rgba(32, 33, 36, 0.7);
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  transition:
    background-color 0.2s,
    transform 0.2s;
  outline: none;
}

#custom-spread-button:hover {
  background-color: rgba(32, 33, 36, 0.9);
  transform: scale(1.05);
}

#custom-spread-button:active {
  transform: scale(0.95);
}
