/* Контейнер документа */
#tech_docs {
  margin: 0;
  font-family: sans-serif;
  background: #eaeaea;
  position: relative;
  height: 100vh;
  overflow: auto; /* вертикальный и горизонтальный скролл */
}

/* Миниатюры */
#tech_docs #thumbnails {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 8.333333%;
  background: #f0f0f0;
  overflow-y: auto;
  border-right: 1px solid #ccc;
  padding: 10px;
  z-index: 999;
  max-width: 100%;
}

.thumbnail-wrapper {
  margin-bottom: 10px;
  text-align: center;
  font-size: 13px;
  color: #333;
}

.thumbnail-wrapper img {
  width: 100%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border 0.2s ease;
}

.thumbnail-wrapper img:hover {
  border: 2px solid #007bff;
}

.thumbnail-wrapper img.active {
  border: 2px solid #ff5722;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

/* Центральная колонка (обязательно с id="docCol") */
#docCol {
  position: relative;
}

/* Панель навигации внутри центральной колонки */
#docCol #viewerNav {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 5;
  background: #f9f9f9;
  border-bottom: 1px solid #ccc;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

#docCol #viewerNav button,
#docCol #viewerNav input {
  font-size: 16px;
  padding: 6px 10px;
}

/* Область просмотра документа */
.doc-wrapper {
  position: relative;
}

.scroll-wrapper {
  margin-top: 80px; /* отступ под панелью навигации */
  overflow-x: auto;
  overflow-y: visible;
  scroll-behavior: smooth;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Контент документа: ширина определяется содержимым,
   поэтому при сильном зуме появляется горизонтальный скролл */
#docViewer {
  width: max-content;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Страницы */
.shadow-host {
  background: #fff;
  border: 1px solid #ccc;
  margin-bottom: 20px;
  overflow: hidden;
  position: relative;
}

.page-content {
  width: auto;
  max-width: none;
}

.page-wrapper {
  display: flex;
  justify-content: center;
}

/* Подсветка найденного */
#tech_docs mark {
  background: yellow;
  color: inherit;
  font-weight: inherit;
  font-style: inherit;
  padding: 0;
  margin: 0;
  border: none;
}

/* Печать */
@media print {
  #tech_docs #viewerNav,
  #tech_docs #thumbnails {
    display: none !important;
  }
  #tech_docs #docViewer {
    margin: 0;
    max-width: none;
    padding: 0;
  }
}

/* Фильтрация миниатюр */
#thumbnails.filtered .thumbnail-wrapper {
  display: none;
}
#thumbnails.filtered .thumbnail-wrapper.matched {
  display: block;
}

/* Анимация кнопки */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

#sendRequestNav.show-notification {
  animation: pulse 1.5s ease-in-out;
  position: relative;
}

/* Подсказка */
#sendRequestNav::after {
  content: "Готово к отправке!";
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
  pointer-events: none;
}

#sendRequestNav:hover::after {
  opacity: 1;
}

#docCol #viewerNav {
  position: relative;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: #f9f9f9;
  border-bottom: 1px solid #ccc;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

#docCol .doc-wrapper{
background: #E0E0E0;
}

#tech_docs {
  margin: 0;
  font-family: sans-serif;
  background: #eaeaea;
  position: relative;
  height: 100%;
  overflow: visible;
}

#viewerNav.is-fixed {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1030;
  width: 100%;
  background: #343a40;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#tech_docs:fullscreen {
  height: 100vh;
  overflow: auto;
  background: white;
}

#viewerNav.is-fixed.fullscreen {
  top: 0 !important;
}