* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	line-height: 1.6;
	color: #333;
	background-color: #f8f9fa;
	padding: 20px;
}

.container {
	max-width: 1000px;
	margin: 0 auto;
	background-color: #fff;
	padding: 30px;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
	text-align: center;
	margin-bottom: 30px;
	color: #2c3e50;
}

h2 {
	margin: 30px 0 20px;
	color: #2c3e50;
}

.form-group {
	margin-bottom: 20px;
}

label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
}

input,
textarea {
	width: 100%;
	padding: 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
}

textarea {
	resize: vertical;
	min-height: 120px;
	font-family: monospace;
}

button {
	background-color: #3498db;
	color: white;
	border: none;
	padding: 12px 20px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	transition: background-color 0.3s;
}

button:hover {
	background-color: #2980b9;
}

.hidden {
	display: none;
}

#loading {
	text-align: center;
	margin: 20px 0;
	font-style: italic;
	color: #666;
}

#error {
	color: #e74c3c;
	padding: 10px;
	margin: 10px 0;
	border: 1px solid #e74c3c;
	border-radius: 4px;
	background-color: #fadbd8;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 20px;
}

th,
td {
	padding: 12px 15px;
	text-align: left;
	border-bottom: 1px solid #ddd;
}

th {
	background-color: #f2f2f2;
	font-weight: 600;
}

tr:hover {
	background-color: #f5f5f5;
}

.hit-image {
	max-width: 100px;
	max-height: 100px;
	border-radius: 4px;
}

.no-results {
	text-align: center;
	padding: 20px;
	font-style: italic;
	color: #666;
}

/* Modal styles */
.modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1000;
}

.modal.hidden {
	display: none;
}

.modal-content {
	background-color: white;
	border-radius: 8px;
	width: 80%;
	max-width: 800px;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
}

.modal-header {
	padding: 16px;
	border-bottom: 1px solid #eee;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.modal-header h3 {
	margin: 0;
}

.close-button {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	padding: 0;
	color: #666;
}

.close-button:hover {
	color: #000;
}

.modal-body {
	padding: 16px;
	overflow: auto;
	flex-grow: 1;
}

.modal-body pre {
	margin: 0;
	white-space: pre-wrap;
	font-family: 'Courier New', Courier, monospace;
	font-size: 14px;
	line-height: 1.5;
}

/* Make table rows clickable */
#resultsTable tbody tr {
	cursor: pointer;
}

#resultsTable tbody tr:hover {
	background-color: #f5f5f5;
}

/* Card grid for results */
.results-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-top: 20px;
}

.result-card {
	position: relative;
	width: calc(25% - 15px); /* Default 4 cards per row */
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 10px;
	cursor: pointer;
	transition: transform 0.2s;
	box-sizing: border-box;
}

.result-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-card img {
	width: 100%;
	height: auto;
	object-fit: cover;
	border-radius: 4px;
}

.card-title {
	margin-top: 10px;
	font-weight: bold;
}

.card-price {
	color: #666;
	margin-top: 5px;
}

.rank-indicator {
	position: absolute;
	top: -10px;
	left: -10px;
	width: 30px;
	height: 30px;
	background-color: #007bff;
	color: white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 14px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
	z-index: 1;
}

/* Slider styles */
input[type='range'] {
	width: 100%;
	margin: 10px 0;
}

#cardsPerRowValue {
	font-weight: bold;
	color: #007bff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.result-card {
		width: calc(50% - 10px);
	}
}

@media (max-width: 480px) {
	.result-card {
		width: 100%;
	}
}

.main-container {
	display: flex;
	gap: 2rem;
	padding: 2rem;
	max-width: 1800px;
	margin: 0 auto;
}

.content-container {
	flex: 1;
	min-width: 0; /* Prevents flex item from overflowing */
}

.side-panel {
	width: 300px;
	flex-shrink: 0;
	background: #f5f5f5;
	padding: 1.5rem;
	border-radius: 8px;
	height: fit-content;
}

.saved-configs h2 {
	margin-top: 0;
	margin-bottom: 1rem;
	font-size: 1.2rem;
}

.save-config-form {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.save-config-form input {
	flex: 1;
	padding: 0.5rem;
	border: 1px solid #ccc;
	border-radius: 4px;
}

.save-config-form button {
	padding: 0.5rem 1rem;
	background: #007bff;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
}

.save-config-form button:hover {
	background: #0056b3;
}

.saved-configs-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.saved-config-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem;
	background: white;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.saved-config-item .config-name {
	flex: 1;
	margin-right: 0.5rem;
	cursor: pointer;
}

.saved-config-item .config-actions {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.saved-config-item .share-config,
.saved-config-item .delete-config {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.25rem;
	font-size: 1.2rem;
	line-height: 1;
}

.saved-config-item .share-config {
	color: #007bff;
}

.saved-config-item .share-config:hover {
	color: #0056b3;
}

.saved-config-item .delete-config {
	color: #dc3545;
}

.saved-config-item .delete-config:hover {
	color: #bd2130;
}

.share-link-container {
	display: flex;
	gap: 0.5rem;
	margin-top: 1rem;
}

.share-link-container input {
	flex: 1;
	padding: 0.5rem;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #f8f9fa;
}

.share-link-container button {
	padding: 0.5rem 1rem;
	white-space: nowrap;
}

.config-description {
	font-size: 0.9rem;
	color: #666;
	margin-bottom: 1rem;
	line-height: 1.4;
}

.field-description {
	font-size: 0.9rem;
	color: #666;
	margin: -0.5rem 0 0.5rem;
	line-height: 1.4;
}

.result-card .pin-indicator {
	position: absolute;
	top: -10px;
	right: -10px;
	z-index: 2;
	background: white;
	border-radius: 50%;
	padding: 2px;
	box-shadow: 0 2px 5px rgba(0,0,0,0.08);
	display: flex;
	align-items: center;
	justify-content: center;
}
