/**
 * Matematik Araçları
 * Public CSS
 */

.phmath-math-tools {
	--phmath-primary: #2563eb;
	--phmath-primary-dark: #1d4ed8;
	--phmath-secondary: #7c3aed;
	--phmath-success: #059669;
	--phmath-warning: #d97706;
	--phmath-danger: #dc2626;
	--phmath-bg: #f8fafc;
	--phmath-card: #ffffff;
	--phmath-border: #e2e8f0;
	--phmath-text: #0f172a;
	--phmath-muted: #64748b;
	--phmath-radius: 20px;

	width: 100%;
	max-width: 1100px;
	margin: 30px auto;
	background: var(--phmath-card);
	border: 1px solid var(--phmath-border);
	border-radius: 28px;
	box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
	overflow: hidden;
	color: var(--phmath-text);
	font-family: inherit;
	box-sizing: border-box;
}

.phmath-math-tools *,
.phmath-math-tools *::before,
.phmath-math-tools *::after {
	box-sizing: border-box;
}

/* Header */

.phmath-math-tools__header {
	padding: 38px 40px 30px;
	background:
		radial-gradient(
			circle at top right,
			rgba(124, 58, 237, 0.12),
			transparent 38%
		),
		linear-gradient(
			135deg,
			#eff6ff 0%,
			#ffffff 48%,
			#faf5ff 100%
		);
	border-bottom: 1px solid var(--phmath-border);
}

.phmath-math-tools__title-wrap {
	max-width: 760px;
}

.phmath-math-tools__eyebrow {
	display: inline-flex;
	align-items: center;
	padding: 7px 12px;
	margin-bottom: 14px;
	border-radius: 999px;
	background: rgba(37, 99, 235, 0.1);
	color: var(--phmath-primary);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.phmath-math-tools__title {
	margin: 0;
	font-size: clamp(28px, 5vw, 46px);
	line-height: 1.08;
	font-weight: 800;
	letter-spacing: -0.035em;
	color: var(--phmath-text);
}

.phmath-math-tools__description {
	margin: 16px 0 0;
	max-width: 700px;
	font-size: 16px;
	line-height: 1.7;
	color: var(--phmath-muted);
}

/* Tabs */

.phmath-math-tools__tabs {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	padding: 18px;
	background: var(--phmath-bg);
	border-bottom: 1px solid var(--phmath-border);
}

.phmath-math-tools__tab {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	min-height: 52px;
	padding: 10px 15px;
	border: 1px solid var(--phmath-border);
	border-radius: 14px;
	background: #ffffff;
	color: var(--phmath-text);
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition:
		transform 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		background 0.2s ease;
}

.phmath-math-tools__tab:hover {
	transform: translateY(-1px);
	border-color: #bfdbfe;
	box-shadow: 0 7px 20px rgba(37, 99, 235, 0.08);
}

.phmath-math-tools__tab.is-active {
	background: linear-gradient(
		135deg,
		var(--phmath-primary),
		var(--phmath-secondary)
	);
	border-color: transparent;
	color: #ffffff;
	box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
}

.phmath-math-tools__tab-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 9px;
	background: #eff6ff;
	color: var(--phmath-primary);
	font-size: 16px;
	font-weight: 800;
}

.phmath-math-tools__tab.is-active .phmath-math-tools__tab-icon {
	background: rgba(255, 255, 255, 0.18);
	color: #ffffff;
}


/* =========================================================
   ÜST SEKME TASARIMI - GÖRSEL REFERANSA YAKIN
   ========================================================= */

.phmath-math-tools__tabs {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	padding: 24px;
	background: #ffffff;
	border-bottom: 1px solid #e5e7eb;
}

.phmath-math-tools__tab {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;

	min-height: 92px;
	padding: 18px 22px;

	border: 2px solid #3b82f6 !important;
	border-radius: 20px !important;

	background: #ffffff !important;

	color: #2563eb !important;

	font-family: inherit;
	font-size: 17px !important;
	font-weight: 800 !important;

	cursor: pointer;

	box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);

	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease,
		border-color 0.2s ease,
		background 0.2s ease;
}

/* Tema yazı rengini bozmasın */
.phmath-math-tools__tab span:not(.phmath-math-tools__tab-icon) {
	color: #2563eb !important;
	font-weight: 800 !important;
	opacity: 1 !important;
	visibility: visible !important;
}

/* Hover */
.phmath-math-tools__tab:hover {
	transform: translateY(-2px);

	background: #f8fbff !important;
	border-color: #2563eb !important;

	color: #1d4ed8 !important;

	box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.phmath-math-tools__tab:hover span:not(.phmath-math-tools__tab-icon) {
	color: #1d4ed8 !important;
}

/* Aktif sekme */
.phmath-math-tools__tab.is-active {
	background: linear-gradient(
		135deg,
		#2563eb 0%,
		#4f46e5 50%,
		#7c3aed 100%
	) !important;

	border-color: transparent !important;

	color: #ffffff !important;

	box-shadow:
		0 14px 30px rgba(79, 70, 229, 0.25),
		0 6px 16px rgba(124, 58, 237, 0.18);
}

.phmath-math-tools__tab.is-active span:not(.phmath-math-tools__tab-icon) {
	color: #ffffff !important;
}

/* İkon kutusu */
.phmath-math-tools__tab-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	width: 48px;
	height: 48px;

	flex: 0 0 48px;

	border-radius: 14px;

	background: #eff6ff !important;

	color: #2563eb !important;

	font-size: 22px !important;
	font-weight: 900 !important;

	box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.03);
}

/* Aktif sekme ikon */
.phmath-math-tools__tab.is-active .phmath-math-tools__tab-icon {
	background: rgba(255, 255, 255, 0.18) !important;
	color: #ffffff !important;
}

/* =========================================================
   HEADER GÖRSELDEKİ GİBİ DAHA FERAH
   ========================================================= */

.phmath-math-tools__header {
	position: relative;

	padding: 46px 52px 40px;

	background:
		radial-gradient(
			circle at 85% 20%,
			rgba(196, 181, 253, 0.28),
			transparent 28%
		),
		radial-gradient(
			circle at 70% 100%,
			rgba(219, 234, 254, 0.35),
			transparent 34%
		),
		linear-gradient(
			135deg,
			#ffffff 0%,
			#f8fbff 52%,
			#faf5ff 100%
		);

	border-bottom: 1px solid #e5e7eb;
}

.phmath-math-tools__title {
	margin: 0;

	color: #0f172a !important;

	font-size: clamp(36px, 5vw, 58px) !important;
	line-height: 1.05 !important;
	font-weight: 900 !important;
	letter-spacing: -0.045em !important;
}

.phmath-math-tools__description {
	margin-top: 18px;

	max-width: 900px;

	color: #64748b !important;

	font-size: 17px !important;
	line-height: 1.7 !important;
}

/* Eğer üstte PHMath Matematik Araçları etiketi istemiyorsan gizler */
.phmath-math-tools__eyebrow {
	display: none !important;
}

/* =========================================================
   ANA GÖVDE
   ========================================================= */

.phmath-math-tools__body {
	padding: 38px 32px 46px;

	background: #f8fafc;
}

.phmath-tool-panel {
	padding: 28px;

	background: #ffffff;

	border: 1px solid #e2e8f0;
	border-radius: 24px;

	box-shadow: 0 12px 35px rgba(15, 23, 42, 0.05);
}

/* Başlık kısmı */
.phmath-tool-panel__intro {
	display: flex;
	align-items: center;
	gap: 22px;

	margin-bottom: 28px;
}

.phmath-tool-panel__number {
	display: flex;
	align-items: center;
	justify-content: center;

	width: 68px;
	height: 68px;

	flex: 0 0 68px;

	border-radius: 20px;

	background: linear-gradient(
		135deg,
		#faf5ff,
		#eef2ff
	);

	color: #7c3aed !important;

	font-size: 28px !important;
	font-weight: 900 !important;
}

.phmath-tool-panel__intro h3 {
	margin: 0 0 8px;

	color: #0f172a !important;

	font-size: 28px !important;
	font-weight: 900 !important;
	line-height: 1.2;
}

.phmath-tool-panel__intro p {
	margin: 0;

	color: #64748b !important;

	font-size: 16px !important;
	line-height: 1.65;
}

/* =========================================================
   FORM KARTI
   ========================================================= */

.phmath-tool-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 28px;
	align-items: end;

	padding: 28px;

	background: #ffffff;

	border: 1px solid #e2e8f0;
	border-radius: 22px;

	box-shadow: 0 8px 26px rgba(15, 23, 42, 0.035);
}

.phmath-tool-form--two-fields {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 340px;
}

.phmath-field label {
	margin-bottom: 8px;

	color: #0f172a !important;

	font-size: 16px !important;
	font-weight: 800 !important;
}

.phmath-input {
	height: 68px !important;

	padding: 0 22px !important;

	border: 1px solid #cbd5e1 !important;
	border-radius: 16px !important;

	background: #ffffff !important;

	color: #0f172a !important;

	font-size: 18px !important;
	font-weight: 600 !important;

	box-shadow: none !important;
}

.phmath-input::placeholder {
	color: #94a3b8 !important;
	font-weight: 500 !important;
}

.phmath-input:focus {
	border-color: #3b82f6 !important;

	box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
}

/* =========================================================
   ANA HESAPLA BUTONLARI
   ========================================================= */

.phmath-math-tools .phmath-button--primary {
	min-height: 68px;

	padding: 0 30px;

	border: none !important;
	border-radius: 16px !important;

	background: linear-gradient(
		135deg,
		#2563eb 0%,
		#4f46e5 50%,
		#7c3aed 100%
	) !important;

	color: #ffffff !important;

	font-size: 18px !important;
	font-weight: 900 !important;

	box-shadow:
		0 12px 24px rgba(37, 99, 235, 0.2),
		0 6px 12px rgba(124, 58, 237, 0.15);

	text-shadow: none !important;
}

.phmath-math-tools .phmath-button--primary:hover,
.phmath-math-tools .phmath-button--primary:focus,
.phmath-math-tools .phmath-button--primary:active {
	background: linear-gradient(
		135deg,
		#1d4ed8 0%,
		#4338ca 50%,
		#6d28d9 100%
	) !important;

	color: #ffffff !important;

	transform: translateY(-2px);

	box-shadow:
		0 16px 30px rgba(37, 99, 235, 0.25),
		0 8px 18px rgba(124, 58, 237, 0.18);
}

/* =========================================================
   MOBİL
   ========================================================= */

@media (max-width: 900px) {

	.phmath-math-tools__tabs {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.phmath-tool-form,
	.phmath-tool-form--two-fields {
		grid-template-columns: 1fr;
	}

	.phmath-math-tools .phmath-button--primary {
		width: 100%;
	}

}

@media (max-width: 600px) {

	.phmath-math-tools__header {
		padding: 30px 22px;
	}

	.phmath-math-tools__tabs {
		gap: 10px;
		padding: 14px;
	}

	.phmath-math-tools__tab {
		min-height: 78px;
		padding: 12px 10px;

		font-size: 13px !important;
	}

	.phmath-math-tools__tab-icon {
		width: 38px;
		height: 38px;
		flex-basis: 38px;

		font-size: 17px !important;
	}

	.phmath-math-tools__body {
		padding: 20px 14px 28px;
	}

	.phmath-tool-panel {
		padding: 20px;
	}

	.phmath-tool-panel__number {
		width: 52px;
		height: 52px;
		flex-basis: 52px;

		font-size: 21px !important;
	}

	.phmath-tool-panel__intro h3 {
		font-size: 22px !important;
	}

	.phmath-tool-form {
		padding: 18px;
	}

	.phmath-input,
	.phmath-math-tools .phmath-button--primary {
		height: 58px !important;
		min-height: 58px;
	}

}



/* Body */

.phmath-math-tools__body {
	padding: 35px 40px 42px;
	background: #ffffff;
}

.phmath-tool-panel {
	display: none;
}

.phmath-tool-panel.is-active {
	display: block;
	animation: phmathFadeIn 0.25s ease;
}

@keyframes phmathFadeIn {
	from {
		opacity: 0;
		transform: translateY(4px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Tool intro */

.phmath-tool-panel__intro {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	margin-bottom: 30px;
}

.phmath-tool-panel__number {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	border-radius: 18px;
	background: linear-gradient(
		135deg,
		#dbeafe,
		#ede9fe
	);
	color: var(--phmath-primary);
	font-size: 15px;
	font-weight: 800;
}

.phmath-tool-panel__intro h3 {
	margin: 1px 0 7px;
	font-size: 24px;
	line-height: 1.25;
	color: var(--phmath-text);
}

.phmath-tool-panel__intro p {
	margin: 0;
	max-width: 700px;
	color: var(--phmath-muted);
	font-size: 15px;
	line-height: 1.7;
}

/* Form */

.phmath-tool-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 15px;
	align-items: end;
	padding: 22px;
	border: 1px solid var(--phmath-border);
	border-radius: var(--phmath-radius);
	background: var(--phmath-bg);
}

.phmath-tool-form--two-fields {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.phmath-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.phmath-field label {
	font-size: 13px;
	font-weight: 700;
	color: #334155;
}

.phmath-input {
	width: 100%;
	height: 52px;
	padding: 0 16px;
	border: 1px solid #cbd5e1 !important;
	border-radius: 13px !important;
	background: #ffffff !important;
	box-shadow: none !important;
	outline: none;
	color: var(--phmath-text) !important;
	font-family: inherit;
	font-size: 16px !important;
	font-weight: 600;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.phmath-input:focus {
	border-color: var(--phmath-primary) !important;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1) !important;
}

.phmath-input::placeholder {
	color: #94a3b8;
	font-weight: 400;
}

/* Buttons */

.phmath-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 22px;
	border: 0;
	border-radius: 13px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 800;
	cursor: pointer;
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease,
		opacity 0.2s ease;
}

.phmath-button:hover {
	transform: translateY(-1px);
}

.phmath-button--primary {
	background: linear-gradient(
		135deg,
		var(--phmath-primary),
		var(--phmath-secondary)
	);
	color: #ffffff;
	box-shadow: 0 9px 20px rgba(37, 99, 235, 0.18);
}

.phmath-button--primary:hover {
	box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
}

.phmath-button--secondary {
	background: #eef2ff;
	color: #4338ca;
}

.phmath-button--ghost {
	background: #ffffff;
	border: 1px solid var(--phmath-border);
	color: #475569;
}

/* Result */

.phmath-result {
	margin-top: 24px;
}

.phmath-result[hidden] {
	display: none !important;
}

.phmath-result-card {
	padding: 24px;
	border: 1px solid var(--phmath-border);
	border-radius: var(--phmath-radius);
	background: #ffffff;
	box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.phmath-result-card__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 22px;
}

.phmath-result-card__label {
	display: block;
	margin-bottom: 5px;
	color: var(--phmath-muted);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.phmath-result-card__title {
	margin: 0;
	font-size: 24px;
	line-height: 1.25;
	color: var(--phmath-text);
}

.phmath-result-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.phmath-result-box {
	padding: 17px;
	border-radius: 15px;
	background: var(--phmath-bg);
	border: 1px solid var(--phmath-border);
}

.phmath-result-box--full {
	grid-column: 1 / -1;
}

.phmath-result-box__label {
	display: block;
	margin-bottom: 7px;
	color: var(--phmath-muted);
	font-size: 12px;
	font-weight: 700;
}

.phmath-result-box__value {
	color: var(--phmath-text);
	font-size: 16px;
	font-weight: 800;
	line-height: 1.65;
	word-break: break-word;
}

.phmath-number-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.phmath-number-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 38px;
	padding: 6px 11px;
	border-radius: 11px;
	background: #eff6ff;
	color: #1d4ed8;
	font-size: 14px;
	font-weight: 800;
}

.phmath-prime-status {
	display: inline-flex;
	align-items: center;
	padding: 8px 12px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 800;
}

.phmath-prime-status--yes {
	background: #ecfdf5;
	color: #047857;
}

.phmath-prime-status--no {
	background: #fff7ed;
	color: #c2410c;
}

/* Result actions */

.phmath-result-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
}

/* Solution */

.phmath-solution {
	margin-top: 18px;
	padding: 20px;
	border-radius: 16px;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
}

.phmath-solution[hidden] {
	display: none;
}

.phmath-solution__title {
	margin: 0 0 14px;
	font-size: 17px;
	color: var(--phmath-text);
}

.phmath-solution-step {
	padding: 9px 0;
	border-bottom: 1px solid #e2e8f0;
	color: #334155;
	font-size: 15px;
	line-height: 1.7;
}

.phmath-solution-step:last-child {
	border-bottom: 0;
}

.phmath-equation {
	display: inline-block;
	padding: 7px 11px;
	border-radius: 9px;
	background: #ffffff;
	border: 1px solid var(--phmath-border);
	font-weight: 800;
	color: #1e293b;
}

/* Error */

.phmath-error {
	padding: 16px 18px;
	border-radius: 14px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	font-size: 14px;
	font-weight: 700;
}

/* Footer */

.phmath-math-tools__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	padding: 16px 40px;
	border-top: 1px solid var(--phmath-border);
	background: var(--phmath-bg);
	color: var(--phmath-muted);
	font-size: 12px;
}

.phmath-math-tools__footer a {
	color: var(--phmath-primary);
	font-weight: 700;
	text-decoration: none;
}

.phmath-math-tools__footer a:hover {
	text-decoration: underline;
}

/* Responsive */

@media (max-width: 850px) {

	.phmath-math-tools__tabs {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.phmath-tool-form,
	.phmath-tool-form--two-fields {
		grid-template-columns: 1fr 1fr;
	}

	.phmath-tool-form .phmath-button {
		grid-column: 1 / -1;
	}

}

@media (max-width: 600px) {

	.phmath-math-tools {
		margin: 15px auto;
		border-radius: 20px;
	}

	.phmath-math-tools__header {
		padding: 27px 20px 24px;
	}

	.phmath-math-tools__tabs {
		grid-template-columns: 1fr 1fr;
		padding: 12px;
		gap: 8px;
	}

	.phmath-math-tools__tab {
		flex-direction: column;
		gap: 5px;
		min-height: 72px;
		font-size: 12px;
	}

	.phmath-math-tools__body {
		padding: 26px 18px 30px;
	}

	.phmath-tool-panel__intro {
		gap: 13px;
	}

	.phmath-tool-panel__number {
		width: 44px;
		height: 44px;
		border-radius: 14px;
	}

	.phmath-tool-panel__intro h3 {
		font-size: 20px;
	}

	.phmath-tool-form,
	.phmath-tool-form--two-fields {
		grid-template-columns: 1fr;
		padding: 16px;
	}

	.phmath-tool-form .phmath-button {
		grid-column: auto;
		width: 100%;
	}

	.phmath-result-card {
		padding: 18px;
	}

	.phmath-result-card__top {
		flex-direction: column;
	}

	.phmath-result-grid {
		grid-template-columns: 1fr;
	}

	.phmath-result-box--full {
		grid-column: auto;
	}

	.phmath-math-tools__footer {
		padding: 15px 20px;
	}

}
/* Buton yazı renklerini tema CSS'ine karşı sabitle */

.phmath-math-tools .phmath-button,
.phmath-math-tools .phmath-button:visited,
.phmath-math-tools .phmath-button:focus,
.phmath-math-tools .phmath-button:active {
	color: #ffffff !important;
	text-decoration: none !important;
}

.phmath-math-tools .phmath-button--primary,
.phmath-math-tools .phmath-button--primary:visited,
.phmath-math-tools .phmath-button--primary:focus,
.phmath-math-tools .phmath-button--primary:active {
	color: #ffffff !important;
}

.phmath-math-tools .phmath-button--secondary,
.phmath-math-tools .phmath-button--secondary:visited,
.phmath-math-tools .phmath-button--secondary:focus,
.phmath-math-tools .phmath-button--secondary:active {
	color: #4338ca !important;
}

.phmath-math-tools .phmath-button--ghost,
.phmath-math-tools .phmath-button--ghost:visited,
.phmath-math-tools .phmath-button--ghost:focus,
.phmath-math-tools .phmath-button--ghost:active {
	color: #475569 !important;
}

/* Hover durumlarında da okunabilirlik sabit kalsın */

.phmath-math-tools .phmath-button--primary:hover {
	color: #ffffff !important;
}

.phmath-math-tools .phmath-button--secondary:hover {
	color: #3730a3 !important;
}

.phmath-math-tools .phmath-button--ghost:hover {
	color: #1e293b !important;
}