/**
 * Karesh Hash Generator styles.
 * Uses the same design tokens as the karesh theme / QR tool for visual
 * consistency, with sensible fallbacks if used on a different theme.
 */

.karesh-hash-tool {
	--hash-bg: var( --karesh-bg-soft, #1e1b15 );
	--hash-bg-raised: var( --karesh-bg-soft-2, #262119 );
	--hash-line: var( --karesh-line, #33301f );
	--hash-text: var( --karesh-text, #ede7d9 );
	--hash-text-dim: var( --karesh-text-dim, #a89f88 );
	--hash-amber: var( --karesh-amber, #e0a341 );
	--hash-amber-bright: var( --karesh-amber-bright, #f3bd5e );

	background: var( --hash-bg );
	border: 1px solid var( --hash-line );
	border-radius: 14px;
	padding: 28px;
	max-width: 640px;
	margin: 0 auto;
	direction: rtl;
	text-align: right;
	font-family: inherit;
}

.karesh-hash-tool * {
	box-sizing: border-box;
}

.karesh-hash-input {
	width: 100%;
	min-height: 130px;
	resize: vertical;
	background: var( --hash-bg-raised );
	border: 1px solid var( --hash-line );
	border-radius: 10px;
	color: var( --hash-text );
	font-size: 15px;
	font-family: inherit;
	padding: 14px 16px;
	line-height: 1.6;
	transition: border-color 0.2s ease;
}

.karesh-hash-input:focus {
	outline: none;
	border-color: var( --hash-amber );
}

.karesh-hash-input::placeholder {
	color: var( --hash-text-dim );
}

.karesh-hash-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 8px;
}

.karesh-hash-counter {
	font-size: 12.5px;
	color: var( --hash-text-dim );
	transition: color 0.2s ease;
}

.karesh-hash-counter.is-near-limit {
	color: var( --hash-amber );
	font-weight: 700;
}

.karesh-hash-controls {
	margin-top: 18px;
}

.karesh-hash-controls label {
	display: block;
	font-size: 13px;
	color: var( --hash-text-dim );
	margin-bottom: 6px;
}

.karesh-hash-algo {
	width: 100%;
	background: var( --hash-bg-raised );
	border: 1px solid var( --hash-line );
	border-radius: 10px;
	color: var( --hash-text );
	font-size: 15px;
	font-family: inherit;
	padding: 11px 14px;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.karesh-hash-algo:focus {
	outline: none;
	border-color: var( --hash-amber );
}

.karesh-hash-warning {
	display: none;
	margin-top: 10px;
	font-size: 13px;
	color: var( --hash-text-dim );
	background: rgba(224, 163, 65, 0.08);
	border: 1px solid rgba(224, 163, 65, 0.25);
	border-radius: 8px;
	padding: 9px 14px;
	line-height: 1.6;
}

.karesh-hash-error {
	display: none;
	margin-top: 10px;
	font-size: 13.5px;
	color: #d97757;
	background: rgba(217, 119, 87, 0.1);
	border: 1px solid rgba(217, 119, 87, 0.3);
	border-radius: 8px;
	padding: 10px 14px;
}

.karesh-hash-result-wrap {
	margin-top: 22px;
}

.karesh-hash-result {
	display: none;
	align-items: center;
	gap: 10px;
	background: var( --hash-bg-raised );
	border: 1px solid var( --hash-line );
	border-radius: 10px;
	padding: 14px 16px;
	animation: karesh-hash-pop 0.25s ease;
}

@keyframes karesh-hash-pop {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.karesh-hash-value {
	flex: 1;
	direction: ltr;
	text-align: left;
	font-family: 'Courier New', monospace;
	font-size: 13.5px;
	color: var( --hash-amber-bright );
	word-break: break-all;
	line-height: 1.6;
}

.karesh-hash-empty {
	display: block;
	text-align: center;
	color: var( --hash-text-dim );
	font-size: 13.5px;
	padding: 24px 10px;
	border: 1px dashed var( --hash-line );
	border-radius: 10px;
}

.karesh-hash-copy {
	display: none;
	flex-shrink: 0;
	align-items: center;
	gap: 6px;
	background: var( --hash-amber );
	color: #1a1610;
	border: none;
	font-weight: 700;
	font-size: 13px;
	padding: 8px 16px;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
	white-space: nowrap;
}

.karesh-hash-copy:hover {
	background: var( --hash-amber-bright );
	transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
	.karesh-hash-result {
		animation: none;
	}
	.karesh-hash-copy:hover {
		transform: none;
	}
}

@media (max-width: 480px) {
	.karesh-hash-tool {
		padding: 20px;
	}
	.karesh-hash-result {
		flex-direction: column;
		align-items: stretch;
	}
	.karesh-hash-copy {
		width: 100%;
		justify-content: center;
	}
}
