@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

.psdiha-wp {
	--wp-text: #111827;
	--wp-text-2: #4b5563;
	--wp-text-3: #9ca3af;
	--wp-border: #e8eaed;
	--wp-surface: #fff;
	--wp-bg: #f4f5f7;
	--wp-primary: #5b5bd6;
	--wp-radius: 16px;
	--wp-font: 'Vazirmatn', Tahoma, system-ui, sans-serif;
	font-family: var(--wp-font);
	max-width: 640px;
	margin: 0 auto;
	padding: 32px 20px 48px;
	direction: rtl;
	color: var(--wp-text);
	box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
}
.psdiha-wp *, .psdiha-wp *::before, .psdiha-wp *::after { box-sizing: border-box; }

.psdiha-wp__header { text-align: center; margin-bottom: 28px; }
.psdiha-wp__title { font-size: 1.75rem; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.02em; }
.psdiha-wp__subtitle { font-size: 0.95rem; color: var(--wp-text-2); margin: 0 auto; max-width: 400px; line-height: 1.7; }

.psdiha-wp__alert {
	background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
	padding: 14px 18px; border-radius: 12px; font-size: 0.9rem; line-height: 1.6; text-align: center;
}

.psdiha-wp__upload {
	position: relative;
	border: 2px dashed var(--wp-border);
	border-radius: var(--wp-radius);
	background: var(--wp-surface);
	min-height: 180px;
	cursor: pointer;
	transition: border-color .2s, background .2s, box-shadow .2s;
	overflow: hidden;
	margin-bottom: 16px;
}
.psdiha-wp__upload:hover, .psdiha-wp__upload.is-drag {
	border-color: var(--wp-primary);
	background: rgba(91, 91, 214, 0.04);
	box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.08);
}
.psdiha-wp__drop-inner {
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: 10px; padding: 40px 20px; color: var(--wp-text-3); text-align: center;
}
.psdiha-wp__drop-text { margin: 0; font-size: 1rem; font-weight: 700; color: var(--wp-text-2); }
.psdiha-wp__drop-hint { margin: 0; font-size: 0.8rem; }

.psdiha-wp__preview-wrap {
	position: relative; display: flex; align-items: center; justify-content: center;
	padding: 12px; min-height: 180px; cursor: default;
}
.psdiha-wp__preview {
	max-width: 100%; max-height: 280px; border-radius: 12px; object-fit: contain;
	box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.psdiha-wp__clear {
	position: absolute; top: 14px; left: 14px; width: 36px; height: 36px;
	border-radius: 50%; border: none; background: rgba(17,24,39,.75); color: #fff;
	font-size: 1.4rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.psdiha-wp__clear:hover { background: #b32d2e; }

.psdiha-wp__controls {
	background: var(--wp-surface);
	border: 1px solid var(--wp-border);
	border-radius: var(--wp-radius);
	padding: 20px;
	margin-bottom: 16px;
}
.psdiha-wp__quality-label {
	display: block; font-size: 0.88rem; font-weight: 600; color: var(--wp-text-2); margin-bottom: 10px;
}
.psdiha-wp__quality-label strong { color: var(--wp-primary); font-size: 1.05rem; }
.psdiha-wp__range {
	width: 100%;
	accent-color: var(--wp-primary);
	height: 6px;
	cursor: pointer;
}
.psdiha-wp__range-hints {
	display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--wp-text-3);
	margin: 6px 0 16px;
}

.psdiha-wp__btn {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 12px 20px; font-size: 0.9rem; font-weight: 700; font-family: inherit;
	border-radius: 10px; border: none; cursor: pointer; transition: all .2s; line-height: 1.2;
	text-decoration: none; text-align: center;
}
.psdiha-wp__btn--primary {
	background: var(--wp-primary); color: #fff; width: 100%;
	box-shadow: 0 2px 10px rgba(91, 91, 214, 0.28);
}
.psdiha-wp__btn--primary:hover { background: #4a4ac4; color: #fff; }
.psdiha-wp__btn--primary:disabled { opacity: 0.65; cursor: wait; }
.psdiha-wp__btn--ghost {
	background: var(--wp-surface); color: var(--wp-text-2); border: 1.5px solid var(--wp-border);
	width: 100%; margin-top: 10px;
}
.psdiha-wp__btn--ghost:hover { background: var(--wp-bg); color: var(--wp-text); }

.psdiha-wp__result {
	background: var(--wp-surface);
	border: 1px solid var(--wp-border);
	border-radius: var(--wp-radius);
	padding: 20px;
}
.psdiha-wp__stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 16px;
}
.psdiha-wp__stat {
	background: var(--wp-bg);
	border-radius: 10px;
	padding: 12px;
	text-align: center;
}
.psdiha-wp__stat span {
	display: block; font-size: 0.72rem; color: var(--wp-text-3); font-weight: 600; margin-bottom: 4px;
}
.psdiha-wp__stat strong {
	font-size: 1rem; color: var(--wp-text);
}

.psdiha-ch__toast {
	position: fixed; bottom: 28px; left: 50%;
	transform: translateX(-50%) translateY(90px);
	background: #1e1e2e; color: #fff; padding: 13px 28px; border-radius: 12px;
	font-size: 0.88rem; font-weight: 600; opacity: 0; visibility: hidden;
	transition: all .32s cubic-bezier(.4,0,.2,1); z-index: 99999;
	box-shadow: 0 10px 30px rgba(0,0,0,.25); pointer-events: none; white-space: nowrap;
}
.psdiha-ch__toast.is-show {
	opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
	.psdiha-wp__title { font-size: 1.4rem; }
}

.psdiha-wp__resize {
	margin: 4px 0 16px;
	padding: 14px;
	background: var(--wp-bg);
	border-radius: 12px;
}
.psdiha-wp__check {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.88rem;
	font-weight: 700;
	color: var(--wp-text);
	cursor: pointer;
	margin-bottom: 12px;
}
.psdiha-wp__check input {
	width: 16px;
	height: 16px;
	accent-color: var(--wp-primary);
}
.psdiha-wp__dims {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	transition: opacity .2s;
}
.psdiha-wp__dims label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--wp-text-2);
}
.psdiha-wp__num {
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	padding: 10px 12px;
	border: 1.5px solid var(--wp-border);
	border-radius: 10px;
	background: var(--wp-surface);
	color: var(--wp-text);
	direction: ltr;
	text-align: center;
}
.psdiha-wp__num:focus {
	outline: none;
	border-color: var(--wp-primary);
	box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.15);
}
.psdiha-wp__dim-hint {
	margin: 10px 0 0;
	font-size: 0.72rem;
	color: var(--wp-text-3);
	line-height: 1.5;
}
@media (max-width: 480px) {
	.psdiha-wp__dims { grid-template-columns: 1fr; }
}
