/* ============================================================
   Café Lamhey — Standalone PDF Sample Reader Component Stylesheet
   ============================================================ */

.bk-pdf-backdrop {
  position: fixed;
  inset: 0;
  background: hsla(24, 50%, 6%, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-smooth);
}

.bk-pdf-backdrop.bk-pdf-open {
  opacity: 1;
  pointer-events: auto;
}

.bk-pdf-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1050px;
  height: 85vh;
  background: hsla(0, 0%, 75%, 0.945);
  border: 1px solid hsla(28, 35%, 45%, 0.25);
  border-radius: 15px;
  /* Standalone 15px border-radius curves matching workspace standards */
  overflow: hidden;
  box-shadow:
    0 40px 100px hsla(24, 50%, 5%, 0.85),
    0 0 0 1px hsla(28, 45%, 50%, 0.1),
    inset 0 1px 0 hsla(30, 35%, 90%, 0.05);
  transform: translateY(40px) scale(0.96);
  transition: transform 0.5s var(--ease-luxury);

  /* Highlighter pen cursor - Default: Yellow */
  --highlighter-cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><circle cx='2.5' cy='1.5' r='4' fill='%23FFEB3B' fill-opacity='0.5'/><path d='M1 3 L4 0 L10 4 L4 10 Z' fill='%23FFEB3B' stroke='%23000000' stroke-width='1' stroke-linejoin='round'/><path d='M4 10 L10 4 L14 8 L8 14 Z' fill='%23424242' stroke='%23000000' stroke-width='1' stroke-linejoin='round'/><path d='M8 14 L6 16 L22 32 L32 22 L16 6 L14 8 Z' fill='%23FFEB3B' stroke='%23000000' stroke-width='1' stroke-linejoin='round'/><path d='M13 23 L23 13 L26 16 L16 26 Z' fill='%23212121'/></svg>") 2 2, auto;
}

.bk-pdf-backdrop.bk-pdf-open .bk-pdf-modal {
  transform: translateY(0) scale(1);
}

/* Header Section */
.bk-pdf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 2rem;
  background: hsl(26, 32%, 15%);
  border-bottom: 1px solid hsla(28, 35%, 45%, 0.15);
  z-index: 10;
}

.bk-pdf-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bk-pdf-icon {
  width: 24px;
  height: 24px;
  color: var(--glow-color);
}

.bk-pdf-title-container {
  display: flex;
  flex-direction: column;
}

.bk-pdf-subtitle {
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: hsla(28, 35%, 65%, 0.7);
  font-family: var(--body-font);
}

.bk-pdf-title {
  font-size: 1.15rem;
  font-family: var(--serif-font);
  font-weight: 600;
  color: var(--white-color);
  margin-top: 0.15rem;
  margin-bottom: 0 !important;
}

.bk-pdf-header-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Control buttons: Open-in-new-tab & Close */
.bk-pdf-external-btn,
.bk-pdf-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid hsla(28, 35%, 50%, 0.2);
  background: hsla(28, 30%, 18%, 0.6);
  color: hsla(30, 35%, 80%, 0.75);
  cursor: pointer;
  transition: all 0.25s var(--ease-smooth);
}

.bk-pdf-external-btn svg,
.bk-pdf-close svg {
  width: 16px;
  height: 16px;
}

.bk-pdf-external-btn:hover {
  background: hsla(28, 45%, 38%, 0.25);
  border-color: var(--glow-color);
  color: var(--white-color);
  transform: scale(1.05);
}

.bk-pdf-close:hover {
  background: hsla(0, 60%, 45%, 0.25);
  border-color: hsla(0, 60%, 55%, 0.35);
  color: hsl(0, 65%, 75%);
  transform: scale(1.05) rotate(90deg);
}

/* Body / PDF Container */
.bk-pdf-body {
  position: relative;
  flex: 1;
  width: 100%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 3D Book Layout */
.bk-book-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  padding: 0rem 14rem;
  box-sizing: border-box;
}

/* ============================================================
   3D Book Cover Backing & Page Stacks
   ============================================================ */
.bk-book-3d-cover {
  position: absolute;
  background: linear-gradient(135deg, #2b170c 0%, #150c06 100%);
  border: 1px solid #482c1a;
  border-radius: 10px;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.65),
    0 12px 30px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
  z-index: 2;
  pointer-events: none;
  box-sizing: border-box;
  display: none !important;
}

/* Spine crease overlay on the cover */
.bk-book-3d-cover.landscape::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 100%;
  background: linear-gradient(to right,
      rgba(0, 0, 0, 0.5) 0%,
      rgba(0, 0, 0, 0.15) 30%,
      rgba(255, 255, 255, 0.05) 50%,
      rgba(0, 0, 0, 0.15) 70%,
      rgba(0, 0, 0, 0.5) 100%);
  border-left: 1px solid rgba(0, 0, 0, 0.45);
  border-right: 1px solid rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

/* Left spine for closed front cover */
.bk-book-3d-cover.portrait.closed-cover::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 100%;
  background: linear-gradient(to right,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(0, 0, 0, 0.15) 20%,
      rgba(0, 0, 0, 0.45) 80%,
      rgba(0, 0, 0, 0.65) 100%);
  border-right: 1px solid rgba(0, 0, 0, 0.5);
  border-top-left-radius: 9px;
  border-bottom-left-radius: 9px;
  box-sizing: border-box;
}

/* Right spine for closed back cover */
.bk-book-3d-cover.portrait.closed-back::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 100%;
  background: linear-gradient(to left,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(0, 0, 0, 0.15) 20%,
      rgba(0, 0, 0, 0.45) 80%,
      rgba(0, 0, 0, 0.65) 100%);
  border-left: 1px solid rgba(0, 0, 0, 0.5);
  border-top-right-radius: 9px;
  border-bottom-right-radius: 9px;
  box-sizing: border-box;
}

.bk-page-stack {
  position: absolute;
  background: #a8a8a8;
  z-index: 3;
  pointer-events: none;
  box-sizing: border-box;
  background: repeating-linear-gradient(90deg,
      rgba(0, 0, 0, 0.08) 0px,
      rgba(0, 0, 0, 0.08) 1px,
      #fdfcf7 1px,
      #fdfcf7 3px);
  border-top: 1px solid #e3dac7;
  border-bottom: 1px solid #cfc4ac;
  display: none;
}

.bk-page-stack-left {
  border-left: 1px solid #c2b69c;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  box-shadow: -3px 5px 10px rgba(0, 0, 0, 0.407);
}

.bk-page-stack-right {
  border-right: 1px solid #c2b69c;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  box-shadow: 3px 5px 10px rgba(0, 0, 0, 0.407);
}

.bk-book {
  /* width: 90%;
  max-width: 820px;
  height: 80%;
  max-height: 920px; */
  /* remove the static aspect-ratio line entirely */
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  border-radius: 8px;
  z-index: 4;
}


/* Book centering translation classes - handled natively by page-flip */
.bk-book.closed-cover {
  transform: none;
}

.bk-book.closed-back {
  transform: none;
}

.bk-book.open {
  transform: none;
}

/* Book Spine shadow */
.bk-book::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 100%;
  background: linear-gradient(to right,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.08) 15%,
      rgba(0, 0, 0, 0.204) 40%,
      rgba(0, 0, 0, 0.285) 50%,
      rgba(0, 0, 0, 0.196) 60%,
      rgba(0, 0, 0, 0.08) 85%,
      rgba(0, 0, 0, 0) 100%);
  z-index: 10;
  /* Overlay on top of canvas pages */
  pointer-events: none;
  border-radius: 2px;
  transition: opacity 0.4s var(--ease-smooth);
}

/* Set z-index to -1 when turning pages */
.bk-book.flipping::after {
  z-index: -1;
}

/* Page 1 (closed cover) left-side dominant shadow for book depth */
.bk-book.closed-cover::after {
  opacity: 1;
  width: 34px;
  left: 0;
  transform: none;
  background: linear-gradient(to right,
      rgba(0, 0, 0, 0.4) 0%,
      rgba(0, 0, 0, 0.395) 15%,
      rgba(0, 0, 0, 0.1) 45%,
      rgba(0, 0, 0, 0.03) 75%,
      rgba(0, 0, 0, 0) 100%);
}

.bk-book.landscape.closed-cover::after {
  left: 49%;
  /* align to the left edge of the centered cover page */
}

/* Last page (closed back cover) right-side dominant shadow for book depth */
.bk-book.closed-back::after {
  opacity: 0;
}

/* Book Pages (used by page-flip library as stf__item) */
.bk-pdf-page {
  position: relative;
  background: #fdfaf6;
  /* Creamy book paper color */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.452);
  box-sizing: border-box;
  border-radius: 6px;
}

/* Page corners rounding and borders applied by library classes */
.stf__item {
  background: #fdfaf6;
  box-sizing: border-box;
  /* add this explicitly */
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Custom page fold and curve shadows to simulate paper depth */
.stf__item.--left .bk-pdf-page,
.stf__item.--left {
  box-shadow:
    inset -12px 0 24px rgba(0, 0, 0, 0.12),
    inset 8px 0 12px rgba(0, 0, 0, 0.02),
    0 4px 10px rgba(0, 0, 0, 0.484) !important;
}

.stf__item.--right .bk-pdf-page,
.stf__item.--right {
  box-shadow:
    inset 12px 0 24px rgba(0, 0, 0, 0.12),
    inset -8px 0 12px rgba(0, 0, 0, 0.02),
    0 4px 10px rgba(0, 0, 0, 0.588) !important;
}

.stf__item.--hard .bk-pdf-page,
.stf__item.--hard {
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.25),
    inset 0 0 15px rgba(0, 0, 0, 0.05) !important;
  border-radius: 6px;
}

/* Pseudo-element overlay for 1st page hard cover (front cover) - shadow on the right side only */
.stf__item.--hard.--right.bk-first-page::after,
.stf__item.--hard.--right .bk-first-page::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow:
    inset 0 -20px 25px -15px rgba(0, 0, 0, 0.67),
    /* top */
    inset -30px 0 35px -15px rgba(0, 0, 0, 0.262),
    /* right */
    inset 0 20px 25px -15px rgba(0, 0, 0, 0.18);
  /* bottom */
  pointer-events: none;
  z-index: 10;
  border-radius: 6px;
}

/* Pseudo-element overlay for last page hard cover (back cover) - shadow on the left side only */
.stf__item.--hard.--left.bk-last-page::after,
.stf__item.--hard.--left .bk-last-page::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow:
    inset 0 -20px 25px -15px rgba(0, 0, 0, 0.22),
    /* top */
    inset 30px 0 35px -15px rgba(0, 0, 0, 0.262),
    /* left */
    inset 0 20px 25px -15px rgba(0, 0, 0, 0.18),

    inset -30px 0 35px -15px rgba(0, 0, 0, 0.262);
  /* bottom */
  pointer-events: none;
  z-index: 10;
  border-radius: 6px;
}

/* Custom spine styling helper on parent wrapper */
.bk-book.portrait::after {
  display: none;
}

/* Canvas stretching within pages */
.bk-pdf-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
  display: block;
}

#page-canvas-1 {
  object-fit: cover;
}

/* Skeleton Loading Shimmer for lazy pages */
.bk-page-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #fdfaf6;
  gap: 1rem;
  z-index: 5;
}

.bk-page-loading::after {
  content: "";
  width: 32px;
  height: 32px;
  border: 3px solid rgba(200, 157, 124, 0.2);
  border-top-color: var(--glow-color, #c89d7c);
  border-radius: 50%;
  animation: bk-spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.bk-page-loading span {
  font-size: 0.75rem;
  color: hsla(28, 20%, 30%, 0.6);
  font-family: var(--body-font);
  letter-spacing: 0.05em;
}

/* Interactive Click Zones on the Book */
.bk-click-zone {
  position: absolute;
  top: 5%;
  height: 90%;
  width: 25%;
  z-index: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.3s;
}

.bk-click-zone-left {
  left: 2%;
}

.bk-click-zone-right {
  right: 2%;
}

.bk-click-zone-left:hover {
  background: linear-gradient(to right, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
}

.bk-click-zone-right:hover {
  background: linear-gradient(to left, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
}

/* Disable click zones when book is in cover state or end state */
.bk-book-container.at-cover .bk-click-zone-left {
  display: none;
}

.bk-book-container.at-end .bk-click-zone-right {
  display: none;
}

/* Stylish Navigation Buttons */
.bk-book-container .bk-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid hsla(28, 35%, 50%, 0.2);
  background: hsla(28, 30%, 12%, 0.85);
  color: hsla(30, 35%, 85%, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 600;
  transition: all 0.25s var(--ease-smooth);
  backdrop-filter: blur(10px);
}

.bk-book-container .bk-nav-btn svg {
  width: 20px;
  height: 20px;
}

.bk-book-container .bk-nav-btn:hover {
  background: var(--glow-color, #c89d7c);
  color: hsl(26, 32%, 12%);
  border-color: var(--glow-color, #c89d7c);
  box-shadow: 0 0 15px rgba(200, 157, 124, 0.4);
}

.bk-book-container .bk-nav-btn:disabled {
  opacity: 0;
  pointer-events: none;
}

.bk-nav-prev {
  left: 1.5rem;
}

.bk-nav-next {
  right: 1.5rem;
}

/* Footer elements: progress and index */
.bk-pdf-footer {
  position: absolute;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 600;
}

.bk-pdf-progress-bar-container {
  width: 180px;
  height: 3px;
  background: hsla(28, 20%, 40%, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.bk-pdf-progress-bar {
  width: 0%;
  height: 100%;
  background: var(--glow-color, #c89d7c);
  transition: width 0.4s var(--ease-smooth);
}

.bk-pdf-page-indicator {
  font-size: 0.75rem;
  font-family: var(--body-font);
  color: hsl(0, 0%, 33%);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* Premium Loading Overlay */
.bk-pdf-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: hsl(26, 32%, 12%);
  z-index: 5;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.4s var(--ease-smooth);
}

.bk-pdf-loading.bk-pdf-loaded {
  opacity: 0;
  pointer-events: none;
}

.bk-pdf-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid hsla(28, 100%, 50%, 0.259);
  border-radius: 50%;
  border-top-color: var(--glow-color);
  animation: bk-spin 0.9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.bk-pdf-loading span {
  font-size: 0.85rem;
  color: hsla(28, 20%, 80%, 0.8);
  letter-spacing: 0.05em;
  font-family: var(--body-font);
}

@keyframes bk-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsiveness */
@media (max-width: 768px) {
  .bk-pdf-backdrop {
    padding: 0.75rem;
  }

  .bk-pdf-modal {
    height: 88vh;
    border-radius: 12px;
  }

  .bk-pdf-header {
    padding: 1rem 1.25rem;
  }

  .bk-pdf-title {
    font-size: 1rem;
  }
}

/* ============================================================
   Fullscreen & Page Jump Upgrades
   ============================================================ */

/* Fullscreen Mode Backdrops & Modals */
.bk-pdf-backdrop.bk-fullscreen {
  padding: 0;
  background: #0d0905;
}

.bk-pdf-modal.bk-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: none;
  background: #0d0905;
  box-shadow: none;
  transform: none !important;
}

.bk-pdf-modal.bk-fullscreen .bk-pdf-header {
  display: none;
}

.bk-pdf-modal.bk-fullscreen .bk-pdf-body {
  background: #ffffff;
}



/* Floating controls in Fullscreen Mode */
.bk-pdf-fullscreen-controls {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 0.8rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-smooth);
}

.bk-pdf-modal.bk-fullscreen .bk-pdf-fullscreen-controls {
  opacity: 1;
  pointer-events: auto;
}

.bk-pdf-fs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid hsla(28, 35%, 50%, 0.25);
  background: hsla(28, 30%, 12%, 0.85);
  color: hsla(30, 35%, 85%, 0.85);
  cursor: pointer;
  transition: all 0.25s var(--ease-smooth);
  backdrop-filter: blur(10px);
  padding: 0;
}

.bk-pdf-fs-btn svg {
  width: 20px;
  height: 20px;
}

.bk-pdf-fs-btn:hover {
  background: var(--glow-color, #c89d7c);
  color: hsl(26, 32%, 12%);
  border-color: var(--glow-color, #c89d7c);
  box-shadow: 0 0 15px rgba(200, 157, 124, 0.4);
  transform: scale(1.05);
}

.bk-pdf-fs-close:hover {
  background: hsla(0, 60%, 45%, 0.85);
  border-color: hsla(0, 60%, 55%, 0.5);
  color: hsl(0, 65%, 90%);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

#bk-pdf-fs-tools {
  display: none;
}

/* Page Jump Controls */
.bk-pdf-indicator-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.bk-pdf-jump-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bk-pdf-jump-divider {
  color: hsla(30, 20%, 50%, 0.4);
  font-size: 0.85rem;
  user-select: none;
}

.bk-pdf-jump-input {
  width: 90px;
  height: 26px;
  background: hsla(0, 0%, 89%, 0.229);
  border: 1px solid hsla(28, 35%, 50%, 0.3);
  border-radius: 4px;
  color: black;
  font-family: var(--body-font);
  font-size: 0.75rem;
  text-align: center;
  padding: 0 4px;
  transition: all 0.25s var(--ease-smooth);
  outline: none;
}

.bk-pdf-jump-input:focus {
  border-color: var(--glow-color, #c89d7c);
  background: hsla(0, 0%, 100%, 0.8);
  box-shadow: 0 0 8px rgba(200, 157, 124, 0.3);
}

/* Hide HTML5 input number spinners */
.bk-pdf-jump-input::-webkit-outer-spin-button,
.bk-pdf-jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bk-pdf-jump-input {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* ============================================================
   Highlighter & Notes System Styles
   ============================================================ */

.bk-pdf-highlight-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  pointer-events: none;
}

/* Disable page click zones in selection mode to prevent accidental page turns */
.bk-pdf-modal.bk-selection-mode-on .bk-click-zone {
  pointer-events: none !important;
}

.bk-pdf-external-btn.active,
.bk-pdf-fs-btn.active {
  background: var(--glow-color, #c89d7c) !important;
  color: hsl(26, 32%, 12%) !important;
  border-color: var(--glow-color, #c89d7c) !important;
  box-shadow: 0 0 12px rgba(200, 157, 124, 0.5);
}

.bk-pdf-highlighter-colors {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: hsl(26, 25%, 15%);
  border: 1px solid hsla(28, 35%, 45%, 0.25);
  border-radius: 20px;
  padding: 6px 10px;
  display: flex;
  gap: 8px;
  z-index: 1300;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
}

.bk-pdf-highlighter-colors::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: hsla(28, 35%, 45%, 0.25);
}

.bk-pdf-highlighter-colors.fs {
  top: auto;
  bottom: calc(100% - 80px);
}

.bk-pdf-highlighter-colors.fs::before {
  bottom: auto;
  top: 100%;
  border-bottom-color: transparent;
  border-top-color: hsla(28, 35%, 45%, 0.25);
}

.color-select-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.25s var(--ease-smooth);
  box-sizing: border-box;
  display: block;
}

.color-select-btn:hover {
  transform: scale(1.2);
}

.color-select-btn.active {
  border-color: var(--white-color, white);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.color-select-btn.yellow {
  background-color: rgb(255, 235, 59);
  color: rgb(255, 235, 59);
}

.color-select-btn.green {
  background-color: rgb(76, 175, 80);
  color: rgb(76, 175, 80);
}

.color-select-btn.pink {
  background-color: rgb(244, 67, 54);
  color: rgb(244, 67, 54);
}

.color-select-btn.blue {
  background-color: rgb(33, 150, 243);
  color: rgb(33, 150, 243);
}

/* Float button for highlighting save */
.bk-pdf-save-now-float {
  position: absolute;
  z-index: 1500;
  background: var(--glow-color, #c89d7c);
  color: hsl(26, 32%, 12%);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto;
  transform: translate(4px, -18px);
}

.bk-pdf-save-now-float:hover {
  background: #d4ac8d;
  transform: translate(4px, -18px) scale(1.12);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
}

.bk-pdf-main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s var(--ease-smooth);
  width: 100%;
  height: 100%;
}

.bk-pdf-sidebar {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 320px;
  opacity: 0;
  pointer-events: none;
  background: hsl(26, 25%, 12%);
  border-left: 1px solid hsla(28, 35%, 45%, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease-smooth), opacity 0.3s var(--ease-smooth);
  z-index: 1200;
  overflow: hidden;
  height: 100%;
}

.bk-pdf-sidebar.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.bk-pdf-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid hsla(28, 35%, 45%, 0.1);
  background: hsl(26, 28%, 10%);
}

.bk-pdf-sidebar-header h4 {
  margin: 0;
  font-family: var(--serif-font);
  font-size: 1.05rem;
  color: var(--white-color);
  font-weight: 600;
}

.bk-pdf-sidebar-close {
  background: none;
  border: none;
  color: hsla(30, 35%, 80%, 0.7);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.bk-pdf-sidebar-close svg {
  width: 16px;
  height: 16px;
}

.bk-pdf-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--white-color);
}

.bk-pdf-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bk-pdf-sidebar-category-title {
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--glow-color, #c89d7c);
  margin: 1rem 0 0.4rem 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px dashed rgba(200, 157, 124, 0.2);
  font-weight: 700;
  font-family: var(--body-font);
}

.bk-pdf-no-notes {
  color: hsla(28, 15%, 65%, 0.5);
  font-family: var(--body-font);
  font-size: 0.825rem;
  text-align: center;
  line-height: 1.5;
  margin-top: 2rem;
  padding: 0 1rem;
}

.bk-pdf-note-item {
  background: hsla(28, 20%, 15%, 0.7);
  border: 1px solid hsla(28, 35%, 45%, 0.15);
  border-left: 4px solid var(--note-border-color, var(--glow-color));
  border-radius: 6px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.25s var(--ease-smooth);
}

.bk-pdf-note-item:hover {
  background: hsla(28, 20%, 18%, 0.95);
  border-color: hsla(28, 35%, 45%, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bk-pdf-note-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.bk-pdf-note-page-label {
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--glow-color, #c89d7c);
  letter-spacing: 0.05em;
}

.bk-pdf-note-delete-btn {
  background: none;
  border: none;
  color: hsla(0, 50%, 65%, 0.6);
  cursor: pointer;
  padding: 0.15rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
}

.bk-pdf-note-delete-btn svg {
  width: 14px;
  height: 14px;
}

.bk-pdf-note-delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ff6b6b;
}

.bk-pdf-note-text {
  font-size: 0.825rem;
  color: hsla(28, 15%, 85%, 0.9);
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
  font-family: var(--body-font);
}

.bk-pdf-note-text.empty-note {
  font-style: italic;
  color: hsla(28, 15%, 85%, 0.4);
}

.bk-pdf-notes-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ff5252;
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  height: 16px;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid hsl(26, 32%, 15%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.bk-pdf-note-modal {
  position: absolute;
  inset: 0;
  background: rgba(10, 7, 5, 0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bk-pdf-note-modal.open {
  display: flex;
  opacity: 1;
}

.bk-pdf-note-modal-card {
  background: hsl(26, 25%, 15%);
  border: 1px solid hsla(28, 35%, 45%, 0.25);
  border-radius: 12px;
  width: 100%;
  max-width: 380px;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s var(--ease-smooth);
}

.bk-pdf-note-modal.open .bk-pdf-note-modal-card {
  transform: translateY(0) scale(1);
}

.bk-pdf-note-modal-card h4 {
  margin: 0 0 1rem 0;
  font-family: var(--serif-font);
  font-size: 1.15rem;
  color: var(--white-color);
}

.bk-pdf-note-modal-card textarea {
  width: 100%;
  height: 90px;
  background: hsla(28, 20%, 8%, 0.6);
  border: 1px solid hsla(28, 35%, 50%, 0.25);
  border-radius: 6px;
  color: var(--white-color);
  font-family: var(--body-font);
  font-size: 0.85rem;
  padding: 0.75rem;
  outline: none;
  resize: none;
  margin-bottom: 1rem;
  box-sizing: border-box;
  transition: border-color 0.25s ease;
}

.bk-pdf-note-modal-card textarea:focus {
  border-color: var(--glow-color, #c89d7c);
  box-shadow: 0 0 8px rgba(200, 157, 124, 0.25);
}

.bk-pdf-color-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.color-picker-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: hsla(28, 20%, 75%, 0.7);
  letter-spacing: 0.05em;
  font-family: var(--body-font);
}

.color-options {
  display: flex;
  gap: 0.6rem;
}

.color-option-item {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-block;
}

.color-option-item input {
  opacity: 0;
  position: absolute;
  cursor: pointer;
}

.color-dot-indicator {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: var(--hl-color);
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.color-option-item:hover .color-dot-indicator {
  transform: scale(1.15);
}

.color-option-item.active .color-dot-indicator {
  border-color: var(--white-color);
  transform: scale(1.1);
  box-shadow: 0 0 8px var(--hl-color);
}

.bk-pdf-note-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.bk-pdf-note-modal-actions button {
  padding: 0.55rem 1.15rem;
  border-radius: 6px;
  font-family: var(--body-font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.bk-pdf-note-modal-actions .btn-cancel {
  background: transparent;
  border-color: hsla(28, 35%, 50%, 0.2);
  color: hsla(30, 35%, 80%, 0.75);
}

.bk-pdf-note-modal-actions .btn-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--white-color);
}

.bk-pdf-note-modal-actions .btn-save {
  background: var(--glow-color, #c89d7c);
  color: hsl(26, 32%, 12%);
}

.bk-pdf-note-modal-actions .btn-save:hover {
  background: #d4ac8d;
  box-shadow: 0 0 10px rgba(200, 157, 124, 0.3);
}

@keyframes bk-flash-highlight {
  0% {
    opacity: 0.3;
  }

  50% {
    opacity: 0.9;
    transform: scale(1.02);
  }

  100% {
    opacity: 0.45;
  }
}

.bk-highlight-flash {
  animation: bk-flash-highlight 1.5s ease-in-out 2;
}

@media (max-width: 768px) {
  .bk-pdf-sidebar {
    width: 100% !important;
    max-width: none;
    border-left: none;
  }
}

/* ============================================================
   Page Bookmark Ribbon & Active Button Styles
   ============================================================ */
.bk-pdf-external-btn#bk-pdf-bookmark.active,
.bk-pdf-fs-btn#bk-pdf-fs-bookmark.active {
  color: var(--glow-color, #c89d7c);
  border-color: var(--glow-color, #c89d7c);
  background: hsla(28, 45%, 38%, 0.2);
}

.bk-pdf-external-btn#bk-pdf-bookmark.active svg,
.bk-pdf-fs-btn#bk-pdf-fs-bookmark.active svg {
  fill: var(--glow-color, #c89d7c);
}

.bk-pdf-bookmark-ribbon {
  position: absolute;
  z-index: 100;
  width: 14px;
  background: linear-gradient(to right, #d13b4f 0%, #a62c3f 30%, #801b28 75%, #59101b 100%);
  box-shadow: 2px 3px 7px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% calc(100% - 5px), 0% 100%);
  transform-origin: top center;
  transform: translateX(-50%);
  transition: transform 0.25s ease, filter 0.25s ease, box-shadow 0.25s ease;
  pointer-events: auto;
}

.bk-pdf-bookmark-ribbon:hover {
  transform: translateX(-50%) scaleY(1.04);
  filter: brightness(1.12);
  box-shadow: 3px 5px 10px rgba(0, 0, 0, 0.45);
}

.bk-pdf-bookmark-ribbon::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.3);
}

/* Hide ribbon instantly when page is turning */
.bk-book.flipping~.bk-pdf-bookmark-ribbon {
  display: none !important;
}

/* Hide floating elements when PDF Modal is open */
body:has(#bk-pdf-backdrop.bk-pdf-open) .category-float-btn,
body:has(#bk-pdf-backdrop.bk-pdf-open) #floatingCartBtn,
body:has(#bk-pdf-backdrop.bk-pdf-open) #floatingLibraryBtn {
  display: none !important;
}

@media (max-width: 1000px) {
  .bk-book-container {
    padding: 0rem 7rem;
  }
}

@media (max-width: 800px) {
  .bk-book-container {
    padding: 0rem 4rem;
  }
}


/* ============================================================
   Mobile Adjustments for screens < 600px
   ============================================================ */
@media (max-width: 700px) {
  .bk-pdf-backdrop {
    padding: 0;
  }

  .bk-pdf-modal {
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }

  /* Compact Header */
  .bk-pdf-header {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .bk-pdf-header-left {
    gap: 0.5rem;
  }

  .bk-pdf-icon {
    display: none !important;
  }

  .bk-pdf-subtitle {
    display: none !important;
  }

  .bk-pdf-title {
    font-size: 0.9rem;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bk-pdf-header-right {
    gap: 0.4rem;
  }

  /* Compact Controls */
  .bk-pdf-external-btn,
  .bk-pdf-close {
    width: 32px;
    height: 32px;
  }

  .bk-pdf-external-btn svg,
  .bk-pdf-close svg {
    width: 14px;
    height: 14px;
  }

  /* 3D Book Layout Mobile Sizing */
  .bk-book-container {
    padding: 0 1.5rem;
    padding-bottom: 4.5rem;
    /* Room for page indicator/progress footer */
  }

  /* Navigation Buttons */
  .bk-book-container .bk-nav-btn {
    width: 32px;
    height: 32px;
    background: hsla(28, 30%, 12%, 0.75);
  }

  .bk-book-container .bk-nav-btn svg {
    width: 16px;
    height: 16px;
  }

  .bk-nav-prev {
    left: 0.25rem;
  }

  .bk-nav-next {
    right: 0.25rem;
  }

  /* Progress & Footer */
  .bk-pdf-footer {
    bottom: 0.75rem;
    gap: 0.35rem;
  }

  .bk-pdf-progress-bar-container {
    width: 120px;
    height: 2px;
  }

  .bk-pdf-page-indicator {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
  }

  .bk-pdf-jump-group {
    gap: 0.35rem;
  }

  .bk-pdf-jump-input {
    width: 65px;
    height: 22px;
    font-size: 0.7rem;
  }

  .bk-pdf-jump-divider {
    font-size: 0.7rem;
  }

  /* Hide Page stacks on small screens to maximize canvas space */
  .bk-page-stack {
    display: none !important;
  }

  /* Floating controls in Fullscreen Mode */
  .bk-pdf-fullscreen-controls {
    top: 0.5rem;
    right: 0.5rem;
    gap: 0.4rem;
  }

  .bk-pdf-fs-btn {
    width: 32px;
    height: 32px;
  }

  .bk-pdf-fs-btn svg {
    width: 16px;
    height: 16px;
  }

  /* Highlight/Note Modals */
  .bk-pdf-note-modal {
    padding: 0.75rem;
  }

  .bk-pdf-note-modal-card {
    padding: 1rem;
    max-width: 95%;
  }

  .bk-pdf-note-modal-card h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .bk-pdf-note-modal-card textarea {
    height: 70px;
    font-size: 0.8rem;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .bk-pdf-category-selection {
    gap: 4px !important;
    margin-bottom: 8px !important;
  }

  .bk-pdf-category-selection label {
    font-size: 0.75rem !important;
  }

  .bk-pdf-category-selection select,
  .bk-pdf-category-selection input {
    padding: 6px !important;
    font-size: 0.8rem !important;
  }

  .bk-pdf-color-selection {
    margin-bottom: 1rem;
  }

  .color-picker-label {
    font-size: 0.7rem;
  }

  .color-option-item {
    width: 20px;
    height: 20px;
  }

  .bk-pdf-note-modal-actions {
    gap: 0.5rem;
  }

  .bk-pdf-note-modal-actions button {
    padding: 0.45rem 0.95rem;
    font-size: 0.75rem;
  }
}

/* Rotate book in landscape mode when screen width < 450px */
@media (max-width: 450px) {
  .bk-pdf-body {
    container-type: size;
  }

  .bk-pdf-main-content {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100dvh - 48px);
    height: 100vw;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
  }

  /* Sidebar matching the rotated landscape book */
  .bk-pdf-sidebar {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: calc(100dvh - 48px) !important;
    height: 100vw !important;
    transform: translate(-50%, -50%) rotate(90deg) translateX(100%) !important;
    transform-origin: center center !important;
    max-width: none !important;
    border-left: none !important;
    border-top: 1px solid hsla(28, 35%, 45%, 0.15) !important;
    transition: transform 0.3s var(--ease-smooth), opacity 0.3s var(--ease-smooth) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: 1300 !important;
  }

  .bk-pdf-sidebar.open {
    transform: translate(-50%, -50%) rotate(90deg) translateX(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Note Modal matching the rotated landscape book */
  .bk-pdf-note-modal {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: calc(100dvh - 48px) !important;
    height: 100vw !important;
    transform: translate(-50%, -50%) rotate(90deg) !important;
    transform-origin: center center !important;
    inset: auto !important;
    z-index: 2100 !important;
  }

  .bk-book-container {
    padding: 0 8rem;
  }

  .bk-pdf-bookmark-ribbon {
    width: 10px !important;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% calc(100% - 4px), 0% 100%) !important;
  }

  .bk-click-zone {
    width: 48%;
  }

  /* Fullscreen controls extension menu for mobile */
  #bk-pdf-fs-tools {
    display: inline-flex !important;
  }

  /* Micro-animation for Tools button when active */
  #bk-pdf-fs-tools.active svg {
    transform: rotate(90deg) !important;
  }

  #bk-pdf-fs-tools svg {
    transition: transform 0.3s ease !important;
  }

  /* Transition properties for collapsible buttons */
  .bk-pdf-fullscreen-controls>*:not(#bk-pdf-fs-exit):not(#bk-pdf-fs-tools) {
    width: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-width: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  /* When expanded, reveal and size them */
  .bk-pdf-fullscreen-controls.bk-expanded>*:not(#bk-pdf-fs-exit):not(#bk-pdf-fs-tools) {
    width: 32px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    border-width: 1px !important;
  }

  /* Highlighter wrapper special handling */
  .bk-pdf-fullscreen-controls>.bk-pdf-highlighter-wrapper {
    width: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    pointer-events: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .bk-pdf-fullscreen-controls.bk-expanded>.bk-pdf-highlighter-wrapper {
    width: 32px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .bk-pdf-fullscreen-controls>.bk-pdf-highlighter-wrapper>.bk-pdf-fs-btn {
    width: 0 !important;
    opacity: 0 !important;
    border-width: 0 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .bk-pdf-fullscreen-controls.bk-expanded>.bk-pdf-highlighter-wrapper>.bk-pdf-fs-btn {
    width: 32px !important;
    opacity: 1 !important;
    border-width: 1px !important;
  }

  /* Ensure the container transitions layout correctly */
  .bk-pdf-fullscreen-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .bk-pdf-footer {
    bottom: auto;
    top: -0.27rem;
  }

  .bk-pdf-jump-input {
    height: 18px;
    font-size: 0.6rem;
  }
}



@supports (width: 1cqh) {
  @media (max-width: 450px) {
    .bk-pdf-main-content {
      width: 100cqh;
      height: 100cqw;
    }
  }
}

@media (max-width: 430px) {
  .bk-book-container {
    padding: 0 9rem;
  }
}

/* ============================================================
   Interactive Zoom and Pan Upgrades (Fullscreen Mode Only)
   ============================================================ */
.bk-book-zoom-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  pointer-events: auto;
}

.bk-book-zoom-wrapper.bk-animate-zoom {
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.bk-book-container.bk-zoomed .bk-click-zone {
  display: none !important;
}

/* ============================================================
   Highlighted Text Note Quotes & Modal Previews
   ============================================================ */
.bk-pdf-note-quote {
  font-size: 0.775rem;
  font-style: italic;
  color: hsla(28, 10%, 85%, 0.85);
  background: hsla(28, 30%, 8%, 0.5);
  border-left: 3px solid var(--glow-color, #c89d7c);
  padding: 8px 12px;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  line-height: 1.45;
  font-family: var(--body-font);
  word-wrap: break-word;
  white-space: pre-wrap;
}

#bk-pdf-note-text-preview {
  font-size: 0.825rem;
  font-style: italic;
  background: hsla(28, 30%, 8%, 0.55);
  border-left: 3px solid var(--glow-color, #c89d7c);
  padding: 10px 14px;
  margin-bottom: 1rem;
  max-height: 120px;
  overflow-y: auto;
  color: hsla(0, 0%, 90%, 0.95);
  border-radius: 6px;
  font-family: var(--body-font);
  line-height: 1.45;
  box-sizing: border-box;
}

/* ============================================================
   PDF.js Text Layer Overlay for Selection
   ============================================================ */
.textLayer {
  position: absolute;
  overflow: hidden;
  opacity: 1.0;
  line-height: 1.0;
  z-index: 3;
  pointer-events: none;
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  -webkit-text-size-adjust: none;
  -moz-text-size-adjust: none;
  text-size-adjust: none;
  transform-origin: 0 0;
}

.bk-selection-mode-on .textLayer {
  pointer-events: auto;
}

.bk-pdf-highlight-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.textLayer>span {
  color: transparent !important;
  position: absolute;
  white-space: pre;
  cursor: text !important;
  transform-origin: 0% 0%;
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
}

::selection {
  background: rgba(200, 157, 124, 0.4) !important;
}

::-moz-selection {
  background: rgba(200, 157, 124, 0.4) !important;
}

/* ============================================================
   Text Selection Toggle Buttons Active States
   ============================================================ */
.bk-pdf-external-btn#bk-pdf-selection-toggle.active,
.bk-pdf-fs-btn#bk-pdf-fs-selection-toggle.active {
  color: var(--glow-color, #c89d7c) !important;
  border-color: var(--glow-color, #c89d7c) !important;
  background: hsl(27, 100%, 14%) !important;
  box-shadow: 0 0 10px rgba(200, 157, 124, 0.45) !important;
}

/* ============================================================
   Category Dropdown Selector
   ============================================================ */
.bk-pdf-category-dropdown {
  position: relative;
  width: 100%;
  margin-bottom: 1.25rem;
}

.bk-pdf-category-dropdown-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.1rem;
  background: hsl(26, 25%, 12%);
  border: 1px solid hsla(28, 35%, 45%, 0.25);
  border-radius: 8px;
  color: var(--white-color, white);
  font-family: var(--body-font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.25s var(--ease-smooth, ease);
}

.bk-pdf-category-dropdown-trigger:hover,
.bk-pdf-category-dropdown-trigger:focus {
  border-color: var(--glow-color, #c89d7c);
  background: hsl(26, 25%, 15%);
  box-shadow: 0 0 10px rgba(200, 157, 124, 0.15);
}

.bk-pdf-category-dropdown-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bk-pdf-dropdown-arrow {
  width: 16px;
  height: 16px;
  color: var(--glow-color, #c89d7c);
  transition: transform 0.3s ease;
}

.bk-pdf-category-dropdown.open .bk-pdf-category-dropdown-trigger {
  border-color: var(--glow-color, #c89d7c);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.bk-pdf-category-dropdown.open .bk-pdf-dropdown-arrow {
  transform: rotate(180deg);
}

.bk-pdf-category-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: hsl(26, 25%, 10%);
  border: 1px solid var(--glow-color, #c89d7c);
  border-top: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.bk-pdf-category-dropdown.open .bk-pdf-category-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.bk-pdf-category-dropdown-item {
  padding: 0.75rem 1.1rem;
  color: hsla(30, 35%, 85%, 0.85);
  font-family: var(--body-font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bk-pdf-category-dropdown-item:hover {
  background: hsla(28, 35%, 45%, 0.2);
  color: var(--white-color, white);
}

.bk-pdf-category-dropdown-item.active {
  background: hsla(28, 35%, 45%, 0.35);
  color: var(--glow-color, #c89d7c);
  font-weight: 600;
}

.bk-pdf-category-dropdown-item-count {
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 10px;
  color: hsla(30, 35%, 80%, 0.6);
}

/* ============================================================
   View Note Modal Styles
   ============================================================ */
.bk-pdf-view-note-modal-card {
  max-width: 440px !important;
}

.bk-pdf-view-note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid hsla(28, 35%, 45%, 0.2);
}

.bk-pdf-view-note-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--glow-color, #c89d7c);
  font-weight: 700;
  font-family: var(--body-font);
}

.bk-pdf-view-note-page {
  font-size: 0.75rem;
  color: hsla(30, 35%, 80%, 0.6);
  font-family: var(--body-font);
  font-weight: 500;
}

.bk-pdf-view-note-body {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.bk-pdf-view-note-body::-webkit-scrollbar {
  width: 4px;
}

.bk-pdf-view-note-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.bk-pdf-view-note-body::-webkit-scrollbar-thumb {
  background: hsla(28, 35%, 45%, 0.3);
  border-radius: 2px;
}

.bk-pdf-view-note-quote-container {
  position: relative;
  background: hsla(28, 20%, 8%, 0.4);
  border-left: 3px solid var(--note-border-color, var(--glow-color));
  padding: 0.85rem 1rem 0.85rem 1.75rem;
  border-radius: 4px;
}

.bk-pdf-view-note-quote-container .quote-mark {
  position: absolute;
  left: 0.5rem;
  top: 0.25rem;
  font-family: var(--serif-font);
  font-size: 2.25rem;
  color: var(--note-border-color, hsla(28, 35%, 45%, 0.25));
  line-height: 1;
  user-select: none;
  opacity: 0.3;
}

.bk-pdf-view-note-quote {
  margin: 0;
  font-family: var(--serif-font);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--white-color, white);
}

.bk-pdf-view-note-text-container {
  padding: 0 0.5rem;
}

.bk-pdf-view-note-text {
  margin: 0;
  font-family: var(--body-font);
  font-size: 0.9rem;
  line-height: 1.5;
  color: hsla(30, 35%, 85%, 0.85);
  white-space: pre-wrap;
}

.bk-pdf-view-note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  align-items: center;
  border-top: 1px solid hsla(28, 35%, 45%, 0.15);
  padding-top: 1rem;
}

.btn-delete-hl {
  margin-right: auto;
  background: transparent;
  border: 1px solid transparent;
  color: hsla(0, 50%, 65%, 0.7);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 0.85rem;
  font-size: 0.8rem;
  font-family: var(--body-font);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.25s ease;
}

.btn-delete-hl svg {
  width: 14px;
  height: 14px;
}

.btn-delete-hl:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ff6b6b;
  border-color: rgba(239, 68, 68, 0.25);
}

.btn-see-in-book {
  background: var(--glow-color, #c89d7c);
  color: hsl(26, 32%, 12%);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(200, 157, 124, 0.2);
}

.btn-see-in-book:hover {
  background: #d4ac8d;
  box-shadow: 0 4px 12px rgba(200, 157, 124, 0.4);
  transform: translateY(-1px);
}

.btn-see-in-book svg {
  transition: transform 0.2s ease;
}

.btn-see-in-book:hover svg {
  transform: translateX(3px);
}

/* ============================================================
   Line Clamping for Sidebar Note Items
   ============================================================ */
.bk-pdf-note-item .bk-pdf-note-quote {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.bk-pdf-note-item .bk-pdf-note-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}