/* Styles for js/more/organize.js */

/* Remove pages: marked pages fade and get a red cross */
.rm-grid .pg { cursor: pointer; }
.rm-grid .pg:hover { border-color: var(--line-2); }
.rm-grid .pg.on { border-color: var(--bad); background: #fdeeee; }
.rm-grid .pg.on .thumb { opacity: .35; filter: grayscale(1); }
.rm-grid .pg.on .pg__tick { display: grid; background: var(--bad); }
.rm-grid .pg.on .pg__num { color: var(--bad); text-decoration: line-through; }

/* Extract pages: All / Odd / Even / None */
.org-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.org-quick .btn { padding: 8px 4px; font-size: .85rem; }

/* Crop box over a page or photo */
.crop__holder { overflow: hidden; } /* clips the dimmed surround; the handles stay visible in the padding */
.crop__stage { position: relative; display: inline-block; max-width: 100%; line-height: 0; user-select: none; }
.crop__stage canvas { display: block; max-width: 100%; height: auto !important; }
.crop__box { position: absolute; box-sizing: border-box; border: 2px solid #fff; outline: 1px solid var(--c, var(--primary)); box-shadow: 0 0 0 9999px rgba(23, 23, 58, .45); cursor: move; touch-action: none; }
/* thirds while dragging, to help line things up */
.crop__box::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .15s;
  background:
    linear-gradient(to right, transparent 33.2%, rgba(255, 255, 255, .55) 33.2% 33.6%, transparent 33.6% 66.4%, rgba(255, 255, 255, .55) 66.4% 66.8%, transparent 66.8%),
    linear-gradient(to bottom, transparent 33.2%, rgba(255, 255, 255, .55) 33.2% 33.6%, transparent 33.6% 66.4%, rgba(255, 255, 255, .55) 66.4% 66.8%, transparent 66.8%);
}
.crop__box.dragging::before { opacity: 1; }
.crop__h { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 5px; background: #fff; border: 2px solid var(--c, var(--primary)); box-sizing: border-box; touch-action: none; }
.crop__h::after { content: ''; position: absolute; inset: -12px; } /* a bigger target for fingers */
.crop__h--n, .crop__h--s { width: 26px; height: 10px; margin: -5px 0 0 -13px; left: 50%; cursor: ns-resize; }
.crop__h--e, .crop__h--w { width: 10px; height: 26px; margin: -13px 0 0 -5px; top: 50%; cursor: ew-resize; }
.crop__h--n, .crop__h--nw, .crop__h--ne { top: 0; }
.crop__h--s, .crop__h--sw, .crop__h--se { top: 100%; }
.crop__h--w, .crop__h--nw, .crop__h--sw { left: 0; }
.crop__h--e, .crop__h--ne, .crop__h--se { left: 100%; }
.crop__h--nw, .crop__h--se { cursor: nwse-resize; }
.crop__h--ne, .crop__h--sw { cursor: nesw-resize; }

/* Scan to PDF */
.org-tools { justify-content: center; }
.org-edit { display: grid; place-items: center; padding: 14px; border-radius: 16px; background: var(--stage); }
.org-edit canvas { width: auto; max-height: 52vh; }

/* Repair: a file that can't be drawn */
.org-fileicon { display: grid; place-items: center; width: 120px; height: 150px; border-radius: 8px; background: #fff; color: var(--faint); box-shadow: 0 14px 30px -12px rgba(23, 23, 58, .35); }
.org-fileicon .ic { width: 48px; height: 48px; }

/* Camera */
.cam { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; background: #0d0d1f; color: #fff; }
.cam__view { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.cam__video { max-width: 100%; max-height: 100%; }
.cam__flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam__flash.on { animation: cam-flash .35s ease-out; }
@keyframes cam-flash { from { opacity: .8; } to { opacity: 0; } }
.cam__bar { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
.cam__strip { display: flex; gap: 10px; max-width: 100%; overflow-x: auto; padding: 6px 6px 0 0; }
.cam__strip:empty { display: none; }
.cam__thumb { position: relative; flex: none; }
.cam__thumb img { display: block; height: 64px; border-radius: 6px; }
.cam__thumb .iconbtn { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; }
.cam__thumb .iconbtn .ic { width: 13px; height: 13px; }
.cam__count { font-size: .85rem; color: rgba(255, 255, 255, .7); }
.cam__controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; width: min(100%, 460px); }
.cam__controls .btn--ghost { justify-self: start; background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
.cam__controls .btn--solid { justify-self: end; }
.cam__snap { width: 68px; height: 68px; border-radius: 50%; border: 4px solid #fff; background: rgba(255, 255, 255, .25); box-shadow: inset 0 0 0 4px #0d0d1f; cursor: pointer; }
.cam__snap:active { background: #fff; }
