/*
  Stylesheet for the US → Libya Car Finder demo.
  Defines a small design system using CSS variables and
  provides responsive layouts for the filter controls and results grid.
*/

/* Color palette variables */
:root {
  --bg: #f7f9fb;
  --card: #ffffff;
  --text: #333333;
  --muted: #6c757d;
  --accent: #087ea4;
  --accent-dark: #05668d;
}

/* Base styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

p {
  margin: 0 0 1rem;
}

/* Header */
.site-header {
  text-align: center;
  padding: 2rem 1rem;
  background-color: var(--card);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  margin-bottom: 1rem;
}

.site-title {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.site-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
}

/* Filters section */
#filters {
  background-color: var(--card);
  padding: 1rem;
  margin: 0 1rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.filters-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

.filter-group > label,
.filter-group > legend {
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: var(--text);
}

.filter-group select,
.filter-group input[type='number'] {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background-color: var(--bg);
  font-size: 0.9rem;
  color: var(--text);
}

.filter-group input[type='checkbox'] {
  margin-right: 0.25rem;
}

fieldset.filter-group {
  border: none;
  padding: 0;
  margin: 0;
}

fieldset.filter-group label {
  display: block;
  font-weight: normal;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  color: var(--text);
}

/* Actions */
.filter-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out, opacity 0.15s ease-in-out;
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
}

.btn-secondary {
  background-color: var(--muted);
  color: #ffffff;
}

.btn-accent {
  background-color: var(--accent);
  color: #ffffff;
  text-decoration: none;
  display: inline-block;
}

/* Outline button used in the contact CTA */
.btn-outline {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 2px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  background-color: transparent;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.btn-outline:hover,
.btn-outline:focus {
  background-color: var(--accent);
  color: #ffffff;
  outline: none;
}

.btn:hover,
.btn:focus {
  opacity: 0.9;
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}

/* Result metadata */
.result-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  margin: 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

#resultMeta span + span {
  margin-left: 1rem;
}

/* Results grid */
#results {
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 1rem;
}

/* Card style placeholder (used later) */
.card {
  background-color: var(--card);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  text-transform: uppercase;
  margin-left: 0.5rem;
}

.badge--auction {
  background-color: #e0a800;
  color: #ffffff;
}

.badge--bin {
  background-color: #28a745;
  color: #ffffff;
}

/* Run & Drive badges */
.badge--rd-yes {
  background-color: #198754;
  color: #ffffff;
}

.badge--rd-no {
  background-color: #dc3545;
  color: #ffffff;
}

/* Compare checkbox container */
.card-compare {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.compare-checkbox {
  margin: 0;
}

/* Sort controls styling */
.sort-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 1rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
}

.sort-controls select {
  padding: 0.4rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background-color: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

/* Focus outlines for inputs and select */
input:focus,
select:focus,
button:focus {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}

/* Card internal layout */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.card-header h3 {
  font-size: 1.1rem;
  margin: 0;
  color: var(--text);
}

.card-details {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.card-details span {
  margin-right: 0.5rem;
}

.card-pricing {
  margin-bottom: 0.5rem;
}

.card-pricing .price-row {
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: var(--text);
}

.price-label {
  font-weight: 600;
  margin-right: 0.25rem;
}

.card-shipping {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.card-shipping div {
  margin-bottom: 0.25rem;
}

.card-disclaimer {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.card-actions {
  margin-top: 0.5rem;
}

.card-actions .btn {
  width: 100%;
  text-align: center;
}

/* Contact section */
/* Contact panel styling */
#contact {
  background-color: var(--card);
  padding: 1.5rem;
  margin: 0 1rem 2rem;
  border-radius: 8px;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  text-align: center;
}

/* Specific styling for notes in the contact panel */
#contact .contact-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.contact-card h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  color: var(--text);
}

.contact-card p {
  margin-bottom: 0.75rem;
  color: var(--text);
}

.contact-action .btn-accent {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
}

/* Footer */
.site-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 1rem;
  background-color: var(--card);
  border-top: 1px solid #e5e7eb;
}

/*
  Additional styles for site images. Users can replace the logo and
  vehicle images with their own files. The .site-logo appears at the
  top of the header. The .car-image appears at the top of each card.
*/

/* Site logo sizing: center it and constrain width. */
.site-logo {
  width: 140px;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1rem;
}

/* Car images within cards: fill the card width and maintain aspect ratio. */
.car-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

/* Responsive media queries */
@media (min-width: 600px) {
  #results {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  #results {
    grid-template-columns: 1fr 1fr 1fr;
  }
}