/* Modern Industrial Calculator Framework Frontend CSS (Flatsome Optimized) */

.icf-calculator-wrapper {
	background: #ffffff;
	border: 1px solid #dbe2e1;
	border-radius: 8px;
	box-shadow: 0 12px 32px rgba(24, 32, 31, 0.08);
	padding: 28px;
	margin: 25px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1f2937;
	position: relative;
	isolation: isolate;
	clear: both;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.icf-calculator-wrapper *,
.icf-calculator-wrapper *::before,
.icf-calculator-wrapper *::after {
	box-sizing: border-box;
}

.icf-calculator-wrapper::before,
.icf-calculator-wrapper::after {
	content: none !important;
	display: none !important;
}

/* Keep all calculator text consistent without overriding the Dashicons font. */
.icf-calculator-wrapper *:not(.dashicons) {
	font-family: inherit;
}

/* Header Section */
.icf-calc-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding-bottom: 20px;
	border-bottom: 1px solid #f1f5f9;
	margin-bottom: 25px;
	gap: 20px;
}

.icf-calc-header-main {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
}

.icf-calc-icon {
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
	font-size: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #0f766e;
	color: #ffffff;
	border: 1px solid #0b5f59;
	border-radius: 6px;
	box-shadow: 0 5px 12px rgba(15, 118, 110, 0.2);
	line-height: 1;
	overflow: hidden;
}

.icf-calculator-wrapper .dashicons::before {
	position: static !important;
	inset: auto !important;
	display: block !important;
	width: 1em !important;
	height: 1em !important;
	margin: 0 !important;
	transform: none !important;
	background: none !important;
	box-shadow: none !important;
	font-family: dashicons;
	font-style: normal;
	font-weight: 400;
	line-height: 1 !important;
}

.icf-calc-title {
	font-size: 20px;
	font-weight: 700;
	color: #18201f;
	margin: 0 0 4px 0;
	line-height: 1.3;
	letter-spacing: 0;
}

.icf-calc-desc {
	font-size: 13px;
	color: #64748b;
	margin: 0;
	line-height: 1.5;
}

.icf-calc-switcher {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 5px;
	flex: 0 1 320px;
	min-width: 220px;
}

.icf-calc-switcher label {
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
}

.icf-module-select {
	width: auto;
	max-width: 100%;
	height: 40px;
	min-height: 40px;
	padding: 8px 38px 8px 14px;
	border-radius: 8px;
	border: 1px solid #cbd5e1;
	background-color: #f8fafc;
	font-size: 13px;
	line-height: 22px;
	color: #0f172a;
	cursor: pointer;
	outline: none;
	transition: all 0.2s ease;
	vertical-align: middle;
}

.icf-module-select:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Main Grid Body */
.icf-calc-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 30px;
}

.icf-calc-inputs-col,
.icf-calc-results-col {
	min-width: 0;
}

@media (max-width: 850px) {
	.icf-calc-body {
		grid-template-columns: 1fr;
	}
	.icf-calc-header {
		flex-direction: column;
	}
	.icf-calc-switcher {
		align-items: flex-start;
		flex-basis: auto;
		min-width: 0;
		width: 100%;
	}
}

.icf-section-subtitle {
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0;
	color: #263331;
	margin: 0 0 20px 0;
	padding-bottom: 8px;
	border-bottom: 2px solid #e2e8f0;
}

/* Form Inputs */
.icf-field-group {
	margin-bottom: 20px;
}

.icf-field-label-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
}

.icf-field-label-row label {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
	margin: 0;
}

.icf-field-badge {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 700;
	color: #0f766e;
	background: #ecfdf5;
	padding: 2px 10px;
	border-radius: 4px;
	border: 1px solid #a7f3d0;
}

.icf-input-select, .icf-input-number, .icf-input-text, .icf-input-textarea {
	width: 100%;
	padding: 11px 14px;
	border-radius: 8px;
	border: 1px solid #cbd5e1;
	background-color: #ffffff;
	font-size: 14px;
	color: #0f172a;
	transition: all 0.2s ease;
}

/*
 * Flatsome applies a fixed height to native select elements. Combined with
 * the vertical padding above, that height clips the selected option text.
 * Keep an explicit control height and reserve space for the dropdown arrow.
 */
.icf-calculator-wrapper select.icf-input-select {
	display: block;
	height: 44px;
	min-height: 44px;
	padding: 10px 46px 10px 14px;
	line-height: 22px;
	vertical-align: middle;
}

/*
 * Draw our own dropdown indicator so it remains visible even when Flatsome
 * removes the browser's native select arrow.
 */
.icf-calculator-wrapper select.icf-module-select,
.icf-calculator-wrapper select.icf-input-select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 18px 18px;
	cursor: pointer;
}

.icf-calculator-wrapper select.icf-module-select {
	padding-right: 46px;
}

.icf-calculator-wrapper select.icf-module-select:hover,
.icf-calculator-wrapper select.icf-input-select:hover {
	border-color: #94a3b8;
}

.icf-input-select:focus,
.icf-input-number:focus,
.icf-input-text:focus,
.icf-input-textarea:focus {
	border-color: #0f766e;
	box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
	outline: none;
}

.icf-field-help {
	margin: 7px 2px 0;
	color: #64748b;
	font-size: 12px;
	line-height: 1.45;
}

/* Styling Range Sliders */
.icf-range-container {
	position: relative;
	padding: 5px 0;
}

.icf-input-range {
	-webkit-appearance: none;
	width: 100%;
	height: 8px;
	border-radius: 5px;
	background: #e2e8f0;
	outline: none;
	transition: background 0.2s;
}

.icf-input-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #2563eb;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
	border: 3px solid #ffffff;
	transition: transform 0.1s ease;
}

.icf-input-range::-webkit-slider-thumb:hover {
	transform: scale(1.15);
}

/* Results panel */
.icf-results-card {
	background: #18201f;
	color: #ffffff;
	padding: 24px;
	border: 1px solid #263331;
	border-top: 4px solid #d99a22;
	border-radius: 8px;
	box-shadow: 0 10px 24px rgba(24, 32, 31, 0.16);
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

.icf-results-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 0 20px;
	min-width: 0;
}

.icf-result-item {
	min-width: 0;
	padding: 14px 0;
	border: 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.13);
	border-radius: 0;
	background: transparent;
}

.icf-result-primary {
	grid-column: span 2;
	padding-top: 0;
	border-bottom-color: rgba(217, 154, 34, 0.5);
}

.icf-result-wide {
	grid-column: span 2;
}

.icf-result-label {
	display: block;
	font-size: 12px;
	color: #94a3b8;
	margin-bottom: 6px;
	font-weight: 500;
}

.icf-result-value-wrapper {
	display: flex;
	align-items: baseline;
	gap: 6px;
	min-width: 0;
}

.icf-result-value {
	display: block;
	min-width: 0;
	max-width: 100%;
	font-size: 24px;
	font-weight: 800;
	color: #5eead4;
	letter-spacing: 0;
	overflow-wrap: anywhere;
	word-break: normal;
}

.icf-result-primary .icf-result-value {
	font-size: 32px;
	color: #fbbf24;
}

.icf-result-text .icf-result-value-wrapper {
	align-items: flex-start;
}

.icf-result-text .icf-result-value,
.icf-result-primary.icf-result-text .icf-result-value {
	width: 100%;
	white-space: normal;
	font-size: 16px;
	line-height: 1.45;
	letter-spacing: 0;
	overflow-wrap: anywhere;
}

.icf-result-primary.icf-result-text .icf-result-value {
	font-size: 19px;
}

.icf-result-unit {
	font-size: 13px;
	color: #cbd5e1;
	font-weight: 600;
}

/* Visual Progress Chart */
.icf-visual-chart-box {
	background: #111817;
	padding: 12px 16px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.icf-chart-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 12px;
	font-size: 12px;
	color: #94a3b8;
	margin-bottom: 8px;
}

.icf-chart-status-badge {
	flex: 0 0 auto;
	max-width: 100%;
	font-size: 10px;
	font-weight: 700;
	background: #16a34a;
	color: #ffffff;
	padding: 2px 8px;
	border-radius: 4px;
	text-transform: uppercase;
	white-space: normal;
	text-align: center;
}

.icf-chart-progress-bg {
	width: 100%;
	height: 10px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 5px;
	overflow: hidden;
}

.icf-chart-progress-bar {
	height: 100%;
	background: #14b8a6;
	border-radius: 5px;
	transition: width 0.3s ease;
}

.icf-calculation-note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid rgba(56, 189, 248, 0.2);
	border-radius: 8px;
	background: rgba(15, 118, 110, 0.14);
	color: #cbd5e1;
	min-width: 0;
}

.icf-note-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #0f766e;
	color: #ffffff;
	font-size: 12px;
	font-weight: 800;
	line-height: 1;
}

.icf-note-content {
	min-width: 0;
}

.icf-calculation-note p {
	margin: 0;
	font-size: 11px;
	line-height: 1.55;
}

.icf-calculation-note .icf-reference-line {
	margin-top: 6px;
	color: #9fb2ae;
}

.icf-calculation-note strong {
	color: #f8fafc;
}

/* Quote Trigger Button */
.icf-btn-quote-trigger {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: auto !important;
	min-height: 50px;
	margin: 0 !important;
	padding: 12px 18px !important;
	border: 1px solid #0d655e !important;
	border-radius: 6px;
	background: #0f766e !important;
	color: #ffffff !important;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35 !important;
	letter-spacing: 0;
	text-transform: none;
	white-space: normal;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	box-shadow: 0 4px 12px rgba(15, 118, 110, 0.22);
	transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.icf-btn-quote-trigger:hover {
	transform: none;
	border-color: #094f4a !important;
	box-shadow: 0 5px 14px rgba(15, 118, 110, 0.28);
	background: #0b625c !important;
	color: #ffffff !important;
}

.icf-btn-quote-trigger:focus-visible {
	outline: 3px solid rgba(251, 191, 36, 0.45);
	outline-offset: 2px;
}

/* Modal Popup */
.icf-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(15, 23, 42, 0.7);
	backdrop-filter: blur(6px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.icf-modal-content {
	background: #ffffff;
	border-radius: 8px;
	width: 100%;
	max-width: 520px;
	padding: 28px;
	position: relative;
	box-shadow: 0 25px 50px rgba(0,0,0,0.25);
	animation: icfModalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes icfModalPop {
	from { opacity: 0; transform: scale(0.92); }
	to { opacity: 1; transform: scale(1); }
}

.icf-modal-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-height: 40px;
	margin: 0;
	padding: 0;
	position: absolute;
	top: 12px;
	right: 12px;
	background: none;
	border: none;
	font-size: 28px;
	color: #94a3b8;
	cursor: pointer;
}

.icf-modal-close:hover {
	color: #0f172a;
}

.icf-modal-header {
	margin-bottom: 20px;
}

.icf-modal-header h4 {
	font-size: 20px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 6px 0;
}

.icf-modal-header p {
	font-size: 13px;
	color: #64748b;
	margin: 0;
}

.icf-form-group {
	margin-bottom: 16px;
}

.icf-form-group label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #334155;
	margin-bottom: 6px;
}

.icf-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.icf-quote-preview-summary {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	padding: 12px 14px;
	border-radius: 8px;
	font-size: 12px;
	color: #475569;
	margin-bottom: 20px;
	line-height: 1.5;
}

.icf-btn-submit-quote {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 12px;
	background: #0f766e;
	color: #ffffff;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s ease;
}

.icf-btn-submit-quote:hover {
	background: #0b625c;
}

.icf-quote-response-msg {
	margin-top: 15px;
	font-size: 13px;
	text-align: center;
}

@media (max-width: 600px) {
	.icf-calculator-wrapper {
		padding: 18px;
		border-radius: 8px;
	}

	.icf-calc-switcher,
	.icf-module-select {
		width: 100%;
	}

	.icf-results-grid {
		grid-template-columns: 1fr;
	}

	.icf-result-primary,
	.icf-result-wide {
		grid-column: span 1;
	}

	.icf-result-primary .icf-result-value {
		font-size: 27px;
	}

	.icf-result-primary.icf-result-text .icf-result-value {
		font-size: 18px;
	}

	.icf-field-label-row {
		align-items: flex-start;
		flex-wrap: wrap;
	}

	.icf-form-row {
		grid-template-columns: 1fr;
	}

	.icf-chart-header {
		align-items: flex-start;
		gap: 10px;
	}
}
