/* =====================================================
   TẠP HÓA SỐ - Stylesheet bổ sung cho Tailwind CDN
   Phong cách: hiện đại, bo góc mềm mại (rounded-3xl)
   ===================================================== */

:root {
  --brand: #6366f1;        /* indigo-500 */
  --brand-dark: #4f46e5;   /* indigo-600 */
  --brand-2: #a855f7;      /* purple-500 */
}

html { scroll-behavior: smooth; }

body {
  font-family: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .625rem 1.25rem; border-radius: 9999px;
  font-weight: 600; font-size: .875rem; line-height: 1.25rem;
  border: 1px solid transparent; cursor: pointer;
  transition: all .2s ease; text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  color: #fff;
  background-image: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 8px 20px -6px rgb(99 102 241 / .5);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 24px -6px rgb(99 102 241 / .6); }
.btn-ghost { background: #fff; color: #334155; border-color: #e2e8f0; }
.btn-ghost:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-danger { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.btn-success:hover { background: #dcfce7; }
.btn-sm { padding: .375rem .875rem; font-size: .8125rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Card ---------- */
.card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 1.5rem;
  box-shadow: 0 1px 3px rgb(15 23 42 / .04);
}

/* ---------- Form ---------- */
.label { display: block; font-size: .8125rem; font-weight: 600; color: #475569; margin-bottom: .375rem; }
.input, select.input, textarea.input {
  width: 100%; padding: .625rem 1rem; border-radius: 1rem;
  border: 1px solid #e2e8f0; background: #f8fafc;
  font-size: .875rem; color: #0f172a; outline: none; transition: all .15s;
}
.input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgb(99 102 241 / .15); }
.input::placeholder { color: #94a3b8; }

/* ---------- Badge trạng thái ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .25rem .75rem; border-radius: 9999px;
  font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.badge-green  { background: #ecfdf5; color: #059669; }
.badge-yellow { background: #fffbeb; color: #d97706; }
.badge-red    { background: #fef2f2; color: #dc2626; }
.badge-gray   { background: #f1f5f9; color: #64748b; }
.badge-indigo { background: #eef2ff; color: #4f46e5; }

/* ---------- Navbar dạng viên thuốc (pill) nổi ---------- */
.pill-nav {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
  z-index: 50; width: min(100% - 2rem, 72rem);
  background: rgb(255 255 255 / .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgb(226 232 240 / .9);
  border-radius: 9999px;
  box-shadow: 0 12px 32px -12px rgb(15 23 42 / .18);
}
.nav-item {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: 9999px;
  font-size: .875rem; font-weight: 600; color: #475569;
  text-decoration: none; transition: all .18s;
}
.nav-item:hover { color: var(--brand-dark); background: #eef2ff; }
.nav-item.active {
  color: #fff;
  background-image: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 6px 14px -6px rgb(99 102 241 / .55);
}

/* ---------- Sidebar user ---------- */
.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .625rem 1rem; border-radius: 1rem;
  font-size: .875rem; font-weight: 500; color: #475569;
  text-decoration: none; transition: all .15s;
}
.sidebar-link:hover { background: #f1f5f9; color: #0f172a; }
.sidebar-link.active { background: #eef2ff; color: var(--brand-dark); font-weight: 600; }
.sidebar-link .bi { font-size: 1.05rem; }

/* ---------- Sidebar admin (nền tối) ---------- */
.admin-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .625rem 1rem; border-radius: 1rem;
  font-size: .875rem; font-weight: 500; color: #cbd5e1;
  text-decoration: none; transition: all .15s;
}
.admin-link:hover { background: rgb(255 255 255 / .08); color: #fff; }
.admin-link.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }

/* ---------- Bảng ---------- */
.table-modern { width: 100%; font-size: .875rem; border-collapse: separate; border-spacing: 0; }
.table-modern th {
  text-align: left; padding: .75rem 1rem; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; color: #64748b;
  background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.table-modern th:first-child { border-top-left-radius: 1rem; }
.table-modern th:last-child { border-top-right-radius: 1rem; }
.table-modern td { padding: .875rem 1rem; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; }
.table-modern tr:last-child td { border-bottom: none; }
.table-modern tbody tr:hover { background: #f8fafc; }

/* ---------- Tabs (dashboard CTV) ---------- */
.tab-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .625rem 1.25rem; border-radius: 9999px;
  font-size: .875rem; font-weight: 600; color: #64748b;
  background: #f1f5f9; border: none; cursor: pointer; transition: all .18s;
}
.tab-btn.active {
  color: #fff;
  background-image: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 6px 14px -6px rgb(99 102 241 / .55);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeUp .3s ease; }

/* ---------- Toast ---------- */
#toast-box { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 100; display: flex; flex-direction: column; gap: .5rem; max-width: 22rem; }
.toast {
  display: flex; align-items: flex-start; gap: .625rem;
  background: #0f172a; color: #f1f5f9;
  padding: .75rem 1rem; border-radius: 1rem; font-size: .8125rem;
  box-shadow: 0 16px 40px -12px rgb(15 23 42 / .5);
  animation: toastIn .3s cubic-bezier(.2,.9,.3,1.2);
}
.toast.success { background: #059669; color: #fff; }
.toast.error { background: #dc2626; color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Live feed ---------- */
#live-feed-list { max-height: 21rem; overflow-y: auto; }
.feed-item { animation: fadeUp .4s ease; }
.feed-toast {
  position: fixed; bottom: 1.25rem; left: 1.25rem; z-index: 90;
  display: flex; align-items: center; gap: .75rem;
  background: rgb(255 255 255 / .95); backdrop-filter: blur(8px);
  border: 1px solid #e2e8f0; border-radius: 9999px;
  padding: .625rem 1.25rem .625rem .75rem;
  box-shadow: 0 16px 40px -12px rgb(15 23 42 / .25);
  font-size: .8125rem; opacity: 0; transform: translateY(16px);
  transition: all .45s cubic-bezier(.2,.9,.3,1.2); pointer-events: none;
}
.feed-toast.show { opacity: 1; transform: none; }

/* ---------- Chat khiếu nại ---------- */
.chat-bubble {
  max-width: 78%; padding: .625rem 1rem; border-radius: 1.25rem;
  font-size: .875rem; line-height: 1.5; word-break: break-word;
  background: #f1f5f9; color: #0f172a; border-bottom-left-radius: .375rem;
}
.chat-bubble.mine {
  background-image: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff; border-bottom-left-radius: 1.25rem; border-bottom-right-radius: .375rem;
}

/* ---------- Hiệu ứng cuộn (landing) ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: all .7s cubic-bezier(.2,.65,.3,1); }
.reveal.revealed { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .12s; }
.reveal-delay-2 { transition-delay: .24s; }
.reveal-delay-3 { transition-delay: .36s; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Blob gradient động cho landing */
.blob {
  position: absolute; border-radius: 9999px; filter: blur(70px); opacity: .5; z-index: 0;
  animation: blobFloat 14s ease-in-out infinite alternate;
}
@keyframes blobFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, -30px) scale(1.15); }
}

.gradient-text {
  background-image: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 60%, #ec4899 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Placeholder thumbnail khi sản phẩm chưa có ảnh */
.thumb-placeholder {
  display: flex; align-items: center; justify-content: center;
  background-image: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 50%, #fdf4ff 100%);
  color: var(--brand); font-size: 2.25rem; font-weight: 800;
}
