/* ফয়জার এআই কম্পোজ — পাতা বড় করে দেখার ভিউয়ার (PDF ও ছবি)
 * ১০০% অফলাইন, কোনো বাহ্যিক ফন্ট বা CDN ছাড়াই চলে।
 */

.fz-pv-lock {
  overflow: hidden !important;
}

.fz-pv-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  color: #f8fafc;
  font-family: "Hind Siliguri", "Noto Sans Bengali", system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
}

.fz-pv-overlay *,
.fz-pv-overlay *::before,
.fz-pv-overlay *::after {
  box-sizing: border-box;
}

.fz-pv-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* উপরের টুলবার */
.fz-pv-toolbar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  user-select: none;
}

.fz-pv-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.fz-pv-counter {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.3;
}

.fz-pv-title {
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

.fz-pv-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.fz-pv-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 3px;
}

.fz-pv-btn {
  appearance: none;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border-radius: 8px;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
  font-family: inherit;
}

.fz-pv-group .fz-pv-btn {
  background: transparent;
  min-width: 34px;
  height: 32px;
}

.fz-pv-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
}

.fz-pv-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.fz-pv-btn:focus-visible {
  outline: 2px solid #34d399;
  outline-offset: 2px;
}

.fz-pv-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.fz-pv-zoom-pct {
  appearance: none;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  min-width: 54px;
  height: 32px;
  padding: 0 6px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}

.fz-pv-zoom-pct:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.fz-pv-btn-danger {
  background: rgba(220, 38, 38, 0.88);
  border-color: rgba(248, 113, 113, 0.35);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 0 12px;
  white-space: nowrap;
}

.fz-pv-btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.fz-pv-btn-close {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
  font-size: 18px;
  min-width: 38px;
  height: 36px;
}

.fz-pv-btn-close:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.85);
  border-color: rgba(248, 113, 113, 0.5);
}

/* মূল ক্যানভাস/ছবির মঞ্চ */
.fz-pv-stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

.fz-pv-stage.is-zoomed {
  cursor: grab;
}

.fz-pv-stage.is-dragging {
  cursor: grabbing;
}

.fz-pv-canvas-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform;
  transition: transform 0.12s ease-out;
}

.fz-pv-canvas-wrap.no-transition {
  transition: none !important;
}

.fz-pv-media {
  display: block;
  max-width: 92vw;
  max-height: calc(100vh - 116px);
  max-height: calc(100dvh - 116px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.68);
  pointer-events: auto;
}

.fz-pv-media[hidden] {
  display: none !important;
}

/* পাশের আগের/পরের পাতা বোতাম */
.fz-pv-side-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
  padding: 0;
  user-select: none;
}

.fz-pv-side-btn:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.85);
  border-color: rgba(110, 231, 183, 0.6);
  transform: translateY(-50%) scale(1.06);
}

.fz-pv-side-btn:active:not(:disabled) {
  transform: translateY(-50%) scale(0.96);
}

.fz-pv-side-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.fz-pv-side-btn[hidden] {
  display: none !important;
}

.fz-pv-side-prev {
  left: 16px;
}

.fz-pv-side-next {
  right: 16px;
}

/* লোডার ও ত্রুটি বার্তা */
.fz-pv-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.fz-pv-loader[hidden] {
  display: none !important;
}

.fz-pv-spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: #34d399;
  border-radius: 50%;
  animation: fzPvSpin 0.75s linear infinite;
}

@keyframes fzPvSpin {
  to {
    transform: rotate(360deg);
  }
}

/* নিচের সংক্ষিপ্ত ইঙ্গিত বার */
.fz-pv-footer {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 14px;
  background: rgba(15, 23, 42, 0.78);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
  flex-shrink: 0;
  user-select: none;
}

/* থাম্বনেইল হোভার নির্দেশক */
.ws-grid .pg,
[data-page-preview] {
  cursor: zoom-in;
}

/* মোবাইল রেসপনসিভ সমন্বয় */
@media (max-width: 640px) {
  .fz-pv-toolbar {
    padding: 8px 10px;
    gap: 6px;
  }

  .fz-pv-title {
    display: none;
  }

  .fz-pv-counter {
    font-size: 12.5px;
    padding: 3px 9px;
  }

  .fz-pv-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    font-size: 16px;
  }

  .fz-pv-zoom-pct {
    min-width: 46px;
    font-size: 12px;
  }

  .fz-pv-btn-danger {
    font-size: 12px;
    padding: 0 8px;
  }

  .fz-pv-side-btn {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .fz-pv-side-prev {
    left: 8px;
  }

  .fz-pv-side-next {
    right: 8px;
  }

  .fz-pv-media {
    max-width: 96vw;
    max-height: calc(100vh - 108px);
    max-height: calc(100dvh - 108px);
  }
}
