/**
 * Silage Trench Calculator Styles
 */
.techkorm-silage-trench-calculator {
	max-width: 1000px;
	margin: 20px auto;
	background: #fff;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Header */
#techkorm-silage-trench-calculator .tk-st-header h2 {
	text-align: center;
	margin-bottom: 10px;
	font-size: 1.4em;
}

#techkorm-silage-trench-calculator .tk-st-header .tk-st-subtitle {
	text-align: center;
	margin-bottom: 30px;
	font-size: 1.05em;
	color: #555;
}

/* Main Section: Params + Diagram */
#techkorm-silage-trench-calculator .tk-st-main-section {
	display: flex;
	gap: 30px;
	margin-bottom: 30px;
	align-items: stretch;
}

#techkorm-silage-trench-calculator .tk-st-params-col {
	flex: 0.95;
	min-width: 0;
	padding: 20px;
	background: #f9f9f9;
	border-radius: 8px;
}

#techkorm-silage-trench-calculator .tk-st-params-col h3 {
	margin-bottom: 20px;
	font-size: 1.2em;
	color: #444;
	text-align: center;
	border-bottom: 2px solid #ddd;
	padding-bottom: 12px;
}

#techkorm-silage-trench-calculator .tk-st-diagram-col {
	flex: 1.25;
	min-width: 0;
	padding: 12px;
	background: #fafafa;
	border-radius: 8px;
	position: relative;
}

#techkorm-silage-trench-calculator .tk-st-diagram-sticky {
	/* CSS sticky as primary */
	position: -webkit-sticky;
	position: sticky;
	top: 110px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: top 0.1s;
}

/* Form */
#techkorm-silage-trench-calculator .tk-form-group {
	margin-bottom: 15px;
}

#techkorm-silage-trench-calculator .tk-form-actions {
	margin-top: 20px;
	display: flex;
	align-items: center;
	gap: 15px;
	flex-wrap: wrap;
}

#techkorm-silage-trench-calculator .tk-btn-primary {
	background: #b8d717;
	color: #333;
	border: none;
	padding: 12px 24px;
	font-size: 1em;
	font-weight: 600;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.2s;
}

#techkorm-silage-trench-calculator .tk-btn-primary:hover {
	background: #a5c215;
}

#techkorm-silage-trench-calculator .tk-btn-primary:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

#techkorm-silage-trench-calculator .tk-loader {
	width: 24px;
	height: 24px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #b8d717;
	border-radius: 50%;
	animation: tk-spin 1s linear infinite;
}

@keyframes tk-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

#techkorm-silage-trench-calculator .tk-error-message {
	flex-basis: 100%;
	color: #d32f2f;
	font-size: 0.9em;
	font-weight: 500;
}

#techkorm-silage-trench-calculator .tk-input-error {
	border-color: #ff0000 !important;
	box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.1) !important;
}

#techkorm-silage-trench-calculator .tk-form-group label {
	display: block;
	font-weight: 500;
	font-size: 0.95em;
}

#techkorm-silage-trench-calculator .tk-input {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 1em;
	box-sizing: border-box;
	background: #fffef0;
}

#techkorm-silage-trench-calculator .tk-input:focus {
	border-color: #b8d717;
	outline: none;
	box-shadow: 0 0 0 2px rgba(184, 215, 23, 0.1);
}

#techkorm-silage-trench-calculator .tk-field-hint {
	display: block;
	margin-top: 5px;
	font-size: 0.85em;
	color: #666;
	font-style: italic;
	line-height: 1.5;
}

/* Presets */
#techkorm-silage-trench-calculator .tk-presets-buttons {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

#techkorm-silage-trench-calculator .tk-btn-preset {
	border: none;
	padding: 8px 12px;
	cursor: pointer;
	border-radius: 4px;
	color: #fff;
	font-size: 0.85em;
	transition: opacity 0.2s;
}

#techkorm-silage-trench-calculator .tk-btn-preset:after {
	content: '';
	display: none;
}

#techkorm-silage-trench-calculator .tk-btn-preset:hover {
	opacity: 0.9;
}

#techkorm-silage-trench-calculator .tk-preset-corn {
	background: #f57c00;
}

#techkorm-silage-trench-calculator .tk-preset-grass {
	background: #388e3c;
}

#techkorm-silage-trench-calculator .tk-preset-grain {
	background: #5d4037;
}

#techkorm-silage-trench-calculator .tk-btn-preset.active {
	box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5);
}

/* Highlight effect for preset autofill */
@keyframes tk-st-highlight {
	0% { background-color: #fffef0; }
	50% { background-color: #fff3cd; }
	100% { background-color: #fffef0; }
}

#techkorm-silage-trench-calculator .tk-input.highlight {
	animation: tk-st-highlight 1s ease-in-out;
}

/* Diagram */
#techkorm-silage-trench-calculator .tk-st-diagram {
	display: block;
	max-width: 100%;
	width: 100%;
	max-height: min(90vh, 880px);
	height: auto;
	margin: 0 auto;
}

#techkorm-silage-trench-calculator .tk-st-wall {
	fill: none;
	stroke: #1a1a1a;
	stroke-width: 4;
	stroke-linejoin: round;
	stroke-linecap: round;
}

#techkorm-silage-trench-calculator .tk-st-wall-dash {
	fill: none;
	stroke: #555;
	stroke-width: 1.2;
	stroke-dasharray: 5 4;
	stroke-linejoin: round;
}

#techkorm-silage-trench-calculator .tk-st-dim {
	fill: none;
	stroke: #333;
	stroke-width: 1;
	marker-end: url(#tkstArrowEnd);
	marker-start: url(#tkstArrowStart);
}

#techkorm-silage-trench-calculator .tk-st-dim-cap {
	fill: none;
	stroke: #333;
	stroke-width: 0.9;
	marker-end: url(#tkstArrowEnd);
	marker-start: url(#tkstArrowStart);
}

#techkorm-silage-trench-calculator .tk-st-tag-label {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 11px;
	font-weight: 600;
	fill: #ad1457;
}

#techkorm-silage-trench-calculator .tk-st-tag-bg {
	fill: #ff4da6;
	stroke: #e91e8c;
	stroke-width: 0.5;
}

#techkorm-silage-trench-calculator .tk-st-tag-val {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 10px;
	font-weight: 700;
	fill: #fff;
	text-anchor: middle;
}

/* Results Section */
#techkorm-silage-trench-calculator .tk-st-results-section {
	margin-top: 20px;
}

#techkorm-silage-trench-calculator .tk-st-results-title {
	color: #ff0000;
	font-weight: bold;
	font-size: 1.3em;
	margin-bottom: 15px;
}

#techkorm-silage-trench-calculator .tk-st-result-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

#techkorm-silage-trench-calculator .tk-st-result-label {
	font-weight: 500;
	flex: 1;
	min-width: 200px;
}

#techkorm-silage-trench-calculator .tk-st-result-sub {
	display: block;
	font-weight: normal;
	font-size: 0.9em;
	color: #666;
	font-style: italic;
}

#techkorm-silage-trench-calculator .tk-st-result-value {
	background: #2e7d32;
	color: #fff;
	padding: 10px 20px;
	border-radius: 4px;
	font-weight: 600;
	min-width: 100px;
	text-align: right;
}

/* Responsive */
@media (max-width: 991px) {
	#techkorm-silage-trench-calculator .tk-st-main-section {
		flex-direction: column;
	}

	#techkorm-silage-trench-calculator .tk-st-diagram-col {
		min-height: 320px;
	}

	#techkorm-silage-trench-calculator .tk-st-result-row {
		flex-direction: column;
		align-items: flex-start;
	}

	#techkorm-silage-trench-calculator .tk-st-result-value {
		width: 90%;
		text-align: left;
	}
}
