/* Flipbook fullscreen viewer */
.flipbook-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #1a1a2e;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.flipbook-overlay.hidden {
  display: none;
}

.flipbook-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 10000;
}

.flipbook-back-btn {
  color: #fff;
  text-decoration: none;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.flipbook-back-btn:hover {
  opacity: 1;
  color: #fff;
}

.flipbook-download-btn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.flipbook-download-btn:hover {
  opacity: 1;
  color: #fff;
}

.flipbook-title {
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 14px;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
}

.flipbook-page-info {
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 14px;
  margin-left: 20px;
}

.flipbook-container {
  width: 100%;
  height: calc(100vh - 56px);
  margin-top: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.flipbook-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10001;
}

.flipbook-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.flipbook-nav.prev {
  left: 20px;
}

.flipbook-nav.next {
  right: 20px;
}

.flipbook-loading {
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 18px;
  text-align: center;
}

.flipbook-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: flipbook-spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

/* PDF button in share bar */
.m-icon-button.in-share.pdf-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .flipbook-nav {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .flipbook-nav.prev {
    left: 8px;
  }

  .flipbook-nav.next {
    right: 8px;
  }

  .flipbook-title {
    display: none;
  }

  .flipbook-download-btn {
    font-size: 12px;
  }
}
