/* Webmail Stock Marketplace - Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f9fafb;
  color: #1f2937;
  line-height: 1.6;
}

/* Header */
header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 1.5rem 2rem;
}

header .container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
}

header p {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

header .nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

header a {
  font-size: 0.875rem;
  text-decoration: none;
  color: #2563eb;
  font-weight: 500;
}

header a:hover {
  color: #1d4ed8;
}

/* Main container */
.main {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.grid-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
}

/* Sidebar Filters */
.filters {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 1.5rem;
}

.filters h3 {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.filter-group:last-child {
  border-bottom: none;
}

.filter-group label {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.filter-group input[type="radio"],
.filter-group input[type="checkbox"] {
  margin-right: 0.5rem;
  cursor: pointer;
}

.filter-group input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.filter-group button {
  width: 100%;
  padding: 0.5rem;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
}

.filter-group button:hover {
  background-color: #1d4ed8;
}

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

.listing-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.listing-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.card-content .provider {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

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

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

.badge-type {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-admin {
  background-color: #dcfce7;
  color: #166534;
}

.badge-inbox {
  background-color: #fef3c7;
  color: #92400e;
}

.card-content .notes {
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 1rem;
  flex: 1;
}

.proofs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.proof-btn {
  padding: 0.75rem;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  text-align: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.proof-btn:hover {
  background-color: #e5e7eb;
}

.proof-btn.locked {
  background-color: #fee2e2;
  color: #991b1b;
  cursor: not-allowed;
}

.view-details {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background-color: #2563eb;
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.view-details:hover {
  background-color: #1d4ed8;
}

/* Detail Page */
.detail-container {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.detail-container h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.detail-container .provider {
  font-size: 1.125rem;
  color: #6b7280;
  margin-bottom: 2rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 2rem;
}

.detail-grid .item {
  display: flex;
  flex-direction: column;
}

.detail-grid .label {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.detail-grid .value {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.details-section h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.details-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e5e7eb;
}

.details-section:last-child {
  border-bottom: none;
}

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

.proof-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
}

.proof-card .header {
  background-color: #f3f4f6;
  padding: 1.5rem;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}

.proof-card .header p {
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 1rem;
}

.proof-card .view-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: #2563eb;
  color: white;
  text-decoration: none;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
}

.proof-card .view-btn:hover {
  background-color: #1d4ed8;
}

.proof-card .view-btn.locked {
  background-color: #d1d5db;
  color: #4b5563;
  cursor: not-allowed;
}

/* Contact Section */
.contact-section {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-top: 2rem;
}

.contact-section h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.contact-section p {
  margin-bottom: 1rem;
  color: #1f2937;
}

.contact-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-buttons a {
  padding: 0.75rem 1.5rem;
  background-color: #2563eb;
  color: white;
  text-decoration: none;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid #2563eb;
  transition: all 0.2s;
}

.contact-buttons a:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

.contact-buttons a.secondary {
  background-color: white;
  color: #2563eb;
}

.contact-buttons a.secondary:hover {
  background-color: #eff6ff;
}

/* Admin */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead {
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.admin-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.875rem;
}

.admin-table tr:hover {
  background-color: #f9fafb;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-weight: 500;
  font-size: 0.75rem;
}

.status-in_stock {
  background-color: #dcfce7;
  color: #166534;
}

.status-reserved {
  background-color: #fef3c7;
  color: #92400e;
}

.status-sold {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #6b7280;
}

.empty-state a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.empty-state a:hover {
  color: #1d4ed8;
}

/* Responsive */
@media (max-width: 768px) {
  .grid-container {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

  header .container {
    flex-direction: column;
    text-align: center;
  }

  header .nav {
    margin-top: 1rem;
  }

  .listings {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .contact-buttons {
    flex-direction: column;
  }

  .contact-buttons a {
    width: 100%;
  }
}
