/* PDFNova - Maker and sharing tools (loaded only on those tool pages). */

/* ---------- Two-pane maker layout ---------- */
.pdfm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; animation: pdfn-fade .35s ease; }
.pdfm__tabs { display: none; grid-column: 1 / -1; }
.pdfm__form { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.pdfm__side { min-width: 0; position: sticky; top: calc(var(--pn-head-h) + 16px); display: flex; flex-direction: column; gap: 12px; }
.pdfm__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pdfm__bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 980px) {
	.pdfm { grid-template-columns: minmax(0, 1fr); }
	.pdfm__tabs { display: flex; position: sticky; top: calc(var(--pn-head-h) + 8px); z-index: 5; }
	.pdfm__side { position: static; }
	.pdfm[data-pane="form"] .pdfm__side, .pdfm[data-pane="prev"] .pdfm__form { display: none; }
}

/* Preview */
.pdfm-prev { border-radius: 18px; background: var(--mn-section); border: 1px solid var(--mn-border); padding: 12px; transition: opacity .2s; }
.pdfm-prev.is-busy .pdfm-prev__pages { opacity: .6; }
.pdfm-prev__pages { display: flex; flex-direction: column; gap: 12px; max-height: min(78vh, 900px); overflow: auto; padding: 4px; border-radius: 10px; transition: opacity .2s; min-height: 220px; }
.pdfm-prev__pages canvas { display: block; background: #fff; border-radius: 3px; box-shadow: 0 8px 26px rgba(3, 6, 20, .35); }
.pdfm-prev__info { margin: 10px 0 0 !important; text-align: center; font-size: .82rem !important; color: var(--mn-muted) !important; }

/* Collapsible sections */
.pdfm-sec { border-radius: 16px; background: var(--mn-section); border: 1px solid var(--mn-border); }
.pdfm-sec > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; cursor: pointer; font: 700 1rem var(--mn-font-head), sans-serif; color: var(--mn-ink); }
.pdfm-sec > summary::-webkit-details-marker { display: none; }
.pdfm-sec > summary .pdfn-ico { transform: rotate(45deg); transition: transform .2s; color: var(--mn-muted); }
.pdfm-sec[open] > summary .pdfn-ico { transform: rotate(0deg); }
.pdfm-sec__b { display: flex; flex-direction: column; gap: 14px; padding: 2px 16px 16px; }
.pdfm-c3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .pdfm-c3, .pdfm .pdfn-cols2 { grid-template-columns: 1fr; } }
.pdfn-tool .pdfm textarea.pdfn-input, .pdfn-tool .pdfn-ws__side textarea.pdfn-input { resize: vertical; line-height: 1.5; min-height: 64px; }

/* Repeaters */
.pdfm-rep { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pdfm-rep__list { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.pdfm-rep__it { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 14px; background: var(--mn-surface); border: 1px solid var(--mn-border); }
.pdfm-rep__tools { display: flex; align-items: center; gap: 6px; }
.pdfm-rep__tools b { margin-right: auto; font: 600 .8rem var(--mn-font-body), sans-serif; color: var(--mn-muted); letter-spacing: .03em; text-transform: uppercase; }
.pdfm-rep__tools .pdfn-iconbtn { width: 30px; height: 30px; min-width: 30px; }
.pdfm-rep__tools .pdfn-iconbtn:disabled { opacity: .35; cursor: default; }

/* Colour swatches and image pickers */
.pdfm-colors { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pdfm-colors button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--mn-border); cursor: pointer; padding: 0; }
.pdfm-colors button.is-on { box-shadow: 0 0 0 2px var(--mn-bg), 0 0 0 4px var(--mn-cyan); }
.pdfm-colors input[type="color"] { width: 38px; height: 32px; padding: 0; border: 1px solid var(--mn-border); border-radius: 8px; background: none; cursor: pointer; }
.pdfm-img { width: 54px; height: 54px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: var(--mn-surface-2); color: var(--mn-muted); border: 1px solid var(--mn-border); }
.pdfm-img.is-round { border-radius: 50%; }
.pdfm-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- QR generator ---------- */
.pdfq-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px; border-radius: 18px; background: var(--mn-section); border: 1px solid var(--mn-border); }
.pdfq-qr { width: min(320px, 78vw); aspect-ratio: 1; border-radius: 14px; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: var(--pn-shadow); }
.pdfq-qr canvas { width: 100%; height: 100%; display: block; }
.pdfq-qr.is-empty { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .92) 10px, rgba(233, 236, 250, .92) 10px, rgba(233, 236, 250, .92) 20px); }
.pdfq-msg { margin: 0 !important; font-size: .88rem !important; color: var(--mn-muted) !important; text-align: center; }
.pdfq-msg.is-bad { color: var(--mn-amber) !important; }
.pdfq-pane { display: flex; flex-direction: column; gap: 14px; }
.pdfq-pane[hidden] { display: none; }

/* ---------- Signature maker ---------- */
.pdfs-pane { display: flex; flex-direction: column; gap: 12px; }
.pdfs-pane[hidden] { display: none; }
.pdfs-pad { height: auto; aspect-ratio: 1400 / 520; }
.pdfs-types { grid-template-columns: repeat(3, 1fr); }
.pdfs-types button { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 10px; }
.pdfs-check { display: grid; place-items: center; min-height: 120px; padding: 12px; border-radius: 14px; border: 1px solid var(--mn-border); background-color: #fff; background-image: linear-gradient(45deg, #e6e8f2 25%, transparent 25%), linear-gradient(-45deg, #e6e8f2 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e6e8f2 75%), linear-gradient(-45deg, transparent 75%, #e6e8f2 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
.pdfs-check canvas { max-width: 100%; height: auto; }
.pdfs-out { min-height: 150px; }
.pdfs-out .pdfn-label { color: #6b7190; }
@media (max-width: 560px) { .pdfs-types { grid-template-columns: 1fr 1fr; } }

/* ---------- Urdu typing ---------- */
.pdfn-tool .pdfn-input.pdfu-in { font-family: "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif !important; font-size: 1.15rem !important; line-height: 2.4 !important; }
.pdfu-ta { min-height: 300px; resize: vertical; padding-top: 12px !important; }
.pdfu-kb { display: flex; flex-direction: column; gap: 6px; direction: ltr; }
.pdfu-kb__row { display: flex; gap: 5px; justify-content: center; flex-wrap: nowrap; }
.pdfu-kb__ex { flex-wrap: wrap; margin-top: 6px; }
.pdfu-kb__k { position: relative; flex: 1 1 0; min-width: 0; max-width: 54px; height: 46px; border-radius: 10px; border: 1px solid var(--mn-border); background: var(--mn-surface); color: var(--mn-ink); cursor: pointer; padding: 0; font: 600 .8rem var(--mn-font-body), sans-serif; display: grid; place-items: center; }
.pdfu-kb__k:hover { border-color: rgba(0, 217, 255, .5); }
.pdfu-kb__k.is-off { visibility: hidden; }
.pdfu-kb__k.is-on { background: var(--mn-cyan); color: #070B1A; }
.pdfu-kb__k b { font: 400 1.15rem "Noto Naskh Arabic", "Noto Nastaliq Urdu", serif; line-height: 1; }
.pdfu-kb__k i { position: absolute; left: 4px; top: 2px; font-style: normal; font-size: .62rem; color: var(--mn-dim); }
.pdfu-kb__w { flex: 1.6 1 0; max-width: 90px; }
.pdfu-kb__sp { flex: 5 1 0; max-width: 260px; }
.pdfu-kb__ex .pdfu-kb__k { flex: 0 0 40px; height: 40px; }

/* ---------- Documents kit ---------- */
.pdfk-list { display: flex; flex-direction: column; gap: 8px; }
.pdfk-empty { margin: 0 !important; padding: 26px 18px; border-radius: 16px; border: 1.5px dashed var(--pn-line); color: var(--mn-muted) !important; text-align: center; font-size: .93rem !important; }
.pdfk-it { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--mn-surface); border: 1px solid var(--mn-border); }
.pdfk-it__th { width: 64px; height: 64px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: #fff; }
.pdfk-it__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pdfk-it__meta .pdfn-input { min-height: 36px; padding: 6px 10px; }
.pdfk-it__meta small { color: var(--mn-muted); font-size: .8rem; }
.pdfk-it__tools { display: flex; gap: 4px; flex: none; }
.pdfk-it__tools .pdfn-iconbtn { width: 32px; height: 32px; min-width: 32px; }
.pdfk-it__tools .pdfn-iconbtn:disabled { opacity: .35; cursor: default; }
.pdfk-add .pdfn-chipbtn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; letter-spacing: 0; font-size: .84rem; }
@media (max-width: 560px) { .pdfk-it { flex-wrap: wrap; } .pdfk-it__tools { width: 100%; justify-content: flex-end; } }

/* ---------- Sharing ---------- */
.pdfh { display: flex; flex-direction: column; gap: 18px; align-items: center; text-align: center; max-width: 620px; margin: 0 auto; padding: 26px 20px; border-radius: 20px; background: var(--mn-section); border: 1px solid var(--mn-border); }
.pdfh h3 { margin: 0; font: 700 1.35rem var(--mn-font-head), sans-serif; color: var(--mn-ink); }
.pdfh p { margin: 0 !important; color: var(--mn-muted); }
.pdfh__qr { width: min(260px, 70vw); aspect-ratio: 1; border-radius: 16px; background: #fff; padding: 10px; box-shadow: var(--pn-shadow); }
.pdfh__qr canvas { width: 100%; height: 100%; display: block; }
.pdfh__link { display: flex; gap: 8px; width: 100%; }
.pdfh__link .pdfn-input { flex: 1; min-width: 0; font-size: .82rem; }
.pdfh__facts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pdfh__facts span { padding: 6px 12px; border-radius: 999px; background: var(--mn-surface-2); border: 1px solid var(--mn-border); font-size: .84rem; color: var(--mn-ink); }
.pdfh__opts { display: flex; flex-direction: column; gap: 14px; width: 100%; text-align: left; }
.pdfh__dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--mn-amber); margin-right: 8px; animation: pdfh-pulse 1.4s ease-in-out infinite; }
.pdfh__dot.is-on { background: var(--mn-mint); animation: none; }
@keyframes pdfh-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.pdfh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; width: 100%; }
.pdfh-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; background: var(--mn-surface); border: 1px solid var(--mn-border); text-align: left; }
.pdfh-card__th { aspect-ratio: 3 / 4; border-radius: 8px; background: #fff; display: grid; place-items: center; overflow: hidden; color: #4a5378; }
.pdfh-card__th img { width: 100%; height: 100%; object-fit: cover; }
.pdfh-card small { color: var(--mn-muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdfh-card .pdfn-row { gap: 4px; flex-wrap: nowrap; }
.pdfh-card .pdfn-iconbtn { width: 30px; height: 30px; min-width: 30px; }
.pdfh-wide { max-width: 900px; }

/* Share button on results and the install prompt */
.pdfn-install { display: none; }
.pdfn-install.is-on { display: inline-flex; }
.pdfh .pdfn-note, .pdfh .pdfn-warn, .pdfh .pdfn-check { text-align: left; }
.pdfh__status { font-weight: 600; color: var(--mn-ink) !important; }
.pdfi-sum { margin: 0 !important; text-align: right; color: var(--mn-muted) !important; }
.pdfi-sum b { color: var(--mn-ink); font-size: 1.05rem; }
