/* =============================================================
   FLIPBOOK SECTION — Light Corporate Theme (matches sample viewer)
   Brand accent kept as Karsaz orange (#ff6b35)
   ============================================================= */

html, body {
  margin: 0 !important;
  padding: 0 !important;
}

.flipbook-section {
  background: #eef1f5;
  padding: 6px 0 8px !important;
  min-height: 100vh;
  display: flex;
  align-items: center;
} 

.flipbook-wrapper {
  position: relative;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: transparent;
  box-shadow: none;
}

/* ============== VIEWPORT (fixed, clips zoom overflow) ============== */
.fb-viewport {
  position: relative;
  width: 100%;
  height: 86vh;
  min-height: 380px;
  overflow: auto;
  text-align: center;         /* centers fb-zoom-content, overflow ke sath sahi kaam karta hai */
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* old Edge/IE */
}
.fb-zoom-content {
  display: inline-block;
  text-align: left;           /* children ke liye centering reset */
  vertical-align: top;
}
.fb-viewport::-webkit-scrollbar {
  display: none;              /* Chrome/Safari/Edge */
}

/* ============== STAGE (this is what actually scales on zoom) ============== */
.flipbook-stage {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  transform: scale(1);
  transform-origin: top left;   /* JS sizing math isi origin ke hisab se hai */
  transition: transform 0.25s ease;
}

.flipbook-shadow {
  position: absolute;
  bottom: -6px;
  left: 8%;
  right: 8%;
  height: 34px;
  background: radial-gradient(ellipse at center,
    rgba(20, 24, 38, 0.28) 0%,
    rgba(20, 24, 38, 0.10) 45%,
    transparent 75%);
  filter: blur(14px);
  z-index: 0;
  pointer-events: none;
}

.flipbook-stage,
#flipbook,
.stf__parent,
.fb-page {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.stf__parent { cursor: grab; margin: 0 auto !important; }
.stf__parent:active { cursor: grabbing; }
.stf__block { perspective: 2000px; }

/* Zoomed-in drag-to-pan state */
.fb-viewport.fb-zoomed {
  cursor: grab;
}
.fb-viewport.fb-zoomed.fb-dragging {
  cursor: grabbing;
}
.fb-viewport.fb-zoomed #flipbook {
  pointer-events: none; /* stops page-flip drag from fighting with pan drag */
}

#flipbook {
  margin: auto;
  z-index: 2;
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 2px 8px rgba(20, 24, 38, 0.06),
    0 24px 60px -20px rgba(20, 24, 38, 0.28);
}

/* Book ke back/reverse side ka background white */
.stf__parent,
.stf__block,
.stf__wrapper,
.stf__item,
.stf__item .--simple,
.stf__page {
  background: #ffffff !important;
}

/* ============== PAGE ============== */
.fb-page {
  background: #ffffff;
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 100%;
}

.fb-page-image-only {
  padding: 0;
  background: #ffffff;
}
.fb-page-image-only img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #ffffff;
  display: block;
  position: relative;
  z-index: 2;
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: auto;
}

/* Jab book zoomed ho, to page images par bhi pointer-events off rakho
   taake page-flip ka apna drag/flip gesture left/right kisi bhi page
   par pan-drag ko intercept na kar sake. Sirf fbViewport ka apna
   mousedown/mousemove pan handler chalega. */
.fb-viewport.fb-zoomed .fb-page-image-only img {
  pointer-events: none;
}

/* Mobile: single-page mode — pura page nazar aana chahiye, crop nahi */
@media (max-width: 767px) {
  .fb-page-image-only img {
    object-fit: cover;
    object-position: center;
    background: #ffffff;
  }
}

/* Subtle centre spine shading, like a real open book */
.stf__item::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 24px;
  pointer-events: none;
  z-index: 5;
}

/* ============== SIDE NAV ARROWS (circular, floating) ============== */
.fb-side-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e6e8ee;
  color: #ff6b35;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 6px 18px rgba(20, 24, 38, 0.12);
  transition: all 0.25s ease;
}
.fb-side-btn:hover {
  background: #ff6b35;
  color: #ffffff;
  border-color: #ff6b35;
  box-shadow: 0 10px 24px rgba(255, 107, 53, 0.32);
}
.fb-side-btn-left { left: -8px; }
.fb-side-btn-right { right: -8px; }

@media (max-width: 992px) {
  .fb-side-btn-left { left: 4px; }
  .fb-side-btn-right { right: 4px; }
}
@media (max-width: 576px) {
  .fb-side-btn { width: 36px; height: 36px; }
}

/* ============== TOOLBAR AREA (anchors the floating thumbnails panel) ============== */
.fb-toolbar-area {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  background: transparent;
  box-shadow: none;
}

/* ============== THUMBNAILS STRIP — floats ABOVE the toolbar, stage stays fixed ============== */
.fb-thumbs {
  display: none;
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 1180px);
  max-height: 220px;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #e6e8ee;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(20, 24, 38, 0.16);
  z-index: 30;
}
.fb-thumbs.is-open { display: flex; }

.fb-thumb {
  flex: 0 0 auto;
  width: 84px;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease;
  background: #f4f5f8;
}
.fb-thumb:hover { transform: translateY(-3px); }
.fb-thumb.active { border-color: #ff6b35; }
.fb-thumb img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}
.fb-thumb-num {
  position: absolute;
  bottom: 4px;
  right: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #ffffff;
  background: rgba(20, 24, 38, 0.65);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ============== BOTTOM TOOLBAR ============== */
.fb-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e6e8ee;
  border-radius: 12px;
  padding: 6px 12px;
  box-shadow: 0 10px 28px rgba(20, 24, 38, 0.08);
  flex-wrap: wrap;
  justify-content: center;
}

.fb-tsep {
  width: 1px;
  height: 26px;
  background: #e6e8ee;
}
.fb-tsep-desktop { display: block; }

.fb-tbtn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e6e8ee;
  background: #f7f8fa;
  color: #1a1a1a;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.fb-tbtn i { color: #ff6b35; font-size: 13px; }
.fb-tbtn:hover,
.fb-tbtn.active {
  background: #ff6b35;
  border-color: #ff6b35;
  color: #ffffff;
}
.fb-tbtn:hover i,
.fb-tbtn.active i { color: #ffffff; }

.fb-icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}
.fb-icon-btn:hover {
  background: #fff1ea;
  color: #ff6b35;
}

.fb-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fb-zoom input[type="range"] {
  width: 130px;
  accent-color: #ff6b35;
  cursor: pointer;
}

.fb-page-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  color: #475569;
}
.fb-page-input {
  width: 46px;
  text-align: center;
  border: 1px solid #e6e8ee;
  border-radius: 7px;
  padding: 6px 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #1a1a1a;
  background: #f7f8fa;
}
.fb-page-input::-webkit-outer-spin-button,
.fb-page-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fb-page-input { -moz-appearance: textfield; }
.fb-page-slash { color: #94a3b8; }
.fb-page-total { font-size: 13px; }

.fb-download-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ff6b35;
  color: #ffffff !important;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 9px;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(255, 107, 53, 0.28);
  transition: all 0.2s ease;
}
.fb-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(255, 107, 53, 0.4);
  color: #ffffff;
}

/* ============== RESPONSIVE ============== */
@media (max-width: 768px) {
  .fb-viewport { height: 62vh; min-height: 340px; }
  .fb-toolbar { gap: 8px; padding: 8px 10px; }
  .fb-tsep-desktop { display: none; }
  .fb-tbtn span { display: none; }
  .fb-tbtn { padding: 9px 11px; }
  .fb-zoom input[type="range"] { width: 80px; }
  .fb-download-btn span { display: none; }
  .fb-download-btn { padding: 10px 12px; }
  .fb-thumbs { width: 94vw; max-height: 160px; }

  /* Touch-friendly page nav buttons on mobile */
  .fb-icon-btn { width: 40px; height: 40px; font-size: 16px; }
  .fb-page-input { width: 42px; font-size: 14px; }

  .flipbook-wrapper { gap: 12px; padding: 0 8px; }
  #flipbook { border-radius: 6px; }
}

@media (max-width: 480px) {
  .fb-viewport { height: 54vh; min-height: 280px; }
  .fb-thumb { width: 64px; }

  .fb-toolbar { padding: 8px; }
  .fb-tbtn-thumbs span { display: none; }
}
/* Back button - top-left */
.eg-back-arrow{
    position:fixed;
    top:18px;
    left:18px;
    z-index:9999;
    width:44px;
    height:44px;
    background:transparent;
    color:#1a1a1a;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
    text-decoration:none;
    transition:color .2s ease;
}
.eg-back-arrow:hover{color:#ff6b35;}