/* StPageFlip Engine Styles for akula2 */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0b0f19;
}

.akula2-viewport {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #171d2b 0%, #080b12 100%);
  user-select: none;
}

.top-nav-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 99999;
  display: flex;
  gap: 10px;
  align-items: center;
}

@media (max-width: 768px) {
  .top-nav-bar {
    display: none; /* На мобильных убираем длинные кнопки перехода, чтобы верхняя панель управления была свободна */
  }
}

.btn-back-home {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-back-home:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.flipbook-stage {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 60px;
  overflow: visible;
}

#flipbook {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  touch-action: none;
}

.page-sheet {
  background-color: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-sheet img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  pointer-events: none;
}

/* Верхняя фиксированная панель управления (все иконки) */
.flip-controls-bar {
  position: fixed !important;
  top: 12px !important;
  bottom: auto !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 999999 !important; /* Всегда поверх всех окон */
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 36px !important;
  padding: 6px 14px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7) !important;
}

.flip-btn {
  background: none !important;
  border: none !important;
  color: #f1f5f9 !important;
  font-size: 19px !important;
  cursor: pointer !important;
  padding: 6px 10px !important;
  border-radius: 50% !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

.flip-btn:hover {
  color: #38bdf8 !important;
  background: rgba(255, 255, 255, 0.15) !important;
}

.flip-btn:active {
  transform: scale(0.92);
}

.page-counter {
  color: #94a3b8 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  min-width: 60px !important;
  text-align: center !important;
  font-variant-numeric: tabular-nums !important;
}

/* Модальное окно миниатюр для akula2 */
.thumbs-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(15px);
  z-index: 999990; /* Ниже тулбара, чтобы навигация оставалась видимой */
  overflow-y: auto;
  padding: 60px 20px 80px 20px;
}

.thumbs-modal.open {
  display: block;
}

.thumbs-close {
  position: fixed;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100001;
}

.thumbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.thumb-item {
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.2s;
  background: #1e293b;
  text-align: center;
}

.thumb-item:hover, .thumb-item.active {
  border-color: #38bdf8;
  transform: scale(1.05);
}

.thumb-item img {
  width: 100%;
  height: auto;
  display: block;
}

.thumb-item span {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  padding: 4px;
}
