/* ==========================================================================
   FYFX Payout Calculator Widget
   ========================================================================== */

/* ── CSS Custom Properties (defaults — overridden by Elementor selectors) ─ */

.elementor-widget-fyfx-payout-calculator {
	--fyfx-pc-slider-track:  rgba(255, 255, 255, 0.15);
	--fyfx-pc-slider-fill:   #3b5bfc;
	--fyfx-pc-slider-thumb:  #3b5bfc;
	--fyfx-pc-slider-height: 6px;
	--fyfx-pc-thumb-size:    20px;
	--fill-ratio:            0; /* updated by JS on every input event */
}

/* ── Wrapper ──────────────────────────────────────────────────────────────── */

.fyfx-pc-wrapper {
	display: flex;
	flex-direction: column;
	gap: 20px;
	width: 100%;
	background-color: #050d2d;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 16px;
	padding: 32px;
	box-sizing: border-box;
}

/* ── Section Title ────────────────────────────────────────────────────────── */

.fyfx-pc-title {
	color: #ffffff;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 4px;
	padding: 0;
}

/* ── Field Groups ─────────────────────────────────────────────────────────── */

.fyfx-pc-field-group {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.fyfx-pc-label {
	color: rgba(255, 255, 255, 0.7);
	font-size: 14px;
	font-weight: 400;
}

/* ── Account Size Tabs ────────────────────────────────────────────────────── */

.fyfx-pc-tabs {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}

.fyfx-pc-tab-btn {
	cursor: pointer;
	width: 100%;
	text-align: center;
	border: 1px solid rgba(59, 91, 252, 0.4);
	background-color: transparent;
	color: #ffffff;
	padding: 14px 12px;
	border-radius: 50px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
	box-sizing: border-box;
}

.fyfx-pc-tab-btn:hover {
	background-color: rgba(59, 91, 252, 0.15);
	border-color: rgba(59, 91, 252, 0.7);
}

.fyfx-pc-tab-btn.active {
	background-color: #3b5bfc;
	border-color: #3b5bfc;
	color: #ffffff;
}

/* ── Profit Rate Row ──────────────────────────────────────────────────────── */

.fyfx-pc-rate-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.fyfx-pc-rate-value {
	color: rgba(255, 255, 255, 0.7);
	font-size: 14px;
	font-weight: 500;
}

/* ── Slider ───────────────────────────────────────────────────────────────── */

.fyfx-pc-slider-wrap {
	width: 100%;
}

.fyfx-pc-slider {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: var(--fyfx-pc-slider-height, 6px);
	border-radius: 50px;
	/*
	 * Mirror the browser's thumb-position formula in CSS so the fill edge
	 * always lands exactly at the thumb centre, regardless of screen size:
	 *   fill-point = ratio × (100% − thumbSize) + thumbSize / 2
	 */
	background: linear-gradient(
		to right,
		var(--fyfx-pc-slider-fill, #3b5bfc) 0%,
		var(--fyfx-pc-slider-fill, #3b5bfc)
			calc(
				var(--fill-ratio, 0) * (100% - var(--fyfx-pc-thumb-size, 20px))
				+ var(--fyfx-pc-thumb-size, 20px) / 2
			),
		var(--fyfx-pc-slider-track, rgba(255, 255, 255, 0.15))
			calc(
				var(--fill-ratio, 0) * (100% - var(--fyfx-pc-thumb-size, 20px))
				+ var(--fyfx-pc-thumb-size, 20px) / 2
			),
		var(--fyfx-pc-slider-track, rgba(255, 255, 255, 0.15)) 100%
	);
	outline: none;
	cursor: pointer;
	border: none;
	box-shadow: none;
	margin: 4px 0;
	display: block;
}

/* Remove focus outline/border on all browsers */
.fyfx-pc-slider:focus,
.fyfx-pc-slider:focus-visible,
.fyfx-pc-slider:active {
	outline: none;
	border: none;
	box-shadow: none;
}

/* Firefox: remove the default dotted focus ring on the track */
.fyfx-pc-slider::-moz-focus-outer {
	border: none;
	outline: none;
}

/* Webkit thumb */
.fyfx-pc-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: var(--fyfx-pc-thumb-size, 20px);
	height: var(--fyfx-pc-thumb-size, 20px);
	border-radius: 50%;
	background: var(--fyfx-pc-slider-thumb, #3b5bfc);
	cursor: pointer;
	border: 2px solid #ffffff;
	box-shadow: 0 0 0 2px var(--fyfx-pc-slider-thumb, #3b5bfc);
	transition: box-shadow 0.2s ease;
}

.fyfx-pc-slider::-webkit-slider-thumb:hover {
	box-shadow: 0 0 0 4px rgba(59, 91, 252, 0.35);
}

/* Firefox thumb */
.fyfx-pc-slider::-moz-range-thumb {
	width: var(--fyfx-pc-thumb-size, 20px);
	height: var(--fyfx-pc-thumb-size, 20px);
	border-radius: 50%;
	background: var(--fyfx-pc-slider-thumb, #3b5bfc);
	cursor: pointer;
	border: 2px solid #ffffff;
	box-shadow: 0 0 0 2px var(--fyfx-pc-slider-thumb, #3b5bfc);
}

/* Firefox track */
.fyfx-pc-slider::-moz-range-track {
	height: var(--fyfx-pc-slider-height, 6px);
	border-radius: 50px;
	background: var(--fyfx-pc-slider-track, rgba(255, 255, 255, 0.15));
}

.fyfx-pc-slider::-moz-range-progress {
	height: var(--fyfx-pc-slider-height, 6px);
	border-radius: 50px;
	background: var(--fyfx-pc-slider-fill, #3b5bfc);
}

/* ── Payout Output ────────────────────────────────────────────────────────── */

.fyfx-pc-output-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
}

.fyfx-pc-output-label {
	color: rgba(255, 255, 255, 0.7);
	font-size: 14px;
	font-weight: 400;
}

.fyfx-pc-output-amount {
	display: flex;
	align-items: baseline;
	gap: 6px;
}

.fyfx-pc-amount {
	color: #3b5bfc;
	font-size: 52px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -1px;
}

.fyfx-pc-suffix {
	color: rgba(255, 255, 255, 0.7);
	font-size: 18px;
	font-weight: 400;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
	.fyfx-pc-wrapper {
		padding: 24px 20px;
	}

	.fyfx-pc-title {
		font-size: 22px;
	}

	.fyfx-pc-tabs {
		grid-template-columns: repeat(2, 1fr);
	}

	.fyfx-pc-amount {
		font-size: 40px;
	}
}
