/* Document viewer fixes for duplicate headers and scrollbars */

/* Hide all WebViewer built-in headers and toolbars */
.HeaderItems,
.Header,
.ToolbarHeader,
.LeftHeader,
.MiddleHeader,
.RightHeader,
.ModularHeader,
.ModularHeaderContainer,
.TabsHeader,
.HeaderToolsContainer,
div[data-element="header"],
div[data-element="modularHeader"],
div[data-element="toolsHeader"],
div[data-element="documentHeader"],
div[data-element="headerItems"],
div[data-element="leftHeader"],
div[data-element="middleHeader"],
div[data-element="rightHeader"],
.ModularHeader > *,
.Header > *,
/* Target dark DATOS DRIVE logo specifically */
.Header img[alt="DATOS DRIVE"],
.ModularHeader img[alt="DATOS DRIVE"],
.Header .logo,
.ModularHeader .logo,
/* Target Dashboard text - using more generic selectors since :contains is not standard */
.MiddleHeader,
.MiddleHeader > div,
.MiddleHeader > span,
div[data-element="middleHeader"] span,
div[data-element="headerItems"] span,
div[data-element="modularHeader"] span {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  max-height: 0 !important;
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  z-index: -9999 !important;
}

/* Fix document container position */
.DocumentContainer {
  top: 0 !important;
  height: 100% !important;
}

/* Ensure PDF content is properly displayed */
.Document {
  padding-top: 0 !important;
}

/* Hide extra scrollbars */
.scrollbar-container, 
.custom-scrollbar-container {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.scrollbar-container::-webkit-scrollbar, 
.custom-scrollbar-container::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Make sure our annotations always appear above PDF contents */
.draggable-annotation,
.signature-field,
.text-field,
.date-field,
.checkbox-field {
  z-index: 9999 !important;
  position: absolute !important;
  pointer-events: auto !important;
}

/* PDF container and canvas positioning */
#pdf-container {
  position: relative !important;
}

#pdf-container canvas {
  z-index: 1 !important;
}

/* Force-hide any remaining toolbars or headers */
[class*="header-"],
[class*="toolbar-"],
[class*="Header"],
[class*="Toolbar"] {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Specific targeting for the header with dark DATOS DRIVE logo and Dashboard text */
div.Header,
div.ModularHeader,
.HeaderItems,
.LeftHeader,
.MiddleHeader,
.RightHeader {
  position: absolute !important;
  height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  overflow: hidden !important;
  display: none !important;
  transform: translateY(-1000px) !important;
  z-index: -9999 !important;
}

/* Target specific WebViewer UI elements by their appearance */
.Header img,
.ModularHeader img,
.LeftHeader img,
.Header [class*="logo"],
.ModularHeader [class*="logo"],
.LeftHeader [class*="logo"] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Target the Dashboard text specifically */
.MiddleHeader div,
.MiddleHeader span,
div[data-element="middleHeader"] > *,
*[class*="middle"] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  /* Even more aggressive hiding of UI elements on mobile */
  .HeaderItems,
  .Header,
  .ToolbarHeader,
  .LeftHeader,
  .MiddleHeader,
  .RightHeader,
  .ModularHeader,
  .ModularHeaderContainer,
  .TabsHeader,
  .HeaderToolsContainer,
  [class*="header-"],
  [class*="toolbar-"],
  [class*="Header"],
  [class*="Toolbar"] {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
}