/* PDF Bookmarks Editor Styles */

.pdf-bookmarks-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e293b;
}

/* Theme Default Upload Box */
.pbe-landing-upload {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex-direction: column;
  padding: 40px 20px;
}

.pbe-landing-upload .Container {
  position: relative;
  width: 100%;
  max-width: 600px;
  background: transparent;
  padding: 20px;
  margin: 0 auto;
}

.pbe-landing-upload .innerContent {
  width: 100%;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.pbe-landing-upload .innerContent:hover,
.pbe-landing-upload .innerContent.dragover,
.pdf-upload-zone:hover,
.pdf-upload-zone.dragover {
  border-color: #3e3ef4;
  background: #eff6ff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(62, 62, 244, 0.12);
}

.pbe-upload-label-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  margin-bottom: 0;
}

.pbe-landing-upload .InputBox {
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #3e3ef4;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(62, 62, 244, 0.25);
  transition: all 0.2s ease;
}

.pbe-landing-upload .InputBox:hover {
  background: #2b2bd9;
  transform: scale(1.02);
}

.pbe-landing-upload .InputButton {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
}

.pbe-landing-upload .Information {
  margin-top: 16px;
  color: #64748b;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 0;
}

.pdf-btn-primary {
  background-color: #3e3ef4;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s, transform 0.1s;
}

.pdf-btn-primary:hover {
  background-color: #2b2bd9;
}

.pdf-btn-secondary {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.pdf-btn-secondary:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.pdf-btn-danger {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.pdf-btn-danger:hover {
  background-color: #fecaca;
}

.pdf-btn-success {
  background-color: #10b981;
  color: #ffffff;
}

.pdf-btn-success:hover {
  background-color: #059669;
}

/* Full-Page Workspace Overlay Layout */
#pbe-workspace-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99900;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.pbe-full-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: #ffffff;
  border-bottom: 1px solid #cbd5e1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  flex-wrap: wrap;
  gap: 12px;
  z-index: 10;
}

.pbe-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.pbe-brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.pbe-brand-title svg {
  color: #3e3ef4;
}

.pbe-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pbe-workspace {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 16px;
  overflow: hidden;
  box-sizing: border-box;
  margin-top: 0;
}

@media (max-width: 900px) {
  .pbe-workspace {
    flex-direction: column;
    overflow-y: auto;
  }
}

/* Left Pane: Outline Editor */
.pbe-editor-pane {
  flex: 1;
  max-width: 480px;
  min-width: 320px;
  height: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.pbe-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.pbe-pane-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pbe-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Tree Container */
.pbe-tree-container {
  max-height: 650px;
  overflow-y: auto;
  padding-right: 4px;
}

.pbe-tree-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.pbe-tree-list .pbe-tree-list {
  padding-left: 24px;
  border-left: 2px dashed #cbd5e1;
  margin-top: 6px;
  margin-bottom: 6px;
}

/* Tree Item */
.pbe-tree-item {
  margin-bottom: 8px;
}

.pbe-item-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  transition: all 0.15s ease-in-out;
}

.pbe-item-card:hover {
  border-color: #3e3ef4;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(62, 62, 244, 0.08);
}

.pbe-item-card.active {
  border-color: #3e3ef4;
  background: #eff6ff;
}

.pbe-item-card.dragging {
  opacity: 0.5;
  border-style: dashed;
}

.pbe-drag-handle {
  cursor: grab;
  color: #94a3b8;
  padding: 4px;
  user-select: none;
}

.pbe-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  font-size: 12px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.pbe-toggle-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.pbe-input-title {
  flex: 1;
  min-width: 140px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  color: #0f172a;
  outline: none;
}

.pbe-input-title:focus {
  border-color: #3e3ef4;
  box-shadow: 0 0 0 2px rgba(62, 62, 244, 0.15);
}

.pbe-page-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.pbe-input-page {
  width: 55px;
  padding: 6px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  color: #0f172a;
  outline: none;
}

.pbe-input-page:focus {
  border-color: #3e3ef4;
}

.pbe-item-actions {
  display: flex;
  gap: 4px;
}

.pbe-action-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.pbe-action-icon-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.pbe-action-icon-btn.delete:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Empty Tree State */
.pbe-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}

/* Right Pane: PDF Viewer */
.pbe-viewer-pane {
  flex: 1.1;
  min-width: 340px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.pbe-viewer-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.pbe-page-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.pbe-viewport-container {
  flex: 1;
  min-height: 500px;
  max-height: 700px;
  overflow: auto;
  background: #334155;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.pbe-canvas-wrapper {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
}

#pdf-preview-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Header & Export Bar */
.pbe-footer-bar {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.pbe-doc-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: #1e293b;
}

.pbe-doc-name {
  font-size: 15px;
  color: #0f172a;
}

.pbe-badge {
  background: #e0e7ff;
  color: #3730a3;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}

/* Spinner Overlay */
.pbe-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #ffffff;
}

.pbe-spinner {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: pbe-spin 0.8s ease-in-out infinite;
  margin-bottom: 16px;
}

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

/* Non-Overlapping Left & Right Sidebar Ads Layout */
.appscms-sidebar-left,
.appscms-sidebar-right,
.appscms-left-sidebar,
.appscms-right-sidebar {
  z-index: 100000 !important;
}

@media (min-width: 1400px) {
  #pbe-workspace-section {
    padding-left: 230px;
    padding-right: 230px;
    transition: padding 0.2s ease;
  }
}

@media (max-width: 1399px) {
  #pbe-workspace-section {
    padding-left: 0;
    padding-right: 0;
  }
  .appscms-sidebar-left,
  .appscms-sidebar-right,
  .appscms-left-sidebar,
  .appscms-right-sidebar {
    display: none !important;
  }
}
