/* static/css/style.css */

:root {
  --tdtu-blue: #3d6cb4;
  --tdtu-blue-dark: #2b4d80;
  --tdtu-red: #d45455;
  --bg-light: #f4f6f9;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --accent: #5b7bd5;
  --accent-hover: #4a6bc5;
  --accent-soft: rgba(91, 123, 213, 0.08);
  --accent-bg: #eef2fb;
  --accent-gradient: linear-gradient(135deg, #5b7bd5, #7b9ae0);
}

/* 1. Cấu hình chung */
body {
  font-family: "Inter", "Segoe UI", sans-serif;
  background-color: var(--bg-light);
  color: #333;
  margin: 0;
}

/* 2. Định dạng cho trang Đăng nhập (Auth) */
.auth-body {
  background: linear-gradient(
    135deg,
    #2d4a7a 0%,
    #1e3557 100%
  );
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: none;
}

/* 3. Navbar (Trang Index) */
.navbar {
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 0.5rem 0;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #1a1a2e;
}

.brand-sub {
  font-size: 0.7rem;
  color: #888;
}

.navbar .nav-link {
  font-size: 0.9rem;
  color: #444;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* 3b. Hero Section */
.hero-section {
  background: linear-gradient(135deg, #4a6fa5 0%, #6b8ec4 40%, #8fa9d4 100%);
  padding: 48px 0 42px;
  color: white;
}

.hero-content {
  max-width: 650px;
}

.hero-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.hero-desc {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.hero-search-form {
  max-width: 560px;
}

.hero-search-box {
  position: relative;
}

.hero-search-box .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 1rem;
  z-index: 2;
}

.hero-search-box .form-control {
  padding: 12px 16px 12px 44px;
  border-radius: 12px;
  border: none;
  font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.hero-search-box .form-control:focus {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  outline: none;
}

/* 3c. Main content area */
.main-content {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

/* 3d. Filter section */
.filter-section {
  margin-bottom: 1rem;
}

.filter-label {
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text-main, #333);
}

.filter-label-sm {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main, #555);
}

.filter-icon {
  color: #888;
}

/* 4. Category & Price pills */
.category-pill {
  white-space: nowrap;
  overflow-x: auto;
  padding: 4px 0;
  display: flex;
  gap: 8px;
}
.category-pill::-webkit-scrollbar { display: none; }

.btn-category {
  border-radius: 20px;
  border: 1px solid #e0e0e0;
  background: white;
  font-size: 0.88rem;
  padding: 6px 16px;
  color: #555;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-category.active,
.btn-category:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.price-filter-section {
  margin-bottom: 1.2rem;
}

.price-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-price {
  border-radius: 20px;
  border: 1px solid #e0e0e0;
  background: white;
  font-size: 0.85rem;
  padding: 5px 14px;
  color: #555;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-price.active,
.btn-price:hover {
  background: #1a1a2e;
  color: white;
  border-color: #1a1a2e;
}

/* Products heading */
.products-heading {
  margin-bottom: 1rem;
}

.products-heading h5 {
  color: var(--text-main, #333);
}

/* 5. Product Cards (redesigned) */
.product-card {
  border: none;
  border-radius: 14px;
  background-color: var(--white);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.product-img-wrapper {
  position: relative;
  overflow: hidden;
}

.product-img {
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

.btn-favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #888;
  transition: all 0.25s ease;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.btn-favorite:hover {
  color: #e74c3c;
  background: white;
  transform: scale(1.1);
}

.badge-free {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #22c55e;
  color: white;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.product-tags {
  display: flex;
  gap: 5px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.tag-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: #f0f0f0;
  color: #666;
  font-weight: 500;
}

.tag-condition {
  background: var(--accent-bg);
  color: var(--accent);
}

.product-title-link {
  color: var(--text-main, #333);
  font-weight: 600;
}

.product-title-link:hover {
  color: var(--accent);
}

.product-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #888;
  margin-top: 4px;
}

.seller-info {
  display: flex;
  align-items: center;
  gap: 3px;
}

.seller-score {
  font-weight: 600;
  color: #555;
}

.seller-sep {
  margin: 0 2px;
}

.seller-name {
  color: #888;
}

/* 6. Footer */
.site-footer {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  padding: 2.5rem 0 2rem;
  margin-top: 3rem;
}

.footer-brand {
  font-weight: 700;
  font-size: 1rem;
  color: #1a1a2e;
  margin-bottom: 0.5rem;
}

.footer-desc {
  font-size: 0.85rem;
  color: #888;
  line-height: 1.6;
}

.footer-heading {
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #1a1a2e;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.4rem;
}

.footer-links a {
  color: #666;
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-contact {
  font-size: 0.88rem;
  color: #666;
  margin-bottom: 0.3rem;
}

/* 7. Post Form Page */
.back-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.back-link:hover {
  color: var(--accent) !important;
}

.post-form-card {
  max-width: 700px;
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.post-form-title {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-main, #1a1a2e);
  margin-bottom: 0.25rem;
}

.post-form-subtitle {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.upload-area {
  width: 140px;
  height: 140px;
  border: 2px dashed #d0d5dd;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: #fafbfc;
}

.upload-area:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.upload-area.has-file {
  border-color: #22c55e;
  background: #f0fdf4;
}

.upload-icon {
  font-size: 1.8rem;
  color: #aaa;
  margin-bottom: 4px;
}

.upload-text {
  font-size: 0.8rem;
  color: #888;
}

.upload-preview-img {
  max-width: 140px;
  max-height: 100px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e9ecef;
}

.post-notes {
  background: var(--accent-bg);
  border: 1px solid #c9d5ee;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  color: var(--accent);
}

.post-notes ul {
  padding-left: 1.2rem;
  margin-top: 0.3rem;
}

.post-notes li {
  margin-bottom: 0.2rem;
}

/* ════════════════════════════════════════
   PRODUCT DETAIL PAGE
   ════════════════════════════════════════ */

.pd-container {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.pd-back-link {
  display: inline-flex;
  align-items: center;
  color: #555;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  transition: color 0.2s;
}
.pd-back-link:hover {
  color: var(--accent);
}

.pd-main-card {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.pd-image-wrapper {
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 350px;
  padding: 1rem;
}

.pd-image {
  max-width: 100%;
  max-height: 450px;
  object-fit: contain;
  border-radius: 12px;
}

.pd-info {
  padding: 2rem 2.5rem;
}

.pd-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.pd-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main, #1a1a2e);
  margin-bottom: 0.75rem;
}

.pd-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 1.25rem;
}
.pd-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pd-meta-table {
  margin-bottom: 1.25rem;
}
.pd-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}
.pd-meta-row:last-child {
  border-bottom: none;
}
.pd-meta-label {
  color: #888;
}
.pd-meta-value {
  color: var(--text-main, #333);
  font-weight: 500;
  text-align: right;
}

.pd-status-badge {
  display: inline-block;
  padding: 3px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}
.pd-status-available {
  background: #dcfce7;
  color: #16a34a;
}
.pd-status-sold {
  background: #fee2e2;
  color: #dc2626;
}

/* Seller Card */
.pd-seller-card {
  background: var(--card-bg, #f9fafb);
  border: 1px solid #e9ecef;
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.pd-seller-heading {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main, #333);
  margin-bottom: 0.75rem;
}
.pd-seller-body {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.pd-seller-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.pd-seller-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main, #333);
}
.pd-seller-mssv {
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 2px;
}
.pd-seller-rating {
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.pd-seller-contact {
  font-size: 0.82rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* Action Buttons */
.pd-actions-primary {
  display: flex;
  gap: 12px;
  margin-bottom: 0.75rem;
}
.pd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  flex: 1;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}
.pd-btn-call {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
}
.pd-btn-call:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22,163,74,0.3);
}
.pd-btn-chat {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}
.pd-btn-chat:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.pd-actions-secondary {
  display: flex;
  gap: 10px;
  margin-bottom: 0.5rem;
}
.pd-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.85rem;
  flex: 1;
  border: 1px solid #e0e0e0;
  background: transparent;
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pd-btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.pd-btn-report {
  color: #dc2626;
  border-color: #fca5a5;
}
.pd-btn-report:hover {
  color: #dc2626;
  border-color: #dc2626;
  background: rgba(220,38,38,0.05);
}

/* Description & Reviews Sections */
.pd-section {
  background: var(--card-bg, #fff);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 1.5rem 2rem;
  margin-bottom: 1.25rem;
}
.pd-section-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main, #333);
  margin-bottom: 0.75rem;
}
.pd-section-text {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.7;
}

.pd-review-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
}
.pd-review-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.pd-review-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e9ecef;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.pd-review-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main, #333);
}
.pd-review-stars {
  font-size: 0.75rem;
  margin: 2px 0 4px;
}
.pd-review-comment {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 2px;
}
.pd-review-date {
  font-size: 0.75rem;
  color: #aaa;
}

/* Buy Section */
.pd-buy-section {
  margin-bottom: 2rem;
}
.pd-btn-buy {
  display: flex;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 14px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
  justify-content: center;
  transition: all 0.2s ease;
  border: none;
}
.pd-btn-buy:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(217,119,6,0.3);
}

/* Product Detail Dark Mode */
[data-theme="dark"] .pd-main-card {
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
[data-theme="dark"] .pd-image-wrapper {
  background: var(--input-bg);
}
[data-theme="dark"] .pd-back-link {
  color: var(--text-muted);
}
[data-theme="dark"] .pd-meta-row {
  border-bottom-color: var(--border-color);
}
[data-theme="dark"] .pd-meta-label {
  color: var(--text-muted);
}
[data-theme="dark"] .pd-seller-card {
  background: var(--input-bg);
  border-color: var(--border-color);
}
[data-theme="dark"] .pd-seller-contact {
  color: var(--text-muted);
}
[data-theme="dark"] .pd-btn-outline {
  border-color: var(--border-color);
  color: var(--text-muted);
}
[data-theme="dark"] .pd-btn-outline:hover {
  border-color: var(--accent);
  color: #8fa9d4;
}
[data-theme="dark"] .pd-section {
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
[data-theme="dark"] .pd-section-text,
[data-theme="dark"] .pd-review-comment {
  color: var(--text-muted);
}
[data-theme="dark"] .pd-review-item {
  border-bottom-color: var(--border-color);
}
[data-theme="dark"] .pd-review-avatar {
  background: var(--border-color);
  color: var(--text-muted);
}
[data-theme="dark"] .pd-status-available {
  background: rgba(22, 163, 74, 0.15);
  color: #4ade80;
}
[data-theme="dark"] .pd-status-sold {
  background: rgba(220, 38, 38, 0.15);
  color: #f87171;
}

/* Product detail responsive */
@media (max-width: 991px) {
  .pd-info {
    padding: 1.5rem;
  }
  .pd-image-wrapper {
    min-height: 250px;
  }
}
@media (max-width: 768px) {
  .pd-info {
    padding: 1.25rem;
  }
  .pd-price {
    font-size: 1.4rem;
  }
  .pd-title {
    font-size: 1.1rem;
  }
  .pd-image-wrapper {
    min-height: 200px;
  }
  .pd-image {
    max-height: 300px;
  }
  .pd-section {
    padding: 1rem 1.25rem;
  }
}

/* ════════════════════════════════════════
   MY POSTS PAGE
   ════════════════════════════════════════ */

.mp-stat-card {
  background: var(--card-bg, #fff);
  border-radius: 14px;
  border: 1px solid #e9ecef;
  padding: 1.25rem;
}
.mp-stat-label {
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 0.25rem;
}
.mp-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main, #1a1a2e);
  margin-bottom: 0;
}

.mp-filters {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.mp-filters::-webkit-scrollbar { display: none; }

.mp-filter-btn {
  padding: 10px 20px;
  border-radius: 10px;
  white-space: nowrap;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid #e0e0e0;
  background: var(--card-bg, #fff);
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mp-filter-btn:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}
.mp-filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.mp-post-card {
  background: var(--card-bg, #fff);
  border-radius: 14px;
  border: 1px solid #e9ecef;
  overflow: hidden;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}
.mp-post-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.mp-post-img-wrapper {
  display: block;
  height: 100%;
  min-height: 180px;
  overflow: hidden;
  background: #f8f9fa;
}
.mp-post-img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.mp-post-img:hover {
  transform: scale(1.05);
}

.mp-post-info {
  padding: 1.25rem;
}

.mp-post-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main, #1a1a2e);
  text-decoration: none;
  display: block;
  transition: color 0.2s;
}
.mp-post-title:hover {
  color: var(--accent);
}

.mp-post-price {
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--accent);
  white-space: nowrap;
  margin-bottom: 0;
}

.mp-tag {
  display: inline-block;
  padding: 2px 10px;
  background: #f0f0f0;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #666;
  font-weight: 500;
}
.mp-tag-sold {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: #f3f4f6;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #555;
  font-weight: 500;
}
.mp-tag-available {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: #dcfce7;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #16a34a;
  font-weight: 500;
}
.mp-tag-pending {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: #fff7ed;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #ea580c;
  font-weight: 500;
}

.mp-post-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.82rem;
  color: #888;
  flex-wrap: wrap;
}

.mp-action-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: transparent;
  color: #555;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}
.mp-action-btn:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}
.mp-action-sold {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
}
.mp-action-sold:hover {
  background: #15803d;
  color: white;
  border-color: #15803d;
}
.mp-action-delete {
  border-color: #fca5a5;
  color: #dc2626;
}
.mp-action-delete:hover {
  background: rgba(220,38,38,0.05);
  border-color: #dc2626;
  color: #dc2626;
}

.mp-empty-state {
  background: var(--card-bg, #fff);
  border-radius: 14px;
  border: 1px solid #e9ecef;
  padding: 4rem 2rem;
  text-align: center;
}
.mp-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: #f3f4f6;
  border-radius: 50%;
  margin-bottom: 1rem;
  font-size: 2.5rem;
  color: #aaa;
}

.mp-btn-post {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}
.mp-btn-post:hover {
  background: var(--accent-hover);
  color: white;
  transform: translateY(-1px);
}

/* My Posts Dark Mode */
[data-theme="dark"] .mp-stat-card {
  background: var(--card-bg) !important;
  border-color: var(--border-color);
  color: var(--text-main);
}
[data-theme="dark"] .mp-stat-label {
  color: var(--text-muted);
}
[data-theme="dark"] .mp-stat-value {
  color: var(--text-main);
}
[data-theme="dark"] .mp-filter-btn {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-muted);
}
[data-theme="dark"] .mp-filter-btn:hover {
  background: rgba(91,123,213,0.1);
}
[data-theme="dark"] .mp-filter-btn.active {
  background: var(--accent);
  color: white;
}
[data-theme="dark"] .mp-post-card {
  background: var(--card-bg) !important;
  border-color: var(--border-color);
}
[data-theme="dark"] .mp-post-card:hover {
  border-color: var(--accent);
}
[data-theme="dark"] .mp-post-img-wrapper {
  background: var(--input-bg);
}
[data-theme="dark"] .mp-post-title {
  color: var(--text-main) !important;
}
[data-theme="dark"] .mp-post-price {
  color: #f97316 !important;
}
[data-theme="dark"] .mp-post-meta {
  color: var(--text-muted);
}
[data-theme="dark"] .mp-tag {
  background: var(--border-color);
  color: var(--text-muted);
}
[data-theme="dark"] .mp-tag-sold {
  background: rgba(37,99,235,0.15);
  color: #60a5fa;
}
[data-theme="dark"] .mp-tag-available {
  background: rgba(22,163,74,0.15);
  color: #4ade80;
}
[data-theme="dark"] .mp-tag-pending {
  background: rgba(234,88,12,0.15);
  color: #fb923c;
}
[data-theme="dark"] .mp-action-btn {
  border-color: var(--border-color);
  color: var(--text-main);
}
[data-theme="dark"] .mp-action-btn:hover {
  background: rgba(91,123,213,0.1);
  border-color: var(--accent);
  color: var(--accent);
}
[data-theme="dark"] .mp-action-sold {
  background: #16a34a;
  color: #fff !important;
  border-color: #16a34a;
}
[data-theme="dark"] .mp-action-sold:hover {
  background: #15803d;
  color: #fff !important;
}
[data-theme="dark"] .mp-action-delete {
  border-color: rgba(220,38,38,0.4);
  color: #f87171;
}
[data-theme="dark"] .mp-action-delete:hover {
  background: rgba(220,38,38,0.15);
  border-color: #f87171;
  color: #f87171;
}
[data-theme="dark"] .mp-empty-state {
  border-color: var(--border-color);
}
[data-theme="dark"] .mp-empty-icon {
  background: var(--border-color);
  color: var(--text-muted);
}
/* Modal dark mode for My Posts */
[data-theme="dark"] .mp-post-card .modal-content {
  background: var(--card-bg) !important;
  color: var(--text-main) !important;
}

/* My Posts responsive */
@media (max-width: 768px) {
  .mp-post-img-wrapper {
    min-height: 160px;
  }
  .mp-post-img {
    min-height: 160px;
  }
  .mp-post-info {
    padding: 1rem;
  }
  .mp-post-title {
    font-size: 0.95rem;
  }
  .mp-post-price {
    font-size: 1.1rem;
  }
  .mp-stat-value {
    font-size: 1.4rem;
  }
}

/* Legacy price class (still used elsewhere) */
.price {
  color: var(--tdtu-red);
  font-weight: bold;
}

/* ════════════════════════════════════════
   PROFILE PAGE
   ════════════════════════════════════════ */

.pf-card {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  border: 1px solid #e9ecef;
  padding: 1.5rem;
}

.pf-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 3rem;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(91,123,213,0.25);
}

.pf-avatar-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
}

.pf-avatar-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.pf-avatar-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pf-avatar-wrap:hover .pf-avatar-overlay {
  opacity: 1;
}

.navbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.3);
}

.pf-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid;
  font-size: 0.75rem;
  font-weight: 500;
}

.pf-label {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
}
.pf-label-badge {
  margin-left: 8px;
  background: #fff0f0;
  color: #c0392b;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #f5b7b1;
}

.pf-input {
  border-radius: 10px !important;
  border: 1px solid #e0e0e0 !important;
  padding: 12px 16px !important;
  font-size: 0.95rem !important;
  transition: all 0.2s;
}
.pf-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(91,123,213,0.1) !important;
}

.pf-readonly {
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 10px;
  color: var(--text-main, #1a1a2e);
  font-size: 0.95rem;
}

.pf-hint {
  font-size: 0.78rem;
  color: #999;
  margin-top: 6px;
  margin-bottom: 0;
}

.pf-security-btn {
  display: block;
  padding: 14px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-main, #1a1a2e);
  font-weight: 500;
  transition: all 0.2s;
}
.pf-security-btn:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

/* Profile Dark Mode */
[data-theme="dark"] .pf-card {
  background: var(--card-bg) !important;
  border-color: var(--border-color);
}
[data-theme="dark"] .pf-input {
  background: var(--input-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-main) !important;
}
[data-theme="dark"] .pf-readonly {
  background: var(--input-bg);
  color: var(--text-main);
}
[data-theme="dark"] .pf-label {
  color: var(--text-muted);
}
[data-theme="dark"] .pf-security-btn {
  background: var(--input-bg);
  border-color: var(--border-color);
  color: var(--text-main);
}
[data-theme="dark"] .pf-security-btn:hover {
  background: rgba(91,123,213,0.15);
  border-color: var(--accent);
  color: var(--accent);
}
[data-theme="dark"] #changePwForm .form-control {
  background: var(--input-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-main) !important;
}
[data-theme="dark"] #changePwForm .pf-label,
[data-theme="dark"] #changePwForm label {
  color: var(--text-main) !important;
}

/* ════════════════════════════════════════
   ADMIN PANEL
   ════════════════════════════════════════ */

.adm-sidebar {
  background: var(--card-bg, #fff);
  border-radius: 14px;
  border: 1px solid #e9ecef;
  padding: 0.5rem;
  position: sticky;
  top: 80px;
}
.adm-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  text-decoration: none;
  color: #666;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s;
  position: relative;
}
.adm-nav-item:hover {
  background: var(--accent-bg);
  color: var(--accent);
}
.adm-nav-item.active {
  background: var(--accent);
  color: white;
}
.adm-badge {
  margin-left: auto;
  background: #dc2626;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.adm-nav-item.active .adm-badge {
  background: rgba(255,255,255,0.3);
}

.adm-stat-card {
  background: var(--card-bg, #fff);
  border-radius: 14px;
  border: 1px solid #e9ecef;
  padding: 1.25rem;
}
.adm-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.adm-stat-label {
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 0.25rem;
}
.adm-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main, #1a1a2e);
  margin-bottom: 0;
}

.adm-card {
  background: var(--card-bg, #fff);
  border-radius: 14px;
  border: 1px solid #e9ecef;
  padding: 1.25rem;
}

.adm-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  transition: background 0.2s;
}
.adm-list-item:hover {
  background: #f8f9fa;
}
.adm-list-img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}

.adm-badge-green {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.adm-badge-orange {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  background: #fff7ed;
  color: #ea580c;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.adm-progress-bar {
  width: 100%;
  height: 10px;
  background: #f3f4f6;
  border-radius: 10px;
  overflow: hidden;
}
.adm-progress-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.5s ease;
}

.adm-quick-actions {
  background: var(--accent-gradient);
  border-radius: 14px;
  padding: 1.5rem;
  color: white;
}
.adm-quick-btn {
  display: block;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  color: white;
  transition: all 0.2s;
}
.adm-quick-btn:hover {
  background: rgba(255,255,255,0.25);
  color: white;
}

.adm-table thead {
  background: #f8f9fa;
}
.adm-table th {
  font-size: 0.82rem;
  font-weight: 600;
  color: #666;
  padding: 14px 16px !important;
  border-bottom: 1px solid #e9ecef;
}
.adm-table td {
  padding: 14px 16px !important;
  vertical-align: middle;
  border-bottom: 1px solid #f3f4f6;
}
.adm-table tr:hover {
  background: #f8faff;
}
.adm-table-img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}
.adm-tag {
  display: inline-block;
  padding: 2px 10px;
  background: #f0f0f0;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #666;
}

.adm-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.adm-action-btn:hover {
  background: #f0f0f0;
  color: #333;
}
.adm-action-approve {
  color: #16a34a;
}
.adm-action-approve:hover {
  background: #dcfce7;
  color: #16a34a;
}
.adm-action-reject {
  color: #dc2626;
}
.adm-action-reject:hover {
  background: #fee2e2;
  color: #dc2626;
}

.adm-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Online/Offline Status Indicator */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-online {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  animation: pulse-green 2s infinite;
}
.status-offline {
  background: #d1d5db;
}
.status-away {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
  animation: pulse-orange 2s infinite;
}
.status-text {
  color: #9ca3af;
}
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}
@keyframes pulse-orange {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

.adm-guidelines {
  border-radius: 14px;
  border: 1px solid;
  padding: 1.25rem;
}

/* Admin Dark Mode */
[data-theme="dark"] .adm-sidebar {
  background: var(--card-bg);
  border-color: var(--border-color);
}
[data-theme="dark"] .adm-nav-item {
  color: var(--text-muted);
}
[data-theme="dark"] .adm-nav-item:hover {
  background: rgba(91,123,213,0.1);
  color: var(--text-main);
}
[data-theme="dark"] .adm-stat-card,
[data-theme="dark"] .adm-card {
  background: var(--card-bg) !important;
  border-color: var(--border-color);
  color: var(--text-main);
}
[data-theme="dark"] .adm-stat-label {
  color: var(--text-muted);
}
[data-theme="dark"] .adm-stat-value {
  color: var(--text-main);
}
[data-theme="dark"] .adm-list-item:hover {
  background: var(--border-color);
}
/* Override Bootstrap .table backgrounds in dark mode */
[data-theme="dark"] .adm-table,
[data-theme="dark"] .adm-table > :not(caption) > * > * {
  background-color: var(--card-bg) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}
[data-theme="dark"] .adm-table thead,
[data-theme="dark"] .adm-table thead > tr > th {
  background: var(--input-bg) !important;
  color: var(--text-muted) !important;
  border-color: var(--border-color) !important;
}
[data-theme="dark"] .adm-table td {
  border-color: var(--border-color) !important;
}
[data-theme="dark"] .adm-table tr:hover > * {
  background: rgba(91,123,213,0.08) !important;
}
[data-theme="dark"] .adm-table .fw-medium,
[data-theme="dark"] .adm-table code {
  color: var(--text-main) !important;
}
[data-theme="dark"] .adm-table .text-muted {
  color: var(--text-muted) !important;
}
[data-theme="dark"] .adm-tag {
  background: var(--border-color);
  color: var(--text-muted);
}
[data-theme="dark"] .adm-badge-green {
  background: rgba(22,163,74,0.15);
  color: #4ade80;
}
[data-theme="dark"] .adm-badge-orange {
  background: rgba(234,88,12,0.15);
  color: #fb923c;
}
[data-theme="dark"] .adm-progress-bar {
  background: var(--border-color);
}
/* Stat icon backgrounds - softer in dark mode */
[data-theme="dark"] .adm-stat-icon {
  opacity: 0.85;
}
/* Guidelines/Notes dark mode */
[data-theme="dark"] .adm-guidelines {
  background: var(--input-bg) !important;
  border-color: var(--border-color) !important;
}
[data-theme="dark"] .adm-guidelines h6,
[data-theme="dark"] .adm-guidelines .fw-bold {
  color: var(--text-main) !important;
}
[data-theme="dark"] .adm-guidelines li,
[data-theme="dark"] .adm-guidelines ul {
  color: var(--text-muted) !important;
}
/* Action buttons in dark mode */
[data-theme="dark"] .adm-action-btn {
  color: var(--text-muted);
}
[data-theme="dark"] .adm-action-btn:hover {
  background: var(--border-color);
  color: var(--text-main);
}
[data-theme="dark"] .adm-action-approve {
  color: #4ade80;
}
[data-theme="dark"] .adm-action-approve:hover {
  background: rgba(22,163,74,0.15);
  color: #4ade80;
}
[data-theme="dark"] .adm-action-reject {
  color: #f87171;
}
[data-theme="dark"] .adm-action-reject:hover {
  background: rgba(220,38,38,0.15);
  color: #f87171;
}
/* Table image border in dark mode */
[data-theme="dark"] .adm-table-img {
  border: 1px solid var(--border-color);
}
/* User avatar */
[data-theme="dark"] .adm-user-avatar {
  background: var(--accent);
}
/* Quick actions in dark */
[data-theme="dark"] .adm-quick-actions {
  background: linear-gradient(135deg, #2d3a66, #3a4a8a);
}
/* Delete user modal dark mode */
[data-theme="dark"] #deleteUserModal .modal-content {
  background: var(--card-bg) !important;
  color: var(--text-main) !important;
}
[data-theme="dark"] #deleteUserModal .modal-body p {
  color: var(--text-main);
}
[data-theme="dark"] #deleteUserModal .alert-danger {
  background: rgba(220,38,38,0.15) !important;
  color: #f87171 !important;
  border-color: rgba(220,38,38,0.3) !important;
}

/* Admin responsive */
@media (max-width: 992px) {
  .adm-sidebar {
    position: static;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    margin-bottom: 1rem;
  }
  .adm-nav-item {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 10px 14px;
  }
}

/* 5. Nút bấm & Tiện ích */
.btn-primary {
  background: var(--accent-gradient);
  border: none;
  border-radius: 12px;
}

.btn-post {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

.hidden {
  display: none;
}
.input-group-text {
  cursor: pointer;
}
#passwordRules li {
  font-size: 0.85rem;
  list-style: none;
}

/* ════════════════════════════════════════
   DARK MODE — CSS Variables
   ════════════════════════════════════════ */

/* Mặc định: Light */
:root {
  --body-bg:      #f4f6f9;
  --card-bg:      #ffffff;
  --text-main:    #2d3748;
  --text-muted:   #718096;
  --border-color: #e2e8f0;
  --navbar-bg:    #ffffff;
  --input-bg:     #ffffff;
  --input-color:  #2d3748;
  --badge-bg:     #e2e8f0;
}

/* Dark theme */
[data-theme="dark"] {
  --body-bg:      #0f1117;
  --card-bg:      #1e2130;
  --text-main:    #e8eaf0;
  --text-muted:   #9098b1;
  --border-color: #2d3348;
  --navbar-bg:    #161823;
  --input-bg:     #252840;
  --input-color:  #e8eaf0;
  --badge-bg:     #2d3348;
}

body {
  background-color: var(--body-bg) !important;
  color: var(--text-main) !important;
  transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] .navbar,
[data-theme="dark"] nav.navbar {
  background-color: var(--navbar-bg) !important;
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .list-group-item,
[data-theme="dark"] .auth-card {
  background-color: var(--card-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-main) !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-control-lg,
[data-theme="dark"] .form-select-lg {
  background-color: var(--input-bg) !important;
  color: var(--input-color) !important;
  border-color: var(--border-color) !important;
}
[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .form-control-lg::placeholder,
[data-theme="dark"] textarea.form-control::placeholder {
  color: var(--text-muted) !important;
  opacity: 0.7;
}
[data-theme="dark"] .form-check-label {
  color: var(--text-muted);
}
[data-theme="dark"] .form-label {
  color: var(--text-main);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 84, 166, 0.35);
}

[data-theme="dark"] .text-muted {
  color: var(--text-muted) !important;
}

[data-theme="dark"] .text-dark {
  color: var(--text-main) !important;
}

[data-theme="dark"] .text-muted {
  color: #9ca3af !important;
}

[data-theme="dark"] .table {
  color: #e0e0e0;
}

[data-theme="dark"] .table td,
[data-theme="dark"] .table th {
  border-color: rgba(255,255,255,0.08);
}

/* Admin tables – black text for Student/Product, Posted By & Date columns */
.admin-user-email { color: #000000; }
.admin-user-date  { color: #000000; }

/* col1=Student/Product */
.table tbody td:nth-child(1),
.table tbody td:nth-child(1) .fw-medium,
.table tbody td:nth-child(1) a {
  color: #000000 !important;
}

/* col2=Posted by */
.table tbody td:nth-child(2) {
  color: #000000 !important;
}

/* col6=Date */
.table tbody td:nth-child(6) {
  color: #000000 !important;
}

/* Status dot on avatar */
.status-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
}
.status-online  { background: #22c55e; }
.status-away    { background: #f59e0b; }
.status-offline { background: #9ca3af; }

.status-online::after {
  content: '';
  position: absolute;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-online 1.5s infinite;
}

@keyframes pulse-online {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Status badges */
.admin-status-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
}
.admin-status-online  { background: #dcfce7; color: #16a34a; }
.admin-status-away    { background: #fef3c7; color: #b45309; }
.admin-status-offline { background: #f3f4f6; color: #6b7280; }

[data-theme="dark"] .status-dot { border-color: var(--card-bg, #1e1e2e); }
[data-theme="dark"] .admin-status-online  { background: rgba(34,197,94,0.15); color: #4ade80; }
[data-theme="dark"] .admin-status-away    { background: rgba(245,158,11,0.15); color: #fbbf24; }
[data-theme="dark"] .admin-status-offline { background: rgba(156,163,175,0.15); color: #9ca3af; }

[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-white {
  background-color: var(--card-bg) !important;
}

[data-theme="dark"] .dropdown-menu {
  background-color: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item {
  color: var(--text-main);
}

[data-theme="dark"] .dropdown-item:hover {
  background-color: var(--border-color);
}

[data-theme="dark"] .btn-light {
  background-color: var(--badge-bg) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .border-bottom,
[data-theme="dark"] hr {
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .notification-unread {
  background-color: #1a2540 !important;
}

/* Notifications dark mode — contact info box */
[data-theme="dark"] .pf-card {
  background: var(--card-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-main) !important;
}

/* Contact info box inside notification card */
[data-theme="dark"] .noti-contact-box {
  background: rgba(99,102,241,0.12) !important;
  border-color: rgba(99,102,241,0.25) !important;
}
[data-theme="dark"] .noti-contact-box span,
[data-theme="dark"] .noti-contact-box strong {
  color: var(--text-main) !important;
}
[data-theme="dark"] .noti-contact-box .text-divider {
  color: var(--text-muted) !important;
}

/* The 'Quản lý tin đăng' green button in dark mode */
[data-theme="dark"] a[style*="#f0fdf4"],
[data-theme="dark"] a[style*="f0fdf4"] {
  background: rgba(22,163,74,0.15) !important;
  border-color: rgba(22,163,74,0.35) !important;
  color: #4ade80 !important;
}

/* Notification message text */
[data-theme="dark"] .noti-msg {
  color: var(--text-main) !important;
}

/* Notification border-start (unread indicator) */
[data-theme="dark"] .border-start.border-primary {
  border-color: var(--accent) !important;
}

[data-theme="dark"] .hero-section {
  background: linear-gradient(135deg, #1e2d4a 0%, #2a3f5f 40%, #3a5275 100%);
}

[data-theme="dark"] .hero-search-box .form-control {
  background-color: var(--input-bg) !important;
  color: var(--input-color) !important;
}

[data-theme="dark"] .site-footer {
  background: var(--navbar-bg);
  border-top-color: var(--border-color);
}

[data-theme="dark"] .footer-brand,
[data-theme="dark"] .footer-heading {
  color: var(--text-main);
}

[data-theme="dark"] .footer-desc,
[data-theme="dark"] .footer-contact,
[data-theme="dark"] .footer-links a {
  color: var(--text-muted);
}

[data-theme="dark"] .brand-name {
  color: var(--text-main);
}

[data-theme="dark"] .btn-category {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-muted);
}
[data-theme="dark"] .btn-category.active,
[data-theme="dark"] .btn-category:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

[data-theme="dark"] .btn-price {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-muted);
}
[data-theme="dark"] .btn-price.active,
[data-theme="dark"] .btn-price:hover {
  background: var(--text-main);
  color: var(--body-bg);
  border-color: var(--text-main);
}

[data-theme="dark"] .tag-badge {
  background: var(--border-color);
  color: var(--text-muted);
}
[data-theme="dark"] .tag-condition {
  background: rgba(91, 123, 213, 0.2);
  color: #8fa9d4;
}

[data-theme="dark"] .product-title-link {
  color: var(--text-main);
}

[data-theme="dark"] .seller-score {
  color: var(--text-muted);
}

[data-theme="dark"] .btn-favorite {
  background: rgba(30, 33, 48, 0.9);
  color: var(--text-muted);
}

[data-theme="dark"] .post-form-card {
  background: var(--card-bg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .post-form-title {
  color: var(--text-main);
}
[data-theme="dark"] .post-form-subtitle {
  color: var(--text-muted);
}

[data-theme="dark"] .upload-area {
  background: var(--input-bg);
  border-color: var(--border-color);
}
[data-theme="dark"] .upload-area:hover {
  border-color: var(--accent);
  background: rgba(91, 123, 213, 0.1);
}
[data-theme="dark"] .upload-text {
  color: var(--text-muted);
}

[data-theme="dark"] .post-notes {
  background: rgba(91, 123, 213, 0.1);
  border-color: rgba(91, 123, 213, 0.2);
  color: #8fa9d4;
}

[data-theme="dark"] small.text-muted {
  color: var(--text-muted) !important;
}

[data-theme="dark"] .auth-body {
  background: linear-gradient(135deg, #111b2e 0%, #0e1726 100%);
}

[data-theme="dark"] .reset-wrapper {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

[data-theme="dark"] .reset-body {
  background-color: var(--card-bg) !important;
  color: var(--text-main) !important;
}

[data-theme="dark"] .reset-header {
  background: linear-gradient(135deg, #0d1117, #161b22);
}

[data-theme="dark"] .input-group-text {
  background-color: var(--input-bg) !important;
  color: var(--text-muted) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .card-header {
  background-color: var(--navbar-bg) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .alert {
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .alert-success {
  background-color: rgba(25, 135, 84, 0.15) !important;
  color: #75d6a0 !important;
}

[data-theme="dark"] .alert-danger {
  background-color: rgba(220, 53, 69, 0.15) !important;
  color: #f5a0a8 !important;
}

[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

[data-theme="dark"] .btn-outline-secondary {
  border-color: var(--border-color);
  color: var(--text-main);
}

[data-theme="dark"] .btn-outline-primary {
  border-color: #4a90d9;
  color: #6db3f8;
}

[data-theme="dark"] .post-manage-card:hover {
  background-color: var(--input-bg) !important;
  border-color: var(--tdtu-blue) !important;
}

[data-theme="dark"] .strength-bar {
  background: var(--border-color);
}

/* ════════════════════════════════════════
   SETTINGS BAR (Nút Dark + Lang)
   ════════════════════════════════════════ */
.settings-bar {
  position: fixed;
  bottom: 100px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1040;
}

.navbar .dropdown-menu {
  z-index: 9999 !important;
  position: absolute !important;
}

nav.navbar.sticky-top {
  z-index: 1060 !important;
  overflow: visible !important;
}

.settings-bar .btn {
  border-radius: 50px;
  font-size: 0.78rem;
  padding: 6px 12px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.settings-bar .btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

[data-theme="dark"] .settings-bar .btn-outline-secondary {
  border-color: var(--border-color);
  color: var(--text-main);
}

/* ════════════════════════════════════════
   RESPONSIVE — Mobile Optimizations
   ════════════════════════════════════════ */

/* Category pills: cuộn ngang trên mobile */
.category-pill {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

/* ─── Navbar dropdown: static on mobile collapse (≤991px) ─── */
@media (max-width: 991px) {
  .navbar .dropdown-menu {
    position: static !important;
    box-shadow: none !important;
    border: 1px solid var(--border-color, #e5e7eb) !important;
    margin-top: 0.25rem;
    width: 100%;
  }
}

/* ─── Tablet & below (≤768px) ─── */
@media (max-width: 768px) {

  /* === AUTH PAGE === */
  .auth-card {
    border-radius: 16px;
    width: 95% !important;
    max-width: 100% !important;
    margin: 0 auto;
  }
  .auth-card .card-body {
    padding: 1.25rem !important;
  }
  .auth-body {
    padding: 1rem 0.5rem;
  }

  /* === NAVBAR === */
  .navbar .nav-link {
    font-size: 0.85rem;
  }
  .navbar .navbar-brand {
    font-size: 1rem !important;
  }
  .navbar .dropdown-toggle {
    font-size: 0.82rem;
    padding: 0.3rem 0.5rem;
  }
  .navbar .dropdown-menu {
    font-size: 0.85rem;
  }
  .navbar-nav {
    gap: 0 !important;
  }

  /* === HERO SECTION (INDEX) === */
  .hero-section {
    padding: 24px 0 20px;
  }
  .hero-title {
    font-size: 1.2rem;
  }
  .hero-desc {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }
  .hero-search-box .form-control {
    font-size: 0.9rem;
    padding: 10px 14px 10px 38px;
  }

  /* === CATEGORY & PRICE PILLS === */
  .btn-category {
    font-size: 0.78rem;
    padding: 5px 12px;
  }
  .btn-price {
    font-size: 0.76rem;
    padding: 4px 10px;
  }
  .filter-label {
    font-size: 0.95rem;
  }

  /* === PRODUCT CARDS === */
  .product-img {
    height: 130px;
  }
  .product-card .card-body {
    padding: 0.6rem;
  }
  .product-card .card-title {
    font-size: 0.82rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
  }
  .product-card .price {
    font-size: 0.85rem;
  }
  .product-price {
    font-size: 0.85rem;
  }
  .product-tags {
    gap: 3px;
  }
  .tag-badge {
    font-size: 0.62rem;
    padding: 1px 6px;
  }
  .product-card .card-body .small {
    font-size: 0.7rem;
  }

  /* === PRODUCT DETAIL: vertical stack === */
  .card .row.g-0 .col-md-6.border-end {
    border-right: none !important;
    border-bottom: 1px solid var(--border-color);
  }
  .card .row.g-0 .col-md-6 .card-body {
    padding: 1.25rem !important;
  }
  .card .row.g-0 .col-md-6 .card-body h2 {
    font-size: 1.2rem;
  }
  .card .row.g-0 .col-md-6 .card-body h3 {
    font-size: 1rem;
  }
  .card .row.g-0 .col-md-6 img {
    max-height: 250px;
    width: 100%;
    object-fit: contain;
  }

  /* === PROFILE PAGE === */
  .container.py-5 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  .container.py-5 .col-md-6 {
    max-width: 100%;
  }
  .container.py-5 .card-body {
    padding: 1rem !important;
  }

  /* === POST ITEM PAGE === */
  .container.mt-5 {
    margin-top: 1.5rem !important;
  }
  .container.mt-5 .card {
    margin: 0 !important;
  }
  .container.mt-5 .card-body {
    padding: 1rem !important;
  }
  .container.mt-5 .card .row .col-md-6 {
    max-width: 100%;
    flex: 0 0 100%;
  }

  /* === POST FORM CARD (Đăng tin) === */
  .post-form-card {
    padding: 1.25rem;
    border-radius: 12px;
  }

  /* === MY POSTS PAGE === */
  .container.py-4 {
    padding: 0.75rem !important;
  }
  /* Sidebar: full width on mobile, compact */
  .container.py-4 .col-md-3 {
    max-width: 100%;
    flex: 0 0 100%;
    margin-bottom: 1rem;
  }
  .container.py-4 .col-md-3 .card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem !important;
    flex-wrap: wrap;
  }
  .container.py-4 .col-md-3 .card-body .rounded-circle {
    width: 50px !important;
    height: 50px !important;
    font-size: 1.6rem !important;
    flex-shrink: 0;
  }
  .container.py-4 .col-md-3 .card-body h5 {
    margin-bottom: 0 !important;
    font-size: 1rem;
  }
  .container.py-4 .col-md-3 .card-body p.text-muted {
    margin-bottom: 0 !important;
    font-size: 0.75rem;
  }
  .container.py-4 .col-md-3 .card-body hr {
    display: none;
  }
  .container.py-4 .col-md-3 .card-body .d-flex.justify-content-between {
    font-size: 0.85rem;
  }
  .container.py-4 .col-md-3 .card-body .btn.btn-primary {
    width: auto;
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    margin-top: 0.5rem !important;
  }

  /* Main listing col: full width */
  .container.py-4 .col-md-9 {
    max-width: 100%;
    flex: 0 0 100%;
  }

  /* Post management card */
  .post-manage-card {
    flex-direction: column;
  }
  .post-manage-card img {
    width: 100% !important;
    height: 150px !important;
    border-radius: 8px !important;
    margin-bottom: 0.5rem;
  }
  .post-manage-card .d-flex.gap-2 {
    flex-wrap: wrap;
  }
  .post-manage-card .btn-sm {
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
  }

  /* === NOTIFICATIONS === */
  .notification-unread,
  .card.border-0.shadow-sm .p-3 {
    padding: 0.75rem !important;
  }
  .notification-unread .d-flex,
  .card.border-0.shadow-sm .p-3 .d-flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
  }
  .notification-unread .d-flex .gap-2,
  .notification-unread .d-flex .d-flex.gap-2 {
    flex-wrap: wrap;
  }
  .notification-unread .d-flex .btn-sm {
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
  }

  /* === TABLE RESPONSIVE scroll hint === */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e9ecef);
    position: relative;
  }

  /* === FOOTER mobile === */
  .site-footer {
    text-align: center;
    padding: 1.5rem 0;
  }
  .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  .footer-links li {
    margin-bottom: 0;
  }

  /* === SETTINGS BAR + FAB BUTTON === */
  .settings-bar {
    bottom: 80px;
    right: 10px;
  }
  .settings-bar .btn {
    font-size: 0.68rem;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }
  .btn-post {
    bottom: 16px;
    right: 14px;
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  /* === MODALS === */
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  .modal-body {
    padding: 1rem;
  }

  /* === RESET PASSWORD === */
  .reset-wrapper .col-md-6 {
    max-width: 95%;
  }

  /* === ERROR PAGE === */
  .card.border-0.shadow-sm.rounded-4.p-5 {
    padding: 2rem !important;
    margin: 1rem;
    max-width: calc(100% - 2rem) !important;
  }

  /* General spacing cleanups */
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  h4, h5 { font-size: 1.05rem; }
}

/* ─── Small phones (≤480px) ─── */
@media (max-width: 480px) {

  /* Product grid: 2 columns, tighter gap */
  .col-6 {
    padding-left: 4px;
    padding-right: 4px;
  }
  .row.g-4 {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
  }

  .product-img {
    height: 110px;
  }
  .product-card .card-title {
    font-size: 0.78rem;
  }
  .product-card .price {
    font-size: 0.8rem;
  }
  .product-price {
    font-size: 0.78rem;
  }
  .product-card .card-body .small {
    font-size: 0.65rem;
  }

  /* Product detail compact on small phones */
  .pd-section {
    padding: 0.75rem 1rem;
  }
  .pd-info {
    padding: 1rem;
  }
  .pd-price {
    font-size: 1.2rem;
  }
  .pd-title {
    font-size: 1rem;
  }

  /* Notification contact box stack vertically */
  .noti-contact-box .d-flex {
    flex-direction: column !important;
    gap: 4px !important;
  }
  .noti-contact-box .text-divider {
    display: none;
  }

  /* Settings bar + FAB: better spacing */
  .settings-bar {
    bottom: 74px;
    right: 6px;
  }
  .btn-post {
    bottom: 12px;
    right: 8px;
  }

  .btn-category {
    font-size: 0.72rem;
    padding: 3px 8px;
  }

  /* Auth card: even closer to edges */
  .auth-card {
    width: 100% !important;
    border-radius: 12px;
  }
  .auth-card .card-body {
    padding: 1rem !important;
  }

  /* Navbar compact */
  .navbar .navbar-brand {
    font-size: 0.9rem !important;
  }
  .navbar-nav .nav-link {
    font-size: 0.78rem;
    padding: 0.3rem 0.35rem;
  }

  /* Hero section compact */
  .hero-section {
    padding: 16px 0 14px;
  }
  .hero-title {
    font-size: 1rem;
  }
  .hero-desc {
    font-size: 0.8rem;
  }

  /* Settings bar smallest */
  .settings-bar {
    bottom: 70px;
    right: 8px;
  }
  .settings-bar .btn {
    font-size: 0.62rem;
    padding: 3px 7px;
  }
  .btn-post {
    width: 44px;
    height: 44px;
    font-size: 16px;
    bottom: 14px;
    right: 10px;
  }

  /* Post manage cards compact */
  .post-manage-card img {
    height: 120px !important;
  }
}

/* ─── Very small phones (≤360px) ─── */
@media (max-width: 360px) {
  .auth-card .card-body {
    padding: 0.75rem !important;
  }
  .search-section h2 {
    font-size: 0.9rem;
  }
  .product-img {
    height: 95px;
  }
  .navbar .navbar-brand {
    font-size: 0.8rem !important;
  }
}

