/* ─────────────────────────────────────────────────────────────────────────────
   dmain PDF Viewer — viewer.css
   ───────────────────────────────────────────────────────────────────────────── */

/* ─── 래퍼 ─────────────────────────────────────────────────────────────────── */
.dmain-pdf-viewer {
	display: flex;
	flex-direction: column;
	width: calc(100% + 160px);
    margin: 0 -80px;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	font-family: inherit;
	outline: none;
}

/* ─── 툴바 ─────────────────────────────────────────────────────────────────── */
.dpv-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap:  16px;
	padding: 16px 32px;
	background: #eee;
    border-radius: 12px;
	flex-wrap: wrap;
}

.dpv-toolbar__left,
.dpv-toolbar__center,
.dpv-toolbar__right {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ─── 버튼 공통 ─────────────────────────────────────────────────────────────── */
.dpv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 24px;
	background: transparent;
	color: #666464;
	cursor: pointer;
	font-size: 24px;
	transition: background 0.15s, color 0.15s;
	text-decoration: none;
	flex-shrink: 0;
}
.dpv-btn:hover {
	color: #F4AFBF;
}
.dpv-btn.is-active {
	color: #E95383;
}
.dpv-btn:disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

/* ─── 페이지 입력 ───────────────────────────────────────────────────────────── */
.dpv-page-info {
	display: flex;
	align-items: center;
	gap: 4px;
	color: #333;
	font-size: 15px;
	white-space: nowrap;
}

.dpv-page-input {
	width: 48px;
	height: 30px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	color: #333;
	text-align: center;
	font-size: 16px;
	outline: none;
	-moz-appearance: textfield;
}
.dpv-page-input::-webkit-inner-spin-button,
.dpv-page-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.dpv-page-sep { color: #888; }
.dpv-page-total { min-width: 20px; text-align: left; }

/* ─── 줌 셀렉트 ─────────────────────────────────────────────────────────────── */
.dpv-zoom-select {
	height: 30px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	color: #333;
	font-size: 16px;
	padding: 0 6px;
	outline: none;
	cursor: pointer;
}

/* ─── 캔버스 영역 ───────────────────────────────────────────────────────────── */
.dpv-canvas-wrap {
	position: relative;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	min-height: 400px;
	background: #fff;
	overflow: auto;
	padding: 48px 32px;
}

.dpv-canvas-inner {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	justify-content: center;
}

.dpv-canvas {
	display: block;
	max-width: 100%;
	box-shadow: 0 4px 12px rgba(0,0,0,0.3);
	background: #fff;
}

.dpv-canvas--right {
	display: none;
}

/* spread 모드 */
.dmain-pdf-viewer.is-spread .dpv-canvas--right {
	display: block;
}

/* ─── 로딩 ─────────────────────────────────────────────────────────────────── */
.dpv-loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	color: #aaa;
	font-size: 14px;
	background: rgba(17,17,17,0.8);
}
.dpv-loading .fa-spinner { font-size: 28px; color: #fff; }

/* ─── 에러 ─────────────────────────────────────────────────────────────────── */
.dpv-error {
	color: #ff6b6b;
	font-size: 14px;
	padding: 24px;
	text-align: center;
}

/* ─── 썸네일 오버레이 ───────────────────────────────────────────────────────── */
.dpv-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}
.dpv-overlay[hidden] { display: none; }

.dpv-overlay__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.7);
	backdrop-filter: blur(2px);
}

.dpv-overlay__panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 1200px;
	max-height: 82vh;
	background: #1e1e1e;
	border-radius: 16px 16px 0 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: dpv-slide-up 0.25s ease;
}

@keyframes dpv-slide-up {
	from { transform: translateY(100%); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

/* ─── 페이지 전환 슬라이드 ─────────────────────────────────────────────────── */
@keyframes dpv-page-in-right {
	from { transform: translateX(48px); opacity: 0; }
	to   { transform: translateX(0);    opacity: 1; }
}
@keyframes dpv-page-in-left {
	from { transform: translateX(-48px); opacity: 0; }
	to   { transform: translateX(0);     opacity: 1; }
}
.dpv-canvas-wrap.is-page-next,
.dpv-canvas-wrap.is-page-prev {
	overflow: hidden;
}
.dpv-canvas-wrap.is-page-next .dpv-canvas-inner { animation: dpv-page-in-right 0.25s ease both; }
.dpv-canvas-wrap.is-page-prev .dpv-canvas-inner { animation: dpv-page-in-left  0.25s ease both; }

.dpv-overlay__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #333;
	flex-shrink: 0;
}

.dpv-overlay__title {
	color: #fff;
	font-size: 15px;
	font-weight: 600;
}

.dpv-overlay__close {
	width: 32px;
	height: 32px;
	font-size: 16px;
}

/* ─── 썸네일 그리드 ─────────────────────────────────────────────────────────── */
.dpv-thumbs {
	flex: 1;
	overflow-y: auto;
	padding: 16px 20px 24px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 12px;
	align-content: start;
}

.dpv-thumb {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	border-radius: 6px;
	padding: 8px;
	transition: background 0.15s;
}
.dpv-thumb:hover { background: #2e2e2e; }
.dpv-thumb.is-current { background: #3a3a3a; outline: 2px solid #F05B89; }

.dpv-thumb__canvas {
	display: block;
	max-width: 140px;
	height: auto;
	box-shadow: 0 2px 8px rgba(0,0,0,0.4);
	background: #fff;
	border-radius: 2px;
}

.dpv-thumb__label {
	font-size: 12px;
	color: #aaa;
}
.dpv-thumb.is-current .dpv-thumb__label { color: #fff; }

/* ─── 전체화면 ─────────────────────────────────────────────────────────────── */
.dmain-pdf-viewer:fullscreen {
	border-radius: 0;
	height: 100dvh;
}
.dmain-pdf-viewer:fullscreen .dpv-canvas-wrap {
	flex: 1;
	align-items: center;
}

/* ─── 에디터 미리보기 ───────────────────────────────────────────────────────── */
.dmain-pdf-editor-wrap {
	padding: 0;
}

.dmain-pdf-editor-preview {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px;
	border: 2px dashed #ccc;
	border-radius: 8px;
	background: #fafafa;
}

.dmain-pdf-editor-preview__icon .dashicons {
	font-size: 36px;
	width: 36px;
	height: 36px;
	color: #888;
}

.dmain-pdf-editor-preview__info {
	flex: 1;
	min-width: 0;
}
.dmain-pdf-editor-preview__name {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #333;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.dmain-pdf-editor-preview__url {
	display: block;
	font-size: 11px;
	color: #888;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin-top: 2px;
}

.dmain-pdf-editor-preview__actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

/* ─── 반응형 ────────────────────────────────────────────────────────────────── */
@media ( max-width: 768px ) {
	.dpv-toolbar {
		padding: 6px 8px;
	}
	.dpv-toolbar__center {
		order: 3;
		width: 100%;
		justify-content: center;
		padding-top: 4px;
		border-top: 1px solid #3a3a3a;
		margin-top: 4px;
	}
	.dpv-btn {
		width: 30px;
		height: 30px;
		font-size: 13px;
	}
	.dpv-canvas-wrap {
		padding: 8px;
	}
	.dpv-thumbs {
		grid-template-columns: repeat( auto-fill, minmax( 100px, 1fr ) );
		gap: 8px;
	}
	.dpv-thumb__canvas {
		max-width: 100px;
	}
}
