/* ==========================================================================
   TheDesizn Tools — PDF Merger Tool Styles
   ========================================================================== */

.tdz-pdf-merge {
	width: 100%;
}

.tdz-tool__title-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 8px;
}

.tdz-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border-radius: 9999px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.tdz-badge .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

.tdz-badge--client {
	background: #EEF2FF;
	color: #4F46E5;
	border: 1px solid #C7D2FE;
}

.tdz-badge--free {
	background: #FEF3C7;
	color: #92400E;
	border: 1px solid #FDE68A;
}

.tdz-badge--pro {
	background: #FDF2F8;
	color: #BE185D;
	border: 1px solid #FBCFE8;
}

.tdz-badge--rotate {
	position: absolute;
	bottom: -4px;
	right: -4px;
	background: #312E81;
	color: #EEF2FF;
	padding: 1px 5px;
	border-radius: 4px;
	font-size: 0.65rem;
	font-weight: 700;
	z-index: 2;
	border: 1px solid #4338CA;
}

/* Upload Area Extensions */
.tdz-upload-area__icon-wrap {
	width: 64px;
	height: 64px;
	border-radius: 16px;
	background: #FEE2E2;
	color: #DC2626;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
	transition: transform 0.2s ease;
}

.tdz-upload-area:hover .tdz-upload-area__icon-wrap {
	transform: scale(1.08);
}

.tdz-upload-area__icon {
	font-size: 34px;
	width: 34px;
	height: 34px;
}

.tdz-upload-area__limits {
	margin-top: 10px;
	font-size: 0.785rem;
	color: #94A3B8;
	font-weight: 500;
}

/* Two-Column Responsive Layout */
.tdz-merge-layout {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 24px;
	align-items: start;
	margin-top: 24px;
}

@media (max-width: 900px) {
	.tdz-merge-layout {
		grid-template-columns: 1fr;
	}
}

/* Main Queue Column */
.tdz-merge-main {
	background: var(--tdz-bg, #ffffff);
	border: 1px solid var(--tdz-border, #e2e8f0);
	border-radius: var(--tdz-border-radius, 12px);
	padding: 24px;
	box-shadow: var(--tdz-shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.tdz-merge-queue-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 8px;
}

.tdz-merge-queue-title {
	font-size: 1.125rem;
	font-weight: 700;
	margin: 0;
	color: var(--tdz-text, #1e293b);
	display: flex;
	align-items: center;
	gap: 8px;
}

.tdz-merge-queue-title .dashicons {
	color: #4F46E5;
	font-size: 20px;
	width: 20px;
	height: 20px;
}

.tdz-merge-queue-count {
	color: var(--tdz-text-muted, #64748b);
	font-weight: 500;
}

.tdz-merge-queue-actions {
	display: flex;
	gap: 8px;
}

.tdz-merge-hint {
	font-size: 0.825rem;
	color: var(--tdz-text-muted, #64748b);
	margin: 0 0 18px 0;
	display: flex;
	align-items: center;
	gap: 6px;
	line-height: 1.4;
}

/* Document List */
.tdz-merge-queue-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.tdz-merge-item {
	display: flex;
	align-items: center;
	background: var(--tdz-bg-alt, #f8fafc);
	border: 1px solid var(--tdz-border, #e2e8f0);
	border-radius: var(--tdz-border-radius-sm, 8px);
	padding: 10px 14px;
	transition: all var(--tdz-transition, 0.2s ease);
	position: relative;
	gap: 12px;
}

.tdz-merge-item:hover {
	border-color: #cbd5e1;
	box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.tdz-merge-item--dragging {
	opacity: 0.4;
	border: 2px dashed #4F46E5;
	background: #EEF2FF;
}

.tdz-merge-item--dragover {
	border-color: #4F46E5;
	background: #EEF2FF;
	transform: translateY(-2px);
}

/* Drag Handle */
.tdz-merge-item__drag-handle {
	cursor: grab;
	color: #94A3B8;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: color 0.15s ease;
	flex-shrink: 0;
}

.tdz-merge-item__drag-handle:hover {
	color: #475569;
}

.tdz-merge-item__drag-handle:active {
	cursor: grabbing;
}

.tdz-merge-item__index {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #EEF2FF;
	color: #4F46E5;
	font-size: 0.775rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

/* Preview Thumbnail Container */
.tdz-merge-item__preview {
	position: relative;
	width: 52px;
	height: 68px;
	flex-shrink: 0;
}

.tdz-merge-thumb-wrap {
	width: 100%;
	height: 100%;
	border-radius: 5px;
	overflow: hidden;
	box-shadow: 0 2px 5px rgba(0,0,0,0.12);
	border: 1px solid #E2E8F0;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tdz-merge-thumb-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tdz-merge-thumb-skeleton {
	background: #F1F5F9;
	color: #94A3B8;
}

.tdz-merge-thumb-placeholder {
	background: #FEF2F2;
	color: #EF4444;
}

.tdz-merge-thumb-placeholder .dashicons {
	font-size: 28px;
	width: 28px;
	height: 28px;
}

/* Info Details */
.tdz-merge-item__info {
	min-width: 0;
	flex: 1;
}

.tdz-merge-item__name {
	font-size: 0.925rem;
	font-weight: 600;
	color: var(--tdz-text, #1e293b);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin: 0 0 3px 0;
}

.tdz-merge-item__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 0.775rem;
	color: var(--tdz-text-muted, #64748b);
}

.tdz-merge-item__sep {
	color: #CBD5E1;
}

.tdz-merge-item__tag {
	background: #E2E8F0;
	color: #334155;
	padding: 1px 7px;
	border-radius: 4px;
	font-weight: 600;
	font-size: 0.75rem;
}

.tdz-merge-item__tag--loading {
	background: #FEF3C7;
	color: #B45309;
}

.tdz-merge-item__tag--error {
	background: #FEE2E2;
	color: #DC2626;
	font-weight: 600;
}

/* Document Item Controls */
.tdz-merge-item__actions {
	display: flex;
	align-items: center;
	gap: 5px;
	flex-shrink: 0;
}

.tdz-btn-icon {
	background: #ffffff;
	border: 1px solid var(--tdz-border, #e2e8f0);
	border-radius: 6px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--tdz-text-muted, #64748b);
	transition: all 0.15s ease;
	padding: 0;
}

.tdz-btn-icon:hover:not(:disabled) {
	background: #F8FAFC;
	color: var(--tdz-primary, #4F46E5);
	border-color: var(--tdz-primary, #4F46E5);
}

.tdz-btn-icon:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.tdz-btn-icon--danger:hover:not(:disabled) {
	background: #FEF2F2;
	color: #DC2626;
	border-color: #F87171;
}

/* Sidebar Settings Column */
.tdz-merge-sidebar {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.tdz-sidebar-card {
	background: var(--tdz-bg, #ffffff);
	border: 1px solid var(--tdz-border, #e2e8f0);
	border-radius: var(--tdz-border-radius, 12px);
	padding: 20px;
	box-shadow: var(--tdz-shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.tdz-sidebar-card__title {
	font-size: 1rem;
	font-weight: 700;
	margin: 0 0 16px 0;
	color: var(--tdz-text, #1e293b);
	display: flex;
	align-items: center;
	gap: 8px;
}

.tdz-sidebar-card__title .dashicons {
	color: #64748B;
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.tdz-stats-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 18px;
}

.tdz-stat-box {
	background: var(--tdz-bg-alt, #f8fafc);
	border: 1px solid var(--tdz-border, #e2e8f0);
	border-radius: var(--tdz-border-radius-sm, 8px);
	padding: 10px 12px;
	display: flex;
	flex-direction: column;
}

.tdz-stat-box--full {
	grid-column: 1 / -1;
}

.tdz-stat-box__label {
	font-size: 0.725rem;
	color: var(--tdz-text-muted, #64748b);
	text-transform: uppercase;
	font-weight: 600;
	letter-spacing: 0.03em;
}

.tdz-stat-box__value {
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--tdz-text, #1e293b);
	margin-top: 2px;
}

.tdz-merge-tier-notice {
	background: #FFFBEB;
	border: 1px solid #FCD34D;
	border-radius: 8px;
	padding: 12px;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 16px;
	font-size: 0.8rem;
	color: #92400E;
}

.tdz-merge-tier-notice .dashicons {
	color: #D97706;
	font-size: 20px;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	margin-top: 1px;
}

.tdz-tier-notice-heading {
	display: block;
	font-weight: 700;
	margin-bottom: 2px;
}

.tdz-merge-tier-notice p {
	margin: 0;
	line-height: 1.4;
}

/* Progress Bar */
.tdz-progress {
	margin-bottom: 16px;
}

.tdz-progress__header {
	display: flex;
	justify-content: space-between;
	font-size: 0.8rem;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--tdz-text, #1e293b);
}

.tdz-progress__bar {
	width: 100%;
	height: 8px;
	background: #E2E8F0;
	border-radius: 999px;
	overflow: hidden;
}

.tdz-progress__fill {
	height: 100%;
	background: linear-gradient(90deg, #4F46E5, #7C3AED);
	border-radius: 999px;
	transition: width 0.25s ease;
}

/* Spin animation */
.tdz-spin {
	animation: tdz-spin-anim 1s linear infinite;
	display: inline-block;
}

@keyframes tdz-spin-anim {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Result Card */
.tdz-result-card {
	background: #F0FDF4;
	border: 1px solid #BBF7D0;
	border-radius: var(--tdz-border-radius, 12px);
	padding: 20px;
}

.tdz-result-card__header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.tdz-result-card__icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #22C55E;
	color: #ffffff;
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.tdz-result-card__title {
	font-size: 1rem;
	font-weight: 700;
	color: #166534;
	margin: 0 0 2px 0;
}

.tdz-result-card__meta {
	font-size: 0.8rem;
	color: #15803D;
	margin: 0;
}

.tdz-result-card__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tdz-btn--block {
	width: 100%;
	justify-content: center;
}

.tdz-btn--success {
	background: #16A34A;
	color: #ffffff;
	border: none;
}

.tdz-btn--success:hover {
	background: #15803D;
}

/* Mobile Responsiveness (375px+) */
@media (max-width: 640px) {
	.tdz-merge-item {
		flex-wrap: wrap;
		padding: 12px;
	}

	.tdz-merge-item__actions {
		width: 100%;
		justify-content: flex-end;
		border-top: 1px solid #E2E8F0;
		padding-top: 8px;
		margin-top: 6px;
	}

	.tdz-btn-icon {
		width: 38px;
		height: 38px;
	}

	.tdz-merge-queue-actions {
		width: 100%;
		justify-content: flex-end;
	}
}
