/* ===========================================
   FLIPBOOK VIEWER — Styles (StPageFlip)
   Domain: publishing.artquamanima.com
   =========================================== */

/* ---- Viewer Shell ---- */
.fb-viewer {
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  height: 85vh;
  max-height: 900px;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
}

.fb-viewer.fb-fullscreen {
  height: 100vh;
  max-height: none;
  border-radius: 0;
}

/* ---- Toolbar ---- */
.fb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 1rem;
  background: #111;
  border-bottom: 1px solid #333;
  min-height: 32px;
  flex-shrink: 0;
}

.fb-title {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
}

.fb-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.fb-page-info {
  font-size: 0.75rem;
  color: #999;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.fb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.fb-btn:hover {
  background: #333;
  color: #fff;
}

/* ---- Spread Area ---- */
.fb-spread {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* ---- StPageFlip Container ---- */
.fb-flipbook-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0.5rem 0;
  position: relative;
}

/* ---- Page Elements (inside StPageFlip) ---- */
.fb-page {
  background: #fff;
  overflow: hidden;
}

.fb-page-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

/* ---- Scroll-Wheel Zoom ---- */
.stf__parent {
  transition: transform 0.12s ease-out;
}

.stf__parent.fb-zoomed {
  z-index: 20;
}

/* ---- PDF Link Overlays ---- */
.fb-page-link {
  position: absolute;
  cursor: pointer;
  z-index: 2;
  background: transparent;
  border: none;
  text-decoration: none;
}

.fb-page-link:hover {
  background: rgba(0, 100, 200, 0.1);
  outline: 1px solid rgba(0, 100, 200, 0.3);
  border-radius: 2px;
}

/* ---- Navigation Arrows ---- */
.fb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 80px;
  border: none;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  color: #ddd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.2s;
  opacity: 0.6;
}

.fb-nav:hover {
  background: rgba(0, 0, 0, 0.7);
  opacity: 1;
}

.fb-nav-disabled {
  opacity: 0.15;
  pointer-events: none;
}

.fb-nav-prev { left: 0.75rem; }
.fb-nav-next { right: 0.75rem; }

/* ---- Thumbnail Strip ---- */
.fb-thumbstrip {
  display: flex;
  gap: 3px;
  padding: 0.25rem 1rem;
  background: #111;
  border-top: 1px solid #333;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: #555 #111;
}

.fb-thumbstrip::-webkit-scrollbar {
  height: 4px;
}

.fb-thumbstrip::-webkit-scrollbar-track {
  background: #111;
}

.fb-thumbstrip::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 2px;
}

.fb-thumb {
  flex-shrink: 0;
  padding: 0.1rem 0.4rem;
  font-size: 0.6rem;
  border: 1px solid #444;
  border-radius: 3px;
  background: #222;
  color: #999;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.fb-thumb:hover {
  background: #333;
  color: #ddd;
  border-color: #666;
}

.fb-thumb-active {
  background: #444;
  color: #fff;
  border-color: #888;
}

/* ---- Loading ---- */
.fb-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(26, 26, 26, 0.85);
  z-index: 20;
}

.fb-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #444;
  border-top-color: #ccc;
  border-radius: 50%;
  animation: fb-spin 0.8s linear infinite;
}

.fb-loading-text {
  font-size: 0.75rem;
  color: #888;
  letter-spacing: 0.02em;
}

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

/* ---- Error ---- */
.fb-error {
  color: #e88;
  text-align: center;
  padding: 2rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .fb-viewer {
    height: 100dvh;
    max-height: none;
  }

  .fb-nav {
    width: 32px;
    height: 56px;
  }

  .fb-nav-prev { left: 0.25rem; }
  .fb-nav-next { right: 0.25rem; }

  .fb-title {
    font-size: 0.7rem;
    max-width: 40%;
  }

  .fb-thumbstrip {
    padding: 0.2rem 0.5rem;
  }
}

/* ---- Standalone Page Layout ---- */
.fb-page-body {
  margin: 0;
  padding: 0;
  background: #111;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.fb-page-body .fb-viewer {
  flex: 1;
  min-height: 0;
  height: 100vh;
  max-height: none;
  border-radius: 0;
}
