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

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

.psdiha-ex__header { text-align: center; margin-bottom: 28px; }
.psdiha-ex__title {
	font-size: 1.75rem; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.02em;
}
.psdiha-ex__subtitle {
	font-size: 0.95rem; color: var(--ex-text-2); margin: 0 auto; max-width: 420px; line-height: 1.7;
}

.psdiha-ex__layout { display: flex; flex-direction: column; gap: 20px; }

.psdiha-ex__upload {
	position: relative;
	border: 2px dashed var(--ex-border);
	border-radius: var(--ex-radius);
	background: var(--ex-surface);
	min-height: 200px;
	cursor: pointer;
	transition: border-color .2s, background .2s, box-shadow .2s;
	overflow: hidden;
}
.psdiha-ex__upload:hover,
.psdiha-ex__upload.is-drag {
	border-color: var(--ex-primary);
	background: rgba(91, 91, 214, 0.04);
	box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.08);
}

.psdiha-ex__drop-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 48px 24px;
	color: var(--ex-text-3);
	text-align: center;
}
.psdiha-ex__drop-text {
	margin: 0; font-size: 1rem; font-weight: 700; color: var(--ex-text-2);
}
.psdiha-ex__drop-hint {
	margin: 0; font-size: 0.8rem; color: var(--ex-text-3);
}

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

.psdiha-ex__results {
	background: var(--ex-surface);
	border: 1px solid var(--ex-border);
	border-radius: var(--ex-radius);
	padding: 22px 20px;
	box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}
.psdiha-ex__status {
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--ex-text-2);
	margin-bottom: 14px;
	text-align: center;
}
.psdiha-ex__colors {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 10px;
	margin-bottom: 18px;
}
.psdiha-ex__color {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	padding: 0;
	border: 1.5px solid var(--ex-border);
	border-radius: 12px;
	overflow: hidden;
	background: var(--ex-bg);
	cursor: pointer;
	font-family: inherit;
	transition: transform .15s, box-shadow .15s, border-color .15s;
}
.psdiha-ex__color:hover {
	transform: translateY(-2px);
	border-color: var(--ex-primary);
	box-shadow: 0 6px 16px rgba(0,0,0,.1);
}
.psdiha-ex__swatch {
	display: block;
	height: 64px;
	width: 100%;
}
.psdiha-ex__hex {
	display: block;
	padding: 8px 6px;
	font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-align: center;
	color: var(--ex-text);
	direction: ltr;
}

.psdiha-ex__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}
.psdiha-ex__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 18px;
	font-size: 0.9rem;
	font-weight: 700;
	font-family: inherit;
	border-radius: 10px;
	border: none;
	cursor: pointer;
	transition: all .2s;
	line-height: 1.2;
}
.psdiha-ex__btn--primary {
	background: var(--ex-primary);
	color: #fff;
	flex: 1;
	box-shadow: 0 2px 10px rgba(91, 91, 214, 0.28);
}
.psdiha-ex__btn--primary:hover {
	background: #4a4ac4;
	transform: translateY(-1px);
}
.psdiha-ex__btn--ghost {
	background: var(--ex-surface);
	color: var(--ex-text-2);
	border: 1.5px solid var(--ex-border);
}
.psdiha-ex__btn--ghost:hover {
	background: var(--ex-bg);
	color: var(--ex-text);
}
.psdiha-ex__note {
	margin: 14px 0 0;
	font-size: 0.82rem;
	color: var(--ex-text-3);
	text-align: center;
	line-height: 1.5;
}

.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-ex__title { font-size: 1.4rem; }
	.psdiha-ex__colors { grid-template-columns: repeat(2, 1fr); }
	.psdiha-ex__actions { flex-direction: column; }
}
