Here's an improved version of your eBay Value Finder UI with enhanced aesthetics, better usability, and modern design principles, while preserving all existing functionality:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>eBay Value Finder</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f9f9f9;
color: #333;
max-width: 600px;
margin: 2em auto;
padding: 0 1em;
}
h1 {
text-align: center;
color: #2c3e50;
margin-bottom: 1.5em;
}
.form-card {
background: #fff;
padding: 1.5em;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
border: 1px solid #e0e0e0;
}
label {
display: block;
margin-bottom: 0.5em;
font-weight: 600;
color: #2c3e50;
}
input[type="text"], select, button {
width: 100%;
padding: 0.75em;
margin-top: 0.25em;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1em;
transition: all 0.2s ease;
}
input[type="text"]:focus, select:focus {
border-color: #3498db;
outline: none;
box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}
.checkbox-group {
display: flex;
align-items: center;
margin-top: 0.5em;
gap: 0.5em;
}
.checkbox-group label {
font-weight: normal;
flex: 1;
cursor: pointer;
}
button {
background-color: #3498db;
color: white;
border: none;
cursor: pointer;
font-weight: bold;
margin-top: 1.5em;
transition: background-color 0.2s ease;
}
button:hover {
background-color: #2980b9;
}
.error {
background-color: #ffe6e6;
border-left: 4px solid #e74c3c;
padding: 0.75em;
margin-top: 1em;
border-radius: 4px;
color: #c0392b;
}
.results {
margin-top: 2em;
background: #fff;
padding: 1.5em;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
border: 1px solid #e0e0e0;
}
.results h2 {
margin-top: 0;
color: #2c3e50;
border-bottom: 2px solid #eee;
padding-bottom: 0.5em;
}
.results ul {
list-style: none;
padding-left: 0;
margin: 1em 0;
}
.results li {
margin-bottom: 0.5em;
font-size: 1.1em;
}
.results .price {
font-weight: bold;
color: #27ae60;
}
.results .count {
color: #888;
}
.results a {
color: #3498db;
text-decoration: none;
}
.results a:hover {
text-decoration: underline;
}
@media (max-width: 480px) {
body {
margin: 1em;
}
.form-card {
padding: 1em;
}
.results {
padding: 1em;
}
}
</style>
</head>
<body>
<h1>eBay Value Finder</h1>
<div class="form-card">
<form method="post">
<label for="item">Item to search:</label>
<input type="text" id="item" name="item" required value="{{ request.form.item }}">
<label for="condition">Condition:</label>
<select id="condition" name="condition">
{% for cond in ['all','new','used','refurbished','opened'] %}
<option value="{{cond}}" {% if request.form.condition==cond %}selected{% endif %}>{{cond.title()}}</option>
{% endfor %}
</select>
<div class="checkbox-group">
<input type="checkbox" name="strict" id="strict" {% if request.form.get('strict') %}checked{% endif %}>
<label for="strict">Strict match (all query words must be in title)</label>
</div>
<button type="submit">Find Value</button>
</form>
</div>
{% if error %}<p class="error">{{ error }}</p>{% endif %}
{% if results %}
<div class="results">
<h2>Sold Listings (max 150):</h2>
<ul>
<li>Average price: $<span class="price">{{ results.avg.price }}</span></li>
<li>Average shipping: $<span class="price">{{ results.avg.shipping }}</span></li>
<li>Total average: $<span class="price">{{ results.avg.total }}</span></li>
<li>Count: <span class="count">{{ results.avg.count }}</span></li>
</ul>
<h2>Active Listings:</h2>
{% if results.listing %}
<p>Cheapest active listing right now: $<span class="price">{{ results.listing.price }}</span> + $<span class="price">{{ results.listing.shipping }}</span> shipping</p>
<p>Title: {{ results.listing.title }}</p>
<p><a href="{{ results.listing.url.split('?')[0] }}" target="_blank">View on eBay</a></p>
<p>There are <span class="count">{{ results.same_count }}</span> listings at this price.</p>
{% else %}
<p>No active "Buy It Now" listings found.</p>
{% endif %}
</div>
{% endif %}
</body>
</html>