﻿body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background-color: #1a1a1a;
	color: #e4e6ea;
	margin: 0;
	padding: 20px;
}

.container {
	max-width: 1400px;
	margin: 0 auto;
	background-color: #242526;
	padding: 2rem;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

h1 {
	color: #e4e6ea;
	text-align: center;
	border-bottom: 2px solid #3a3b3c;
	padding-bottom: 0.5em;
}

h2 {
	color: #e4e6ea;
	margin-top: 0;
}

.section {
	margin-bottom: 2rem;
	border-bottom: 1px solid #3a3b3c;
	padding-bottom: 1.5rem;
}

	.section:last-of-type {
		border-bottom: none;
		padding-bottom: 0;
	}

.input-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 0.5rem;
}

/* New stats grid for the main stat section */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 1rem;
	min-height: fit-content;
}

.priority-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
}

.mod-grid {
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* New styles for custom armor section */
.custom-armor-section {
	margin-top: 1rem;
	padding: 1rem;
	background-color: #2d2e30;
	border-radius: 6px;
	border: 1px solid #3a3b3c;
}

.custom-armor-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 1rem;
	margin-top: 1rem;
}

.input-group {
	display: flex;
	flex-direction: column;
	min-width: 0; /* Prevents overflow */
}

	.input-group label {
		font-weight: bold;
		margin-bottom: 0.5em;
		color: #b0b3b8;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.input-group input, .input-group select {
		padding: 0.8em;
		border: 1px solid #3a3b3c;
		border-radius: 4px;
		font-size: 1rem;
		width: 100%;
		box-sizing: border-box;
		background-color: #3a3b3c;
		color: #e4e6ea;
		min-width: 0;
	}

		.input-group input:focus, .input-group select:focus {
			border-color: #1877f2;
			outline: none;
			box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
		}

.stat-controls {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.stat-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

	.stat-row input {
		flex: 1;
		min-width: 60px;
	}

	.stat-row select {
		flex: 1;
		min-width: 100px;
	}

.priority-high {
	color: #42b883;
	font-weight: bold;
}

.priority-low {
	color: #f56565;
	font-weight: bold;
}

.priority-normal {
	color: #9ca3af;
}

button {
	display: block;
	width: 100%;
	padding: 1em;
	font-size: 1.1rem;
	font-weight: bold;
	color: #fff;
	background-color: #1877f2;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s, box-shadow 0.2s;
	margin-top: 1rem;
}

	button:hover {
		background-color: #166fe5;
		box-shadow: 0 2px 8px rgba(24, 119, 242, 0.4);
	}

	button:disabled {
		background-color: #5a5a5a;
		cursor: not-allowed;
		opacity: 0.5;
	}

#results-container {
	margin-top: 2rem;
}

.solution {
	background-color: #2f3136;
	border: 1px solid #3a3b3c;
	border-radius: 6px;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

	.solution h3 {
		margin-top: 0;
		color: #5dade2;
		border-bottom: 1px solid #3a3b3c;
		padding-bottom: 0.5rem;
		margin-bottom: 1rem;
	}

.solution-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
}

.solution-column h4 {
	margin-top: 0;
	color: #e4e6ea;
}

.solution ul {
	list-style-type: none;
	padding-left: 0;
	margin: 0;
}

.solution li {
	font-size: 0.95rem;
	line-height: 1.6;
	margin-bottom: 0.5rem;
	color: #b0b3b8;
}

.piece-stats {
	font-size: 0.85rem;
	color: #8a8d93;
	margin-left: 1rem;
}

.stats-breakdown {
	margin-top: 1.5rem;
	padding-top: 1rem;
	border-top: 1px solid #3a3b3c;
}

	.stats-breakdown p {
		background-color: #3a3b3c;
		padding: 0.8em;
		border-radius: 4px;
		margin: 0.5em 0;
		font-weight: 500;
		font-size: 0.9rem;
		letter-spacing: 0.5px;
		color: #e4e6ea;
	}

		.stats-breakdown p:first-child {
			background-color: #36373a;
		}

	.stats-breakdown strong {
		color: #ffffff;
	}

.mods-breakdown {
	background-color: #3d3424;
	border: 1px solid #5a4a2a;
	border-radius: 4px;
	padding: 1rem;
	margin: 1rem 0;
}

	.mods-breakdown h4 {
		margin-top: 0;
		color: #f1c40f;
	}

.mod-item {
	display: flex;
	justify-content: space-between;
	padding: 0.3rem 0;
	border-bottom: 1px solid #5a4a2a;
	flex-wrap: wrap;
	color: #e4e6ea;
}

	.mod-item:last-child {
		border-bottom: none;
	}

.tuning-mod {
	color: #bb86fc;
	font-style: italic;
}

.final-stats {
	background-color: #1e3a2e;
	border: 1px solid #2d5a3d;
	border-radius: 4px;
	padding: 1rem;
	margin: 1rem 0;
}

	.final-stats h4 {
		margin-top: 0;
		color: #4caf50;
	}

.final-stats-display {
	font-family: 'Courier New', monospace;
	font-size: 1.1rem;
	font-weight: bold;
	color: #4caf50;
	background-color: #1a2f1f;
	padding: 0.8rem;
	border-radius: 4px;
	border: 1px solid #2d5a3d;
}

.toggle-switch {
	display: flex;
	align-items: center;
	margin-bottom: 1rem;
}

.toggle-switch-checkbox {
	height: 0;
	width: 0;
	visibility: hidden;
}

.toggle-switch-label {
	cursor: pointer;
	text-indent: -9999px;
	width: 52px;
	height: 28px;
	background: #5a5a5a;
	display: block;
	border-radius: 100px;
	position: relative;
	flex-shrink: 0;
}

	.toggle-switch-label:after {
		content: '';
		position: absolute;
		top: 2px;
		left: 2px;
		width: 24px;
		height: 24px;
		background: #e4e6ea;
		border-radius: 90px;
		transition: 0.3s;
	}

.toggle-switch-checkbox:checked + .toggle-switch-label {
	background: #1877f2;
}

	.toggle-switch-checkbox:checked + .toggle-switch-label:after {
		left: calc(100% - 2px);
		transform: translateX(-100%);
	}

.toggle-description {
	margin-left: 1rem;
}

	.toggle-description strong {
		display: block;
		color: #e4e6ea;
	}

	.toggle-description small {
		color: #8a8d93;
	}

/* Special styling for exotic armor pieces */
.exotic-piece {
	color: #f1c40f !important;
	font-weight: bold;
}

	.exotic-piece::before {
		content: "⚡ ";
	}

/* New styles for custom fragment section */
.custom-fragment-section {
	margin-top: 1rem;
	padding: 1rem;
	background-color: #2d2e30;
	border-radius: 6px;
	border: 1px solid #3a3b3c;
}

.fragment-input-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 1rem;
	margin-top: 1rem;
}

.fragment-description {
	margin-top: 1rem;
	padding: 0.8rem;
	background-color: #3a3b3c;
	border-radius: 4px;
	border-left: 3px solid #1877f2;
}

	.fragment-description p {
		margin: 0;
		font-size: 0.9rem;
		color: #b0b3b8;
	}

/* Special styling for custom armor pieces */
.custom-piece {
	color: #bb86fc !important;
	font-weight: bold;
}

	.custom-piece::before {
		content: "🔧 ";
	}

.fragment-bonus {
	color: #00d4aa;
	font-weight: bold;
}

	.fragment-bonus::before {
		content: "⬆️ ";
	}

.loader {
	display: inline-block;
	width: 1em;
	height: 1em;
	border: 3px solid rgba(24, 119, 242, 0.3);
	border-radius: 50%;
	border-top-color: #1877f2;
	animation: spin 1s ease-in-out infinite;
	margin-right: 0.5em;
	vertical-align: middle;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* Responsive Design */
@media (max-width: 1200px) {
	.stats-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 0.8rem;
	}
}

@media (max-width: 900px) {
	.stats-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.8rem;
	}
}

@media (max-width: 600px) {
	.stats-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.solution-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.solution-column:first-child {
		margin-bottom: 1rem;
		padding-bottom: 1rem;
		border-bottom: 1px solid #3a3b3c;
	}

	.priority-grid {
		grid-template-columns: 1fr;
	}

	.custom-armor-grid {
		grid-template-columns: 1fr;
	}

	.fragment-input-grid {
		grid-template-columns: 1fr;
	}

	.stat-row {
		flex-direction: column;
		align-items: stretch;
	}
}
