:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --muted-hover: #f5f5f5;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e5e7eb;
  --best: #dcfce7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* HEADER */
header {
  background: linear-gradient(135deg, #111827, #1f2937);
  color: white;
  padding: 2.5rem 1.25rem;
  text-align: center;
}

.home-link {
  color: inherit;
  text-decoration: none;
}

/* MAIN 
main {
  max-width: 1200px;
  margin: -2rem auto 3rem;
  padding: 0 1rem;
}*/

main.content {
  margin: 0;
  max-width: none;
  padding: 2rem;
}

/* CARD */
.card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,.08);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

/* =========================
   FILTERS
========================= */

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

.filter-section summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.filter-section summary:hover {
  background: var(--border);
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 200px;
  overflow-y: auto;
}

.filter-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.filter-options input[type="number"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* ACTIONS */
.actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  background: var(--primary-hover);
}

.clear-btn {
  background: rgb(255, 255, 255);
  color: #6b7280;
  border: 1px solid #ccc;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.clear-btn:hover {
  background: #9aa0ac;
}


/* =========================
   RESULTS
========================= */

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* CARD */
.wheel-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  background: var(--card);
}

.wheel-card h3 {
  margin: 0 0 0.5rem 0;
}

.wheel-card h3 span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* IMAGE */
.wheel-img {
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
}

.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

/* SPECS */
.wheel-specs {
  flex: 1;
}

.wheel-spec {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.wheel-spec:last-child {
  border-bottom: none;
}

.wheel-spec span:first-child {
  color: var(--muted);
  font-weight: 600;
}

/* ACTIONS */
.wheel-actions {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wheel-actions a {
  text-align: center;
  background: var(--primary);
  color: white;
  padding: 0.5rem;
  border-radius: 6px;
  text-decoration: none;
}

.wheel-actions a:hover {
  background: var(--primary-hover);
}

/* COMPARE */
.compare-actions {
  margin-top: 2rem;
  text-align: center;
}

/* Mobile comparison: horizontal scroll */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  th.hide-mobile,
  td.hide-mobile {
    display: none;
  }
}

/* EMPTY */
.empty-state {
  text-align: center;
  color: var(--muted);
}

/* FORM FIELD ABOUT */
.form-field {
  max-width: 400px;
  margin: 0 auto 1rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.3rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
}

.field-error {
  color: #c0392b;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.success {
  color: #2e7d32;
  font-weight: 600;
}

.error {
  color: #c0392b;
  font-weight: 600;
}

/* ===== SIDEBAR ===== */

html, body {
  height: 100%;
  margin: 0;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: #a5a5a5;
  color: white;
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

/* pushes footer down */
.sidebar-bottom {
  margin-top: auto;
}

.sidebar a {
  color:#ffffff;
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
}

.sidebar a:hover {
  color: white;
}

/* Main content */
.content {
  flex: 1;
  padding: 2rem;
}

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
  }
}

/* FOOTER */
footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: #6b7280;
  font-size: 0.8rem;
  margin-top: auto;
}

footer a {
  color: #2563eb;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

