/*
  LocallyLinked styles
  red + black theme for the marketplace app
  college project 2026
*/

/* General Page Styling */
body {
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  padding-bottom: 90px; /* space for bottom nav */
  color: #000;
}

/* hide all tabs except the active one */
.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

header {
  background: black;
  color: red;
  text-align: center;
  padding: 20px;
}

header h1 {
  margin: 0;
  font-size: 2rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: red;
}

/* Bottom Navigation Bar */
.tab-bar {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: black;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
}

.tab-bar button {
  color: white;
  background: red;
  border: none;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.tab-bar button:hover,
.tab-bar button.active {
  background: #b30000;
}

.back-link {
  color: #e60000;
  text-decoration: none;
  font-weight: bold;
}

.back-link:hover {
  text-decoration: underline;
}

/* Modern Information Blocks */
.product-card,
.item-card,
.cart-item,
.listing-card {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 20px;
  margin: 20px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover,
.item-card:hover,
.cart-item:hover,
.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.product-card h3,
.item-card h3,
.cart-item h3,
.listing-card h3 {
  color: #e60000;
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.product-card p,
.item-card p,
.cart-item p,
.listing-card p {
  margin: 6px 0;
  font-size: 1rem;
}

/* Buttons inside cards */
.product-card button,
.item-card button,
.listing-card button {
  margin-right: 10px;
  padding: 10px 14px;
  border: none;
  border-radius: 6px;
  background: #e60000;
  color: white;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s ease;
}

.product-card button:hover,
.item-card button:hover,
.listing-card button:hover {
  background: #b30000;
}

/* Checkout Form Styling */
#checkoutForm {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 20px;
  margin: 20px;
  background: #f9f9f9;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#checkoutForm input {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}

#checkoutForm button {
  margin-top: 10px;
  padding: 12px 18px;
  border: none;
  border-radius: 8px;
  background: #e60000;
  color: white;
  cursor: pointer;
  font-size: 1rem;
}

#checkoutForm button:hover {
  background: #b30000;
}

/* Profile & Forms */
#signInForm, #registerForm, #sellerForm {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 20px;
  margin: 20px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#signInForm input,
#registerForm input,
#sellerForm input,
#sellerForm textarea,
#sellerForm select {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}

#signInForm button,
#registerForm button,
#sellerForm button {
  margin-top: 10px;
  padding: 12px 18px;
  border: none;
  border-radius: 8px;
  background: #e60000;
  color: white;
  cursor: pointer;
  font-size: 1rem;
}

#signInForm button:hover,
#registerForm button:hover,
#sellerForm button:hover {
  background: #b30000;
}

/* Category Grid */
#categoryGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 20px;
}

.category-card {
  background: #fff;
  border: 2px solid #e60000;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: #000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  background: #f9f9f9;
}

.category-card h3 {
  margin: 0;
  color: #e60000;
}

/* Flash messages */
.flash {
  margin: 20px;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 1rem;
}

.flash-success {
  background: #e8f5e9;
  border: 1px solid #4caf50;
  color: #2e7d32;
}

.flash-error {
  background: #ffebee;
  border: 1px solid #e60000;
  color: #b30000;
}

/* Category links */
#categoryGrid a.category-card {
  text-decoration: none;
  display: block;
  color: inherit;
}

/* images */
.product-card img,
.item-card img,
.cart-item img,
.listing-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* Admin dashboard */
.admin-panel {
  margin: 20px;
}

.admin-intro {
  margin-bottom: 24px;
  font-size: 1rem;
}

.admin-section {
  margin-bottom: 40px;
}

.admin-section h2 {
  color: #e60000;
  margin-bottom: 16px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #111;
  color: #fff;
}

.admin-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-inline-form select,
.admin-edit-card input,
.admin-edit-card textarea,
.admin-edit-card select {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
}

.admin-edit-card {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: bold;
}

.admin-full-width {
  grid-column: 1 / -1;
}

.admin-card-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.admin-card-actions button,
.admin-inline-form button {
  padding: 10px 14px;
  border: none;
  border-radius: 6px;
  background: #e60000;
  color: #fff;
  cursor: pointer;
}

.admin-card-actions button:hover,
.admin-inline-form button:hover {
  background: #b30000;
}

.btn-danger {
  background: #333 !important;
}

.btn-danger:hover {
  background: #000 !important;
}

.admin-muted {
  color: #666;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .tab-bar {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }
}
