/**
 * Calculator v2 — paylaş, geçmiş, karşılaştır, yüzde toggle
 */

/* Tema / WP button sıfırlama */
.yhz-widget button.yhz-btn,
.yhz-widget button.yhz-percent-toggle,
.yhz-widget button.yhz-history__item,
.yhz-widget .yhz-history__summary {
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
	text-shadow: none;
	text-transform: none;
	letter-spacing: normal;
}

.yhz-field__control {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.yhz-percent-toggle {
	min-width: 40px;
	min-height: 38px;
	padding: 0 8px;
	border: 1px solid color-mix(in srgb, var(--yhz-primary) 28%, var(--yhz-border));
	border-radius: 8px;
	background: #fff !important;
	color: var(--yhz-primary) !important;
	font: inherit;
	font-size: 0.82rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.yhz-percent-toggle:hover,
.yhz-percent-toggle:focus {
	background: color-mix(in srgb, var(--yhz-primary) 12%, #fff) !important;
	border-color: var(--yhz-primary);
}

.yhz-percent-toggle[aria-pressed="false"] {
	background: color-mix(in srgb, var(--yhz-primary) 8%, #fff) !important;
}

/* Toolbar + karşılaştırma (sekmelerin üstü) */
.yhz-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 14px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--yhz-border);
	background: #fff;
}

.yhz-toolbar__hint {
	margin: 0;
	flex: 1 1 12rem;
	font-size: 0.8rem;
	line-height: 1.4;
	color: var(--yhz-muted);
}

.yhz-btn--compare-toggle.is-active {
	background: color-mix(in srgb, var(--yhz-primary) 12%, #fff) !important;
	border-color: var(--yhz-primary);
	color: var(--yhz-primary-hover) !important;
}

.yhz-compare-wrap {
	padding: 0 14px 14px;
	border-bottom: 1px solid var(--yhz-border);
	background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.yhz-compare-wrap[hidden] {
	display: none !important;
}

.yhz-compare {
	padding: 14px;
	border-radius: 12px;
	border: 1px solid color-mix(in srgb, var(--yhz-primary) 22%, var(--yhz-border));
	background: #fff;
	box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.yhz-compare__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
}

.yhz-compare__title {
	font-size: 0.95rem;
	color: var(--yhz-text);
}

.yhz-compare__help {
	margin: 0 0 12px;
	font-size: 0.8rem;
	line-height: 1.45;
	color: var(--yhz-muted);
}

.yhz-compare__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.yhz-compare__slot {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 14px;
	border-radius: 10px;
	border: 1px solid var(--yhz-border);
	background: #fff;
}

.yhz-compare__slot--a {
	background: linear-gradient(135deg, #eff6ff 0%, #fff 100%);
	border-color: color-mix(in srgb, var(--yhz-primary) 24%, var(--yhz-border));
}

.yhz-compare__slot--b {
	background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
}

.yhz-compare__label {
	display: block;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--yhz-muted);
}

.yhz-compare__value {
	margin: 0;
	font-size: clamp(1.05rem, 3.5vw, 1.35rem);
	font-weight: 800;
	color: var(--yhz-primary);
	line-height: 1.25;
	word-break: break-word;
}

.yhz-compare__note {
	margin: 0;
	font-size: 0.72rem;
	color: var(--yhz-muted);
}

.yhz-btn--compare-pin {
	width: 100%;
	min-height: 40px;
	font-size: 0.85rem;
}

.yhz-btn--compare-pin.is-pinned {
	background: var(--yhz-primary-hover) !important;
}

/* Alt panel: geçmiş */
.yhz-features {
	padding: 14px 16px 16px;
	border-top: 1px solid var(--yhz-border);
	background: #f1f5f9;
}

.yhz-features__hint {
	margin: 12px 0 0;
	padding-top: 10px;
	border-top: 1px dashed color-mix(in srgb, var(--yhz-border) 80%, transparent);
	font-size: 0.75rem;
	color: var(--yhz-muted);
}

.yhz-features__hint kbd {
	display: inline-block;
	padding: 2px 6px;
	border-radius: 4px;
	border: 1px solid var(--yhz-border);
	background: #fff;
	font-size: 0.7rem;
	font-family: inherit;
	color: var(--yhz-text);
}

.yhz-history {
	margin: 0;
	border: 1px solid var(--yhz-border);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 1px 8px rgba(15, 23, 42, 0.04);
	overflow: hidden;
}

.yhz-history__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
	cursor: pointer;
	list-style: none;
	font-weight: 700;
	font-size: 0.9rem;
	color: var(--yhz-text);
	background: #fff !important;
	transition: background 0.15s ease;
}

.yhz-history__summary::-webkit-details-marker {
	display: none;
}

.yhz-history__summary::after {
	content: "▾";
	font-size: 0.75rem;
	color: var(--yhz-muted);
	transition: transform 0.2s ease;
}

.yhz-history[open] .yhz-history__summary::after {
	transform: rotate(180deg);
}

.yhz-history__summary:hover {
	background: #f8fafc !important;
}

.yhz-history__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.35rem;
	padding: 2px 7px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
	background: var(--yhz-primary);
}

.yhz-history__count[hidden] {
	display: none !important;
}

.yhz-history__body {
	padding: 0 12px 12px;
	background: #fff;
}

.yhz-history__empty {
	margin: 0 0 8px;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 0.82rem;
	color: var(--yhz-muted);
	background: #f8fafc;
	border: 1px dashed var(--yhz-border);
}

.yhz-history__empty[hidden] {
	display: none !important;
}

.yhz-history__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.yhz-history__entry {
	margin: 0;
	padding: 0;
	list-style: none;
}

.yhz-history__item {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	width: 100%;
	text-align: left;
	padding: 12px 14px;
	border: 1px solid var(--yhz-border) !important;
	border-radius: 10px;
	background: #fff !important;
	color: var(--yhz-text) !important;
	font: inherit;
	font-size: 0.84rem;
	line-height: 1.4;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.yhz-history__item:hover,
.yhz-history__item:focus {
	border-color: var(--yhz-primary) !important;
	background: #f8fafc !important;
	box-shadow: 0 2px 10px rgba(37, 99, 235, 0.1);
	outline: none;
}

.yhz-history__item-title {
	font-weight: 700;
	font-size: 0.86rem;
	color: var(--yhz-text);
}

.yhz-history__item-inputs {
	font-size: 0.8rem;
	color: var(--yhz-muted);
}

.yhz-history__item-result {
	font-weight: 800;
	font-size: 0.95rem;
	color: var(--yhz-primary);
	font-style: normal;
}

.yhz-history__clear {
	margin-top: 10px;
	width: 100%;
	background: #fff !important;
	color: var(--yhz-muted) !important;
	border-color: var(--yhz-border) !important;
}

.yhz-history__clear:hover {
	color: var(--yhz-error-text) !important;
	border-color: var(--yhz-error-border) !important;
	background: var(--yhz-error-bg) !important;
}

/* Sonuç araçları — düzenli ızgara */
.yhz-calculator__result-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
	max-width: 100%;
}

.yhz-calculator__result-tools .yhz-btn--tool {
	flex: 0 1 auto;
	white-space: nowrap;
}

@media (max-width: 640px) {
	.yhz-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.yhz-toolbar .yhz-btn--compare-toggle {
		width: 100%;
	}

	.yhz-compare__grid {
		grid-template-columns: 1fr;
	}

	.yhz-calculator__result-head {
		flex-direction: column;
		align-items: stretch;
	}

	.yhz-calculator__result-tools {
		justify-content: stretch;
	}

	.yhz-calculator__result-tools .yhz-btn--tool {
		flex: 1 1 calc(50% - 4px);
		min-width: 0;
	}
}

@media print {
	.yhz-intro,
	.yhz-tabs,
	.yhz-toolbar,
	.yhz-compare-wrap,
	.yhz-features,
	.yhz-calculator__actions,
	.yhz-calculator__sentence,
	.yhz-calculator__result-tools {
		display: none !important;
	}

	.yhz-calculator__result-hero {
		border: 1px solid #ccc;
		print-color-adjust: exact;
	}
}
