/* ============================================
   Trade Buddy — Unified Theme v2
   Brand: Blue #2D8CFF + Green #34C759
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --tb-blue: #198CD7;
  --tb-green: #1EB969;
  --tb-green-dark: #179B56;
  --tb-gradient: linear-gradient(135deg, #1EB969 0%, #198CD7 100%);
  --tb-gradient-r: linear-gradient(135deg, #198CD7 0%, #1EB969 100%);
  --tb-dark: #111827;
  --tb-dark-2: #1f2937;
  --tb-bg: #f8fafc;
  --tb-card: #ffffff;
  --tb-text: #111827;
  --tb-text-2: #374151;
  --tb-text-muted: #6b7280;
  --tb-border: #e5e7eb;
  --tb-radius: 14px;
  --tb-radius-sm: 10px;
  --tb-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --tb-shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --tb-transition: 0.2s ease;
}

/* ---- Reset / Base ---- */
body.tb {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--tb-bg);
  color: var(--tb-text);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
body.tb a { color: var(--tb-blue); text-decoration: none; transition: var(--tb-transition); }
body.tb a:hover { color: #1a6fd4; }

/* ---- Navbar ---- */
.tb-nav {
  background: #fff;
  padding: 8px 0;
  border-bottom: 1px solid var(--tb-border);
  position: sticky;
  top: 0;
  z-index: 1050;
}
.tb-nav .container-fluid { max-width: 1200px; margin: 0 auto; }
.tb-nav .navbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.tb-nav .navbar-brand img { height: 42px; width: 42px; }
.tb-nav .navbar-brand span {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--tb-text);
}
.tb-nav .nav-link {
  color: var(--tb-text-muted) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 8px 16px !important;
  border-radius: 8px;
  transition: var(--tb-transition);
}
.tb-nav .nav-link:hover { color: var(--tb-text) !important; background: #f3f4f6; }
.tb-nav .nav-link.active { color: var(--tb-green) !important; background: rgba(30,185,105,0.08); }
.tb-nav .dropdown-menu {
  background: #fff;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius-sm);
  padding: 6px;
  box-shadow: var(--tb-shadow-lg);
}
.tb-nav .dropdown-item { border-radius: 6px; padding: 8px 14px; font-size: 0.9rem; color: var(--tb-text-2); }
.tb-nav .dropdown-item:hover { background: #f3f4f6; color: var(--tb-text); }

/* ---- Buttons ---- */
.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: var(--tb-transition);
  text-decoration: none;
  line-height: 1.4;
}
.tb-btn-primary {
  background: var(--tb-green);
  color: #fff;
}
.tb-btn-primary:hover {
  background: var(--tb-green-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30,185,105,0.3);
}
.tb-btn-blue {
  background: var(--tb-blue);
  color: #fff;
}
.tb-btn-blue:hover {
  background: #1478b8;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(25,140,215,0.3);
}
.tb-btn-outline {
  background: transparent;
  color: var(--tb-text);
  border: 2px solid var(--tb-border);
}
.tb-btn-outline:hover {
  border-color: var(--tb-green);
  color: var(--tb-green);
  background: rgba(30,185,105,0.04);
}
.tb-btn-white {
  background: #fff;
  color: var(--tb-text);
}
.tb-btn-white:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  color: var(--tb-text);
}
.tb-btn-danger {
  background: #ef4444;
  color: #fff;
}
.tb-btn-danger:hover {
  background: #dc2626;
  color: #fff;
  transform: translateY(-1px);
}

/* ---- Hero ---- */
.tb-hero {
  background: var(--tb-dark);
  color: #fff;
  padding: 80px 0 70px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.tb-hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(30,185,105,0.12) 0%, transparent 70%);
}
.tb-hero::after {
  content: '';
  position: absolute;
  bottom: -200px;
  left: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(25,140,215,0.1) 0%, transparent 70%);
}
.tb-hero h1 {
  font-weight: 800;
  font-size: 3rem;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  line-height: 1.15;
}
.tb-hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.65);
  max-width: 560px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  line-height: 1.7;
}

/* Green hero variant */
.tb-hero-green {
  background: var(--tb-green);
  color: #fff;
  padding: 56px 0 48px;
  text-align: center;
}
.tb-hero-green h1 { font-weight: 800; font-size: 2.2rem; margin-bottom: 8px; }
.tb-hero-green p { font-size: 1.05rem; opacity: 0.9; max-width: 520px; margin: 0 auto; }

/* ---- Cards ---- */
.tb-card {
  background: var(--tb-card);
  border-radius: var(--tb-radius);
  border: 1px solid var(--tb-border);
  box-shadow: var(--tb-shadow);
  transition: var(--tb-transition);
  overflow: hidden;
}
.tb-card:hover {
  box-shadow: var(--tb-shadow-lg);
}

/* ---- Feature cards ---- */
.tb-feature-card {
  background: var(--tb-card);
  border-radius: var(--tb-radius);
  border: 1px solid var(--tb-border);
  padding: 32px 24px;
  text-align: center;
  transition: var(--tb-transition);
  height: 100%;
}
.tb-feature-card:hover {
  box-shadow: var(--tb-shadow-lg);
  transform: translateY(-2px);
}
.tb-feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.4rem;
  color: #fff;
  background: var(--tb-green);
}
.tb-feature-icon.blue { background: var(--tb-blue); }
.tb-feature-card h4 {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: var(--tb-text);
}
.tb-feature-card p,
.tb-feature-card ul {
  color: var(--tb-text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 0;
}
.tb-feature-card ul {
  text-align: left;
  padding-left: 1.2rem;
}

/* ---- Category grid ---- */
.tb-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.tb-cat-card {
  background: var(--tb-card);
  border-radius: var(--tb-radius);
  border: 1px solid var(--tb-border);
  overflow: hidden;
  transition: var(--tb-transition);
  text-decoration: none;
  color: var(--tb-text);
  display: block;
}
.tb-cat-card:hover {
  box-shadow: var(--tb-shadow-lg);
  transform: translateY(-3px);
  color: var(--tb-text);
}
.tb-cat-card .tb-cat-img { overflow: hidden; }
.tb-cat-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  transition: var(--tb-transition);
}
.tb-cat-card:hover img { transform: scale(1.04); }
.tb-cat-card .tb-cat-label {
  padding: 14px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  border-top: 1px solid var(--tb-border);
}

/* ---- Product cards ---- */
.tb-product-card {
  background: var(--tb-card);
  border-radius: var(--tb-radius);
  border: 1px solid var(--tb-border);
  overflow: hidden;
  transition: var(--tb-transition);
}
.tb-product-card:hover {
  box-shadow: var(--tb-shadow-lg);
  transform: translateY(-2px);
}
.tb-product-card .tb-product-img { height: 200px; object-fit: cover; width: 100%; }
.tb-product-card .tb-product-body { padding: 18px; }
.tb-product-card .tb-product-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; color: var(--tb-text); }
.tb-product-card .tb-product-desc { color: var(--tb-text-muted); font-size: 0.85rem; line-height: 1.5; margin-bottom: 10px; }
.tb-product-card .tb-product-price { font-weight: 700; font-size: 1.05rem; color: var(--tb-green); }
.tb-product-card .tb-product-seller { color: var(--tb-text-muted); font-size: 0.8rem; }

/* ---- Badges ---- */
.tb-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(30,185,105,0.1);
  color: var(--tb-green-dark);
}

/* ---- Forms ---- */
.tb-form .form-control,
.tb-form .form-select {
  border-radius: var(--tb-radius-sm);
  border: 1.5px solid var(--tb-border);
  padding: 11px 14px;
  font-size: 0.9rem;
  transition: var(--tb-transition);
  background: #fff;
  color: var(--tb-text);
}
.tb-form .form-control:focus,
.tb-form .form-select:focus {
  border-color: var(--tb-blue);
  box-shadow: 0 0 0 3px rgba(25,140,215,0.1);
}
.tb-form .form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--tb-text-2);
  margin-bottom: 6px;
}
.tb-form textarea.form-control { min-height: 120px; }

/* ---- Sections ---- */
.tb-section { padding: 72px 0; }
.tb-section-title {
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--tb-text);
  text-align: center;
  margin-bottom: 10px;
}
.tb-section-sub {
  color: var(--tb-text-muted);
  text-align: center;
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto 40px;
}

/* ---- Footer ---- */
.tb-footer {
  background: var(--tb-dark);
  color: rgba(255,255,255,0.6);
  padding: 56px 0 24px;
}
.tb-footer h5 { color: #fff; font-weight: 700; margin-bottom: 16px; font-size: 0.95rem; }
.tb-footer a { color: rgba(255,255,255,0.5); transition: var(--tb-transition); }
.tb-footer a:hover { color: var(--tb-green); }
.tb-footer .tb-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 36px;
  padding-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
}

/* ---- Profile ---- */
.tb-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--tb-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 2rem;
  color: #fff;
}

/* ---- Alerts ---- */
.tb-alert { border-radius: var(--tb-radius-sm); padding: 14px 18px; font-size: 0.9rem; }
.tb-alert-success { background: rgba(30,185,105,0.08); color: #1a7a34; border: 1px solid rgba(30,185,105,0.2); }

/* ---- Donations ---- */
.tb-donation-item {
  background: var(--tb-card);
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  padding: 18px;
  transition: var(--tb-transition);
}
.tb-donation-item:hover { box-shadow: var(--tb-shadow); }
.tb-donation-img {
  width: 150px;
  height: 110px;
  object-fit: cover;
  border-radius: var(--tb-radius-sm);
  flex-shrink: 0;
}

/* ---- Modals ---- */
.tb-modal .modal-content { border: none; border-radius: var(--tb-radius); overflow: hidden; }
.tb-modal .modal-header { background: var(--tb-green); color: #fff; border-bottom: none; padding: 18px 24px; }
.tb-modal .modal-body { padding: 24px; }

/* ---- Page headers (category pages) ---- */
.tb-page-header {
  background-size: cover;
  background-position: center;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.tb-page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(17,24,39,0.8), rgba(17,24,39,0.7));
}
.tb-page-header h1 {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 800;
  font-size: 2.2rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .tb-hero h1 { font-size: 2rem; }
  .tb-hero p { font-size: 0.95rem; }
  .tb-hero-green h1 { font-size: 1.6rem; }
  .tb-section { padding: 48px 0; }
  .tb-section-title { font-size: 1.4rem; }
  .tb-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tb-cat-card img { height: 130px; }
  .tb-page-header { min-height: 180px; }
  .tb-page-header h1 { font-size: 1.6rem; }
  .tb-nav .navbar-brand img { height: 36px; width: 36px; }
  .tb-nav .navbar-brand span { font-size: 1rem; }
}
@media (max-width: 480px) {
  .tb-cat-grid { grid-template-columns: 1fr; }
  .tb-hero h1 { font-size: 1.7rem; }
}
