/* MDB_FIX33: Live Flipbook - one fixed frame for portrait + landscape pages,
   delete icon in the page's upper corner, deleted-pages dialog. */

/* ---- fixed frame: same size for every page; the page is scaled to fit inside ---- */
.source-single-page-preview.mdb-fixed-frame-area {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  min-height: 0 !important;
  padding: 18px !important;
}

.source-single-page-preview.mdb-fixed-frame-area > .book-page.mdb-fixed-frame,
.source-single-page-preview.mdb-fixed-frame-area > .book-page.mdb-fixed-frame.portrait,
.source-single-page-preview.mdb-fixed-frame-area > .book-page.mdb-fixed-frame.landscape {
  position: relative !important;
  box-sizing: border-box !important;
  width: min(100%, 1040px) !important;
  max-width: 1040px !important;
  height: clamp(420px, calc(100vh - 300px), 740px) !important;
  aspect-ratio: auto !important;
  margin: 0 auto !important;
  padding: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #f3f7f5 !important;
  border: 1px solid #cfe0d8 !important;
  border-radius: 10px !important;
  box-shadow: 0 14px 34px rgba(12, 49, 37, .16) !important;
  overflow: hidden !important;
}

.source-single-page-preview.mdb-fixed-frame-area > .book-page.mdb-fixed-frame img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  background: transparent !important;
  margin: 0 !important;
  filter: drop-shadow(0 4px 10px rgba(12, 49, 37, .18));
}

@media (max-width: 760px) {
  .source-single-page-preview.mdb-fixed-frame-area > .book-page.mdb-fixed-frame {
    height: clamp(300px, 62vh, 560px) !important;
  }
}

/* ---- delete icon, upper-right corner of the page ---- */
.mdb-page-del {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #efc4c4;
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
  color: #b3261e;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(80, 20, 20, .14);
  opacity: .85;
  transition: opacity .15s, background .15s, color .15s, transform .15s;
}
.mdb-page-del:hover,
.mdb-page-del:focus-visible {
  opacity: 1;
  background: #b3261e;
  color: #fff;
  transform: scale(1.06);
  outline: none;
}

/* ---- dialog ---- */
.mdb-del-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 30, 23, .45);
}
.mdb-del-card {
  width: min(520px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  color: #10231c;
}
.mdb-del-card h3 { margin: 0 0 8px; font-size: 19px; }
.mdb-del-icon {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fdecec; font-size: 22px; margin-bottom: 10px;
}
.mdb-del-title { font-weight: 700; margin: 0 0 8px; word-break: break-word; }
.mdb-del-note { color: #55635d; font-size: 13.5px; line-height: 1.45; margin: 0 0 6px; }
.mdb-del-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.mdb-del-danger { background: #b3261e !important; border-color: #b3261e !important; color: #fff !important; }
.mdb-del-danger:disabled { opacity: .7; }
.mdb-del-list { display: grid; gap: 8px; margin-top: 6px; }
.mdb-del-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid #dfe9e4; border-radius: 10px; background: #f8fbfa;
}
.mdb-del-row strong { display: block; font-size: 13.5px; word-break: break-word; }
.mdb-del-row small { color: #66746e; font-size: 12px; }
.mdb-del-restore-all { display: flex; justify-content: flex-end; margin-top: 4px; }
.mdb-deleted-btn { color: #9a3412 !important; border-color: #f2c9a8 !important; }
