/* ============================================
   Reclaimed Salvage Directory - Main Stylesheet
   ============================================ */

/* CSS Variables */
:root {
  --primary-brown: #5D4E37;
  --secondary-brown: #8B7355;
  --light-brown: #D4C4A8;
  --cream: #F5F0E8;
  --forest-green: #2D5A3D;
  --sage-green: #7A9A7E;
  --light-green: #E8F0E8;
  --text-dark: #2C2416;
  --text-medium: #5C5040;
  --text-light: #8A8070;
  --white: #FFFFFF;
  --shadow: rgba(45, 35, 25, 0.15);
  --shadow-hover: rgba(45, 35, 25, 0.25);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--cream);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--primary-brown);
  margin-bottom: 1rem;
  line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-medium);
}

a {
  color: var(--forest-green);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--sage-green);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary-brown), var(--secondary-brown));
  color: var(--white);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px var(--shadow);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2rem;
}

.logo h1,
.logo-text {
  font-size: 1.5rem;
  color: var(--white);
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: bold;
  line-height: 1.3;
}

.logo a {
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo a:hover {
  color: var(--light-brown);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--white);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--light-brown);
}

/* Hero Section */
.hero {
  background: linear-gradient(rgba(45, 35, 25, 0.7), rgba(45, 35, 25, 0.7)),
              url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect fill="%238B7355" width="100" height="100"/><path d="M0 0h50v50H0z" fill="%235D4E37" opacity="0.3"/><path d="M50 50h50v50H50z" fill="%235D4E37" opacity="0.3"/></svg>');
  background-size: cover;
  background-position: center;
  color: var(--white);
  padding: 6rem 0;
  text-align: center;
}

.hero h1 {
  color: var(--white);
  font-size: 3rem;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero .tagline {
  font-size: 1.5rem;
  font-style: italic;
  color: var(--light-brown);
  margin-bottom: 2rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: 1.1rem;
  color: var(--white);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--forest-green);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--sage-green);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.btn-secondary {
  background-color: var(--secondary-brown);
  color: var(--white);
}

.btn-secondary:hover {
  background-color: var(--primary-brown);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--white);
  color: var(--white);
}

.btn-outline:hover {
  background-color: var(--white);
  color: var(--primary-brown);
}

/* Sections */
section {
  padding: 4rem 0;
}

section h2 {
  text-align: center;
  margin-bottom: 2.5rem;
}

/* Browse Cards (States & Materials) */
.browse-section {
  background-color: var(--white);
}

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

.browse-card {
  background-color: var(--cream);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.browse-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow);
  border-color: var(--sage-green);
}

.browse-card .icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.browse-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.browse-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0;
}

/* Listing Cards */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.listing-card {
  background-color: var(--white);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px var(--shadow);
  transition: all 0.3s ease;
  border-left: 4px solid var(--forest-green);
}

.listing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px var(--shadow-hover);
}

.listing-card h3 {
  color: var(--primary-brown);
  margin-bottom: 0.5rem;
}

.listing-location {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.listing-description {
  color: var(--text-medium);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.listing-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.material-tag {
  background-color: var(--light-green);
  color: var(--forest-green);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.listing-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--light-brown);
}

.listing-contact a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.listing-type {
  background-color: var(--light-brown);
  color: var(--primary-brown);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0.75rem;
}

/* Featured Section */
.featured-section {
  background: linear-gradient(135deg, var(--light-green), var(--cream));
}

/* Filter Controls */
.filter-controls {
  background-color: var(--white);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 10px var(--shadow);
}

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

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--primary-brown);
}

.filter-group input,
.filter-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--light-brown);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--forest-green);
}

.results-count {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, var(--primary-brown), var(--secondary-brown));
  color: var(--white);
  padding: 3rem 0;
  text-align: center;
}

.page-header h1 {
  color: var(--white);
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--light-brown);
  max-width: 600px;
  margin: 0 auto;
}

/* About & Contact Pages */
.content-section {
  background-color: var(--white);
  padding: 3rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px var(--shadow);
  margin: 2rem auto;
  max-width: 800px;
}

.content-section h2 {
  text-align: left;
  margin-top: 2rem;
}

.content-section h2:first-child {
  margin-top: 0;
}

.content-section ul {
  margin: 1rem 0 1rem 2rem;
  color: var(--text-medium);
}

.content-section li {
  margin-bottom: 0.5rem;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--primary-brown);
}

.form-group input,
.form-group textarea {
  padding: 0.75rem;
  border: 2px solid var(--light-brown);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--forest-green);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

/* Footer */
footer {
  background-color: var(--primary-brown);
  color: var(--white);
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: var(--light-brown);
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--white);
  opacity: 0.9;
}

.footer-section a:hover {
  color: var(--light-brown);
  opacity: 1;
}

.footer-section p {
  color: var(--white);
  opacity: 0.9;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-bottom p {
  color: var(--white);
  opacity: 0.7;
  font-size: 0.9rem;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 1rem 0;
  background-color: var(--light-brown);
}

.breadcrumbs a {
  color: var(--primary-brown);
}

.breadcrumbs span {
  color: var(--text-light);
  margin: 0 0.5rem;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
}

/* Loading State */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  header .container {
    flex-direction: column;
    text-align: center;
  }
  
  nav ul {
    justify-content: center;
  }
  
  .hero {
    padding: 4rem 0;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero .tagline {
    font-size: 1.2rem;
  }
  
  .listings-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-row {
    flex-direction: column;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .content-section {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  section {
    padding: 2rem 0;
  }
}

@media (max-width: 480px) {
  .browse-grid {
    grid-template-columns: 1fr;
  }
  
  nav ul {
    gap: 0.5rem;
  }
  
  nav a {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
  
  .listing-contact {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Print Styles */
@media print {
  header, footer, .filter-controls {
    display: none;
  }
  
  .listing-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.hidden { display: none; }
