/* Sourcing Board styles */
.section { padding: 80px 24px; }
.section.bg-light { background: #f1f5f9; }

.form-tabs, .listing-tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.form-tab, .listing-tab {
  padding: 12px 24px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.form-tab:hover, .listing-tab:hover { color: var(--primary); }
.form-tab.active, .listing-tab.active {
  background: var(--accent);
  color: var(--primary);
  border-color: var(--accent);
}

.post-form {
  display: none;
  max-width: 760px;
  margin: 0 auto;
  background: white;
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.post-form.active { display: block; }

.post-form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.post-form input,
.post-form select,
.post-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  transition: var(--transition);
}

.post-form input:focus,
.post-form select:focus,
.post-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212,168,83,.15);
}

.post-form textarea { margin-bottom: 16px; resize: vertical; }
.post-form button {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.post-form button:hover { background: var(--primary-light); }

.image-upload {
  margin-bottom: 20px;
  padding: 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #fafafa;
}
.image-upload label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-secondary);
}
.image-upload input[type="file"] { width: 100%; }

.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.image-preview img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.form-status {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  display: none;
}
.form-status.show { display: block; }
.form-status.success { background: #dcfce7; color: #166534; }
.form-status.error { background: #fee2e2; color: #991b1b; }
.form-status.info { background: #dbeafe; color: #1e40af; }

.filter-bar {
  display: flex;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto 32px;
  flex-wrap: wrap;
}
.filter-bar select,
.filter-bar input {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
}

.listing-panel { display: none; }
.listing-panel.active { display: block; }

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.listing-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.listing-card .card-img {
  height: 180px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}
.listing-card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-card .card-body {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.listing-card .badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  width: fit-content;
}
.badge.buy { background: #dbeafe; color: #1e40af; }
.badge.sell { background: #dcfce7; color: #166534; }

.listing-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}
.listing-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
  flex: 1;
}

.listing-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.listing-card .meta span {
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.listing-card .contact {
  display: flex;
  gap: 10px;
  margin-top: auto;
}
.listing-card .contact a {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}
.listing-card .contact a:first-child {
  background: var(--accent);
  color: var(--primary);
}
.listing-card .contact a:last-child {
  background: var(--primary);
  color: white;
}

.loading, .empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .post-form .row { grid-template-columns: 1fr; }
  .listing-grid { grid-template-columns: 1fr; }
}
