/* ================================
   GLOBAL THEME VARIABLES
   https://colorhunt.co/palette/e3fdfdcbf1f5a6e3e971c9ce
=================================== */
:root {
  --primary-color: #0d6efd;      /* Bootstrap blue */
  --primary-dark: #0056b3;
  --accent-color: #28a745;       /* Success green */
  --accent-dark: #1f8f3f;
  --dark-color: #1e2a38;
  --light-bg: #f8f9fa;
  --text-color: #333;
  --muted-text: #777;
  --border-color: #ddd;
  --card-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  --hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ================================
   GENERAL STYLING
=================================== */
body {
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
  background-color: var(--light-bg);
  color: var(--text-color);
}

h1, h2, h3, h4 {
  color: var(--dark-color);
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background-color: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

th, td {
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--border-color);
}

th {
  background-color: #eef2f7;
  font-weight: 600;
  color: var(--dark-color);
  cursor: pointer;
}

th:hover {
  background-color: #e0e6ed;
}

/* Sorting Indicators */
th.ascending::after {
  content: " ↑";
  font-size: 0.8em;
  color: var(--accent-color);
}
th.descending::after {
  content: " ↓";
  font-size: 0.8em;
  color: #dc3545;
}

/* Search + Forms */
form {
  margin-bottom: 20px;
}

input[type="text"] {
  padding: 8px 10px;
  font-size: 14px;
  width: 250px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

/* Buttons */
button,
.btn,
.btn-action {
  padding: 8px 14px;
  font-size: 14px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s ease;
}
button:hover,
.btn:hover,
.btn-action:hover {
  background-color: var(--accent-dark);
  transform: translateY(-2px);
}

/* Primary & Secondary Variants */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}
.btn-primary:hover {
  background-color: var(--primary-dark);
}
.btn-secondary {
  background-color: #6c757d;
}
.btn-secondary:hover {
  background-color: #5a6268;
}
.btn-cancel {
  background-color: #888;
}
.btn-cancel:hover {
  background-color: #666;
}

/* Links in tables */
td a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 500;
}
td a:hover {
  color: var(--primary-dark);
}

/* Pagination */
.pagination {
  margin-top: 20px;
  text-align: center;
}
.pagination a {
  padding: 6px 12px;
  margin: 0 4px;
  text-decoration: none;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 4px;
  transition: 0.3s;
}
.pagination a.active {
  background-color: var(--primary-color);
  color: white;
}
.pagination a:hover {
  background-color: #e0e6ed;
}

/* ===============================
   DASHBOARD
=================================== */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px;
}
.dashboard-container h2 {
  font-size: 1.8em;
  margin-bottom: 5px;
}
.dashboard-subtitle {
  color: var(--muted-text);
  margin-bottom: 25px;
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.summary-card {
  background: #E3FDFD;
  border-radius: 12px;
  padding: 25px 20px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}
.summary-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hover-shadow);
}
.summary-card h3 {
  font-size: 2.2em;
  margin-bottom: 5px;
  font-weight: 700;
  color: var(--primary-color);
}
.summary-card p {
  color: var(--muted-text);
  font-weight: 500;
}
.summary-card.buyers   { border-top: 4px solid var(--primary-color); }
.summary-card.sellers  { border-top: 4px solid #f28e2b; }
.summary-card.products { border-top: 4px solid #e15759; }
.summary-card.orders   { border-top: 4px solid var(--accent-color); }

/* Chart Containers */
.chart-section {
  background: #fff;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 40px;
  box-shadow: var(--card-shadow);
}
.chart-section h3 {
  margin-bottom: 15px;
  color: var(--dark-color);
  font-size: 1.2em;
}

/* ===============================
   PRODUCT LIST GRID
=================================== */
.product-list-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 15px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.product-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
}
.product-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.no-image {
  width: 100%;
  height: 180px;
  background-color: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #888;
}
.product-info {
  padding: 15px;
  text-align: center;
}
.product-info h3 {
  font-size: 1.1rem;
  color: var(--dark-color);
  margin-bottom: 6px;
}
.product-category {
  color: var(--muted-text);
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.product-price {
  color: var(--accent-color);
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 8px;
}
.product-seller {
  font-size: 0.85rem;
  color: var(--muted-text);
  margin-bottom: 10px;
}
.btn-view {
  background-color: var(--primary-color);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
}
.btn-view:hover {
  background-color: var(--primary-dark);
}

/* ===============================
   MODAL + FOOTER
=================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.modal-content {
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  text-align: center;
  max-width: 350px;
  width: 90%;
  box-shadow: var(--hover-shadow);
}
.modal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

/* ===============================
   RESPONSIVE
=================================== */
@media (max-width: 992px) {
  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .summary-cards {
    grid-template-columns: 1fr;
  }
}

/* ===============================
   Post product
=================================== */
.form-container {
        max-width: 650px;
        margin: 40px auto;
        background: #A6E3E9;
        padding: 35px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    .form-container h2 {
        text-align: center;
        font-weight: 600;
        margin-bottom: 25px;
        color: #333;
    }
    .form-label {
        font-weight: 500;
        color: #444;
    }
    .btn-submit {
    background-color: #0099A6; /* A deeper cyan for better contrast */
    color: #fff; /* White text */
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 6px;
	}

	.btn-submit:hover {
		background-color: #005D63; /* Darker cyan for hover effect */
	}
    .alert {
        max-width: 650px;
        margin: 10px auto;
    }
	@media (max-width: 767px) {
    .btn-submit {
        padding: 10px 20px; /* Reduce padding on smaller screens */
    }
}

/* ===============================
   product view
=================================== */
.product-view-container {
    max-width: 1100px;
    margin: 40px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
}
.product-view-image {
    flex: 1;
    min-width: 300px;
    text-align: center;
}
.product-view-image img {
    width: 100%;
    max-height: 450px;
    object-fit: contain;
    background: #f9f9f9;
    border-radius: 10px;
}
.product-view-info {
    flex: 1;
}
.min-qty-note {
    color: #a94442;
    background: #fff3f3;
    padding: 10px;
    border-radius: 5px;
    font-weight: 600;
    margin: 15px 0;
}
.alert {
    max-width: 1100px;
    margin: 15px auto;
}
.modal-view-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-view-content {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    width: 400px;
    text-align: center;
}
.modal-view-summary p {
    margin: 8px 0;
}
.modal-view-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* Related Products */
.related-products-section {
    max-width: 1100px;
    margin: 40px auto;
}
.related-carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 20px;
}
.related-card {
    flex: 0 0 auto;
    width: 200px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    padding: 10px;
}
.related-card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
}
.carousel-btn {
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}