/* ===================================================
   KNOWLEDGE TAB — knowledge.css
   =================================================== */

/* ---------- Panel wrapper ---------- */
.knowledge-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 48px);
  background: var(--bg-primary);
  padding: 0;
  overflow-y: auto;
}
.knowledge-panel.no-header {
  min-height: 100vh;
}

/* ---------- Hero Header ---------- */
.know-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  padding: 24px 48px 0;
  position: relative;
  overflow: hidden;
}
[data-theme="light"] .know-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #1e1b4b 100%);
}
.know-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.know-hero-inner {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.know-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139,92,246,0.2);
  border: 1px solid rgba(139,92,246,0.4);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #a78bfa;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.know-hero h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  line-height: 1.2;
}
.know-hero p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
  margin: 0 0 18px;
  max-width: 560px;
  line-height: 1.5;
}

/* ---------- Sub-tab Navigation ---------- */
.know-subnav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid rgba(255,255,255,0.1);
}
.know-subnav-btn {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.know-subnav-btn:hover { color: rgba(255,255,255,0.85); }
.know-subnav-btn.active {
  color: #a78bfa;
  border-bottom-color: #a78bfa;
}

/* ---------- Content Area ---------- */
.know-content {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 36px 48px 60px;
  box-sizing: border-box;
}

/* ---------- Sub-panel visibility ---------- */
.know-section { display: none; }
.know-section.active { display: block; }

/* ---------- Section heading ---------- */
.know-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.know-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ====================================================
   KÊNH CHIA CỘT (SPLIT LAYOUT) CHO PHÂN TÍCH CƠ BẢN
   ==================================================== */
.know-split-layout {
  display: flex;
  gap: 24px;
  margin-top: 15px;
  align-items: flex-start;
  min-height: 600px;
}

/* Sidebar bên trái */
.know-split-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 20px;
  box-sizing: border-box;
  position: sticky;
  top: 90px; /* Sticky theo vị trí menu tabs */
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header sidebar & Progress bar */
.know-sidebar-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.know-progress-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.know-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}
[data-theme="light"] .know-progress-bar-bg {
  background: rgba(0, 0, 0, 0.06);
}
.know-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #a78bfa 0%, #7c3aed 100%);
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}
.know-progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}
.know-progress-text span {
  font-weight: 700;
  color: #a78bfa;
}

/* Danh sách menu bài học */
.know-sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Thẻ menu từng bài học */
.know-sidebar-item {
  width: 100%;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
}
[data-theme="light"] .know-sidebar-item {
  background: #f8fafc;
}
.know-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateX(3px);
}
[data-theme="light"] .know-sidebar-item:hover {
  background: #f1f5f9;
  border-color: rgba(124, 58, 237, 0.3);
}

.know-sidebar-item.active {
  background: rgba(139, 92, 246, 0.08);
  border-color: var(--accent-light, #8b5cf6);
  box-shadow: inset 0 0 8px rgba(139, 92, 246, 0.1);
}
[data-theme="light"] .know-sidebar-item.active {
  background: rgba(124, 58, 237, 0.08);
  border-color: #7c3aed;
}

/* Vùng tích chọn Đã Học (Checkbox) */
.know-sidebar-chk-wrap {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
  cursor: pointer;
}
.know-sidebar-chk-wrap:hover {
  border-color: var(--accent-light, #8b5cf6);
}
.know-sidebar-chk-wrap.checked {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
  font-size: 0.7rem;
}
.know-sidebar-chk-wrap i {
  display: none;
}
.know-sidebar-chk-wrap.checked i {
  display: block;
}

/* Chi tiết thẻ menu */
.know-sidebar-info {
  flex: 1;
  min-width: 0;
}
.know-sidebar-item-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.know-sidebar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.know-sidebar-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.know-sidebar-tag-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.know-sidebar-tag-pill.theory  { background: rgba(59, 130, 246, 0.12);  color: #93c5fd; }
.know-sidebar-tag-pill.case    { background: rgba(245, 158, 11, 0.12);  color: #fbbf24; }
.know-sidebar-tag-pill.practice{ background: rgba(139, 92, 246, 0.12);  color: #c084fc; }

/* Cột phải hiển thị nội dung */
.know-split-content {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 30px;
  box-sizing: border-box;
  min-height: 600px;
  animation: fadeIn 0.25s ease-out;
}
.know-content-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 24px;
}
.know-content-tag-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.know-content-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.know-content-badge.blue   { background: rgba(59, 130, 246, 0.15);  color: #60a5fa; }
.know-content-badge.amber  { background: rgba(245, 158, 11, 0.15);  color: #fbbf24; }
.know-content-badge.purple { background: rgba(139, 92, 246, 0.15);  color: #a78bfa; }
.know-content-badge.red    { background: rgba(244, 63, 94, 0.15);   color: #fb7185; }
.know-content-badge.green  { background: rgba(16, 185, 129, 0.15);  color: #34d399; }

.know-content-btn-done {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.know-content-btn-done:hover {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}
.know-content-btn-done.completed {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.know-content-title-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.know-content-subtitle-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  font-weight: 450;
}

/* Responsive cho Split Layout trên màn hình nhỏ */
@media (max-width: 992px) {
  .know-split-layout {
    flex-direction: column;
    gap: 16px;
  }
  .know-split-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    padding: 16px;
  }
  .know-sidebar-menu {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 6px;
    gap: 10px;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
  }
  .know-sidebar-menu::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }
  .know-sidebar-item {
    flex: 0 0 250px;
    scroll-snap-align: start;
  }
  .know-split-content {
    width: 100%;
    padding: 20px;
    min-height: auto;
  }
}

/* ====================================================
   NHÓM 1 — NỀN TẢNG: Accordion
   ==================================================== */
.know-accordion { display: flex; flex-direction: column; gap: 10px; }

.know-acc-item {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.know-acc-item:hover { border-color: rgba(139,92,246,0.4); }

.know-acc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
}
.know-acc-icon-wrap {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.know-acc-icon-wrap.purple { background: rgba(139,92,246,0.15); color: #a78bfa; }
.know-acc-icon-wrap.blue   { background: rgba(59,130,246,0.15);  color: #60a5fa; }
.know-acc-icon-wrap.green  { background: rgba(16,185,129,0.12);  color: #34d399; }
.know-acc-icon-wrap.amber  { background: rgba(245,158,11,0.12);  color: #fbbf24; }
.know-acc-icon-wrap.rose   { background: rgba(244,63,94,0.12);   color: #fb7185; }

.know-acc-label {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 600;
}
.know-acc-sublabel {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}
.know-acc-chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}
.know-acc-item.open .know-acc-chevron { transform: rotate(180deg); }

.know-acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding: 0 20px;
}
.know-acc-item.open .know-acc-body {
  max-height: 1000px;
  padding: 0 20px 20px;
}

/* Glossary grid inside accordion */
/* Glossary grid inside accordion */
.know-glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
@media (max-width: 768px) {
  .know-glossary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.know-glossary-item {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.know-glossary-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Border styles for categories */
.know-glossary-item.border-amber  { border-left: 4px solid #f59e0b; }
.know-glossary-item.border-red    { border-left: 4px solid #ef4444; }
.know-glossary-item.border-purple { border-left: 4px solid #8b5cf6; }
.know-glossary-item.border-blue   { border-left: 4px solid #3b82f6; }
.know-glossary-item.border-gray   { border-left: 4px solid #6b7280; }

.know-glossary-term {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

.know-glossary-def {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: 450;
}

/* Category item badges */
.know-item-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.know-item-badge.amber  { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.know-item-badge.red    { background: rgba(239, 68, 68, 0.12);   color: #fb7185; border: 1px solid rgba(239, 68, 68, 0.2); }
.know-item-badge.purple { background: rgba(139, 92, 246, 0.12);  color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.2); }
.know-item-badge.blue   { background: rgba(59, 130, 246, 0.12);  color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }
.know-item-badge.gray   { background: rgba(107, 114, 128, 0.12); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.2); }

/* Light Theme overrides for category badges */
[data-theme="light"] .know-item-badge.gray   { background: #e2e8f0; color: #475569; border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .know-item-badge.amber  { background: #fffbeb; color: #b45309; border-color: rgba(245,158,11,0.25); }
[data-theme="light"] .know-item-badge.red    { background: #fef2f2; color: #b91c1c; border-color: rgba(239,68,68,0.25); }
[data-theme="light"] .know-item-badge.purple { background: #f5f3ff; color: #6d28d9; border-color: rgba(139,92,246,0.25); }
[data-theme="light"] .know-item-badge.blue   { background: #eff6ff; color: #1d4ed8; border-color: rgba(59,130,246,0.25); }


/* Order type table */
.know-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.know-table th {
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.know-table td {
  padding: 10px 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
.know-table tr:last-child td { border-bottom: none; }
.know-table td:first-child { font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.know-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}
.know-badge.buy  { background: rgba(16,185,129,0.15); color: #34d399; }
.know-badge.sell { background: rgba(244,63,94,0.15);  color: #fb7185; }
.know-badge.both { background: rgba(139,92,246,0.15); color: #a78bfa; }

/* Board reading list */
.know-board-list { display: flex; flex-direction: column; gap: 8px; }
.know-board-row {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 12px 14px;
}
.know-board-color {
  width: 14px; height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}
.know-board-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }
.know-board-desc strong { color: var(--text-primary); }

/* ====================================================
   NHÓM 2 — KỸ THUẬT: Card Grid
   ==================================================== */
.know-tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.know-tech-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}
.know-tech-card:hover { box-shadow: 0 16px 40px rgba(0,0,0,0.25); border-color: rgba(139,92,246,0.45); }

.know-tech-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.know-tech-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.know-tech-card-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}
.know-tech-card-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 3px;
}
.know-tech-card-tag.bull { background: rgba(16,185,129,0.15); color: #34d399; }
.know-tech-card-tag.bear { background: rgba(244,63,94,0.15);  color: #fb7185; }
.know-tech-card-tag.neutral { background: rgba(139,92,246,0.15); color: #a78bfa; }

.know-tech-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.know-tech-signal {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.know-tech-signal strong { color: var(--text-primary); }

/* Candle visual mockup */
.know-candle-wrap {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 40px;
  margin-bottom: 10px;
}
.know-candle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.know-candle-wick {
  width: 1.5px;
  background: currentColor;
  opacity: 0.5;
}
.know-candle-body {
  width: 10px;
  border-radius: 2px;
  min-height: 4px;
}

/* ====================================================
   NHÓM 3 — NHẬN ĐỊNH: Blog Cards
   ==================================================== */
.know-insights-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.know-insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.know-insight-card:hover { border-color: rgba(139,92,246,0.4); box-shadow: 0 8px 32px rgba(0,0,0,0.18); }

.know-insight-inner {
  padding: 16px 20px;
}
.know-insight-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.know-insight-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.know-insight-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.know-insight-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid;
}
.know-insight-tag.market  { border-color: rgba(59,130,246,0.4);  color: #60a5fa;  background: rgba(59,130,246,0.08); }
.know-insight-tag.stock   { border-color: rgba(16,185,129,0.4);  color: #34d399;  background: rgba(16,185,129,0.08); }
.know-insight-tag.strategy{ border-color: rgba(139,92,246,0.4);  color: #a78bfa;  background: rgba(139,92,246,0.08); }
.know-insight-tag.macro   { border-color: rgba(245,158,11,0.4);  color: #fbbf24;  background: rgba(245,158,11,0.08); }
.know-insight-tag.risk    { border-color: rgba(244,63,94,0.4);   color: #fb7185;  background: rgba(244,63,94,0.08);  }
 
.know-insight-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
}
.know-insight-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* Expandable full content */
.know-insight-full {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s ease;
}
.know-insight-card.expanded .know-insight-full {
  max-height: 2000px;
}
.know-insight-body {
  padding: 0 28px 24px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.know-insight-body p {
  margin: 0 0 16px;
}
.know-insight-body p:last-child {
  margin-bottom: 0;
}
.know-insight-body h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 20px 0 8px;
}
.know-insight-body h4:first-child { margin-top: 0; }
.know-insight-body ul {
  padding-left: 18px;
  margin: 6px 0;
}
.know-insight-body li { margin-bottom: 4px; }
.know-insight-body strong { color: var(--text-primary); }

.know-insight-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Align author to the right */
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  margin-top: auto; /* Push the footer to the bottom of the card */
}
.know-read-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.know-read-btn:hover { background: rgba(139,92,246,0.1); border-color: #a78bfa; color: #a78bfa; }
.know-read-btn i { transition: transform 0.3s ease; font-size: 0.7rem; }
.know-insight-card.expanded .know-read-btn i { transform: rotate(180deg); }

.know-read-btn-text::after { content: 'Đọc thêm'; }
.know-insight-card.expanded .know-read-btn-text::after { content: 'Thu gọn'; }

.know-insight-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.know-author-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* Empty state placeholder */
.know-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.know-empty-state i {
  font-size: 3rem;
  opacity: 0.3;
  margin-bottom: 16px;
  display: block;
}
.know-empty-state p { font-size: 0.9rem; margin: 0; }

/* Segmented Control Tabs for Technical Analysis */
.know-tech-tabs {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.08));
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 24px;
}
[data-theme="light"] .know-tech-tabs {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.06);
}
.know-tech-tab-btn {
  padding: 8px 18px;
  border-radius: 9px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.know-tech-tab-btn:hover {
  color: var(--text-primary);
}
.know-tech-tab-btn.active {
  background: var(--bg-card);
  color: var(--accent-light, #8b5cf6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.08));
}
[data-theme="light"] .know-tech-tab-btn.active {
  background: #ffffff;
  color: #7c3aed;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Visibility toggling for TA sub-sections */
.know-tech-sub-section {
  display: none;
  animation: fadeIn 0.25s ease-out;
}
.know-tech-sub-section.active {
  display: block;
}

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 768px) {
  .know-hero { padding: 32px 20px 0; }
  .know-hero h1 { font-size: 1.5rem; }
  .know-content { padding: 24px 20px 48px; }
  .know-tech-grid { grid-template-columns: 1fr; }
  .know-glossary-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .know-subnav-btn { padding: 10px 16px; font-size: 0.82rem; }
  .know-insight-inner { padding: 18px 18px 14px; }
  .know-insight-footer { padding: 12px 18px; }
  .know-insight-body { padding: 16px 18px 18px; }
}

/* ---------- Publish Article CMS ---------- */
.know-section-title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 15px;
}
.know-section-title-wrap .know-section-title {
  margin: 0;
  flex: 1;
}
.know-publish-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
  color: #fff !important;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
  white-space: nowrap;
}
.know-publish-trigger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
  filter: brightness(1.1);
}
.know-publish-trigger-btn:active {
  transform: translateY(0);
}

/* Modal Window */
.know-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: all 0.3s ease;
}
.know-modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.know-modal {
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
  animation: knowModalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes knowModalSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.know-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.05));
}
.know-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #fff);
  display: flex;
  align-items: center;
  gap: 8px;
}
.know-modal-header h3 i {
  color: #a78bfa;
}
.know-modal-close {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}
.know-modal-close:hover {
  color: var(--text-primary, #fff);
}

/* Form Styles */
.know-modal-body {
  padding: 24px;
}
.know-form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.know-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.know-form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.know-form-group label .required {
  color: #f43f5e;
}
.know-form-group input[type="text"],
.know-form-group input[type="password"],
.know-form-group textarea {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary, #fff);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s;
}
.know-form-group input:focus,
.know-form-group textarea:focus {
  outline: none;
  border-color: #a78bfa;
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2);
  background: rgba(0, 0, 0, 0.3);
}

/* Custom Tag Checkboxes */
.know-tag-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.tag-chk-label {
  cursor: pointer;
  position: relative;
}
.tag-chk-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.tag-chk-custom {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #94a3b8);
  transition: all 0.2s;
}
.tag-chk-label input[type="checkbox"]:checked + .tag-chk-custom.market {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}
.tag-chk-label input[type="checkbox"]:checked + .tag-chk-custom.macro {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.tag-chk-label input[type="checkbox"]:checked + .tag-chk-custom.stock {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.tag-chk-label input[type="checkbox"]:checked + .tag-chk-custom.strategy {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: #a78bfa;
}
.tag-chk-label input[type="checkbox"]:checked + .tag-chk-custom.risk {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fb7185;
}
.tag-chk-custom:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Modal Footer */
.know-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.05));
}
.know-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #fff);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.know-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}
.know-btn-primary {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
  border: none;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}
.know-btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}
.know-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Light Theme overrides for modal */
[data-theme="light"] .know-modal {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .know-form-group input[type="text"],
[data-theme="light"] .know-form-group input[type="password"],
[data-theme="light"] .know-form-group textarea {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f172a;
}
[data-theme="light"] .know-form-group input:focus,
[data-theme="light"] .know-form-group textarea:focus {
  background: #ffffff;
  border-color: #7c3aed;
}
[data-theme="light"] .tag-chk-custom {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.06);
  color: #475569;
}
[data-theme="light"] .know-btn-secondary {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.08);
  color: #0f172a;
}
[data-theme="light"] .know-btn-secondary:hover {
  background: #e2e8f0;
}

/* ============================================================
   Grid & Older Insights Layout Styles
   ============================================================ */
.know-insights-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1200px) {
  .know-insights-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .know-insights-grid-4 {
    grid-template-columns: 1fr;
  }
}


.know-insight-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
}

.know-insight-card.expanded {
  grid-column: 1 / -1; /* Spans full width of grid on expand */
}

/* Older Insights Section */
.know-older-insights-section {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding-top: 30px;
}

.know-older-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.know-older-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.know-older-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.know-older-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.know-older-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 20px;
  user-select: none;
}

.know-older-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.know-older-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.know-older-title-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.know-older-action {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

.know-older-chevron {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.know-older-card.expanded .know-older-chevron {
  transform: rotate(180deg);
}

.know-older-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s ease;
}

.know-older-card.expanded .know-older-body {
  max-height: 2000px;
  border-top: 1px solid var(--border-strong);
  padding: 24px 28px;
}

/* ---------- Mobile Responsive Upgrades ---------- */
@media (max-width: 768px) {
  .know-hero {
    padding: 20px 16px 0;
  }
  .know-hero h1 {
    font-size: 1.4rem;
  }
  .know-hero p {
    font-size: 0.82rem;
    margin-bottom: 14px;
  }
  
  .know-subnav {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .know-subnav::-webkit-scrollbar {
    display: none;
  }
  .know-subnav-btn {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 0.8rem;
  }

  .know-content {
    padding: 20px 12px 40px;
  }
  
  .know-split-content {
    padding: 16px;
  }
  .know-content-header {
    padding-bottom: 14px;
    margin-bottom: 16px;
  }
  .know-content-title-text {
    font-size: 1.2rem;
  }
  .know-content-subtitle-text {
    font-size: 0.8rem;
  }
  .know-insight-body {
    padding: 0 16px 20px;
    padding-top: 14px;
  }
  
  /* Glossary grid mobile adjustments */
  .know-glossary-item {
    padding: 12px 16px;
  }
  .know-glossary-term {
    font-size: 0.85rem;
  }
  .know-glossary-def {
    font-size: 0.78rem;
  }

  /* Older insights header stacking */
  .know-older-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }
  .know-older-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
  }
  .know-older-action {
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 4px;
  }
  .know-older-card.expanded .know-older-body {
    padding: 16px;
  }
}

