/* Giao diện trang Tra cứu CVE & Sản phẩm (đồng bộ thiết kế ViSafe) */

.sec-topic-lookup-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  margin-bottom: 24px;
  overflow: hidden;
}

.sec-topic-head {
  padding: 22px 24px 18px;
}

.sec-topic-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.sec-topic-head-main {
  flex: 1 1 auto;
  min-width: 0;
}

.sec-topic-eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.sec-topic-cve-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--brand-primary);
  color: #ffffff;
  font: 700 12.5px/1.35 var(--font-heading);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.sec-topic-back-link {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  font: 600 12.5px/1.35 var(--font-heading);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sec-topic-back-link:hover,
.sec-topic-back-link:focus-visible {
  background: var(--brand-primary);
  color: #ffffff;
  text-decoration: none;
}

.sec-topic-stats {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-shrink: 0;
}

.sec-topic-stat {
  min-width: 96px;
  padding: 9px 14px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.sec-topic-stat strong {
  display: block;
  font: 800 20px/1.15 var(--font-heading);
  color: var(--brand-primary);
  font-variant-numeric: tabular-nums;
}

.sec-topic-stat span {
  display: block;
  margin-top: 3px;
  font: 500 12px/1.25 var(--font-body);
  color: #64748b;
}

.topic-scope {
  margin-top: 14px;
  padding: 9px 13px;
  background: #f8fafc;
  border-left: 3px solid var(--brand-primary);
  border-radius: 0 6px 6px 0;
  font: 400 13.5px/1.55 var(--font-body);
  color: #475569;
}

/* --- Filter Bar --- */
.topic-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 16px 24px 18px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.topic-filters.is-cve-detail {
  grid-template-columns: minmax(0, 1fr) auto;
}

.topic-filter-field {
  min-width: 0;
}

.topic-filters label {
  display: block;
  margin-bottom: 6px;
  font: 700 13.5px/1.3 var(--font-heading);
  color: #1e293b;
}

.topic-input-wrap {
  position: relative;
}

.topic-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 15px;
  pointer-events: none;
}

.topic-filters input,
.topic-filters select {
  width: 100%;
  height: 42px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  padding: 0 12px;
  font: 500 14.5px/1.4 var(--font-body);
  color: #0f172a;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.topic-input-wrap input {
  padding-left: 36px;
  font-variant-numeric: tabular-nums;
}

.topic-filters input:hover,
.topic-filters select:hover {
  border-color: #94a3b8;
}

.topic-filters input:focus,
.topic-filters select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(20, 85, 147, 0.12);
}

.topic-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec-topic-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-primary);
  color: #ffffff;
  font: 700 14px/1 var(--font-heading);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.sec-topic-submit:hover,
.sec-topic-submit:focus-visible {
  background: var(--brand-accent-deep);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(217, 56, 26, 0.22);
}

.topic-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font: 600 13.5px/1 var(--font-heading);
  white-space: nowrap;
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.topic-reset:hover,
.topic-reset:focus-visible {
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #0f172a;
  text-decoration: none;
}

/* --- Results Toolbar & Active Filters --- */
.sec-topic-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-primary);
}

.topic-results {
  padding-left: 10px;
  border-left: 3px solid var(--brand-accent);
  font: 700 15.5px/1.35 var(--font-heading);
  color: var(--brand-primary);
}

.sec-topic-page-note {
  font: 500 13px/1.3 var(--font-body);
  color: #64748b;
}

.sec-topic-active-filters {
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.sec-topic-active-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13.5px;
}

.sec-topic-active-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  color: #0f172a;
  font: 500 13px/1.35 var(--font-body);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.sec-topic-active-pill:hover,
.sec-topic-active-pill:focus-visible {
  border-color: var(--brand-accent);
  color: var(--brand-accent-deep);
  text-decoration: none;
}

/* --- Article Cards --- */
.sec-topic-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topic-article {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.topic-article:hover {
  border-color: #bfd6f2;
  box-shadow: 0 4px 14px rgba(20, 85, 147, 0.07);
}

.topic-article-main {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.topic-image {
  flex: 0 0 168px;
  width: 168px;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f6fb;
  border: 1px solid #eef2f6;
}

.topic-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.topic-article:hover .topic-image img {
  transform: scale(1.02);
}

.topic-article-body {
  flex: 1 1 auto;
  min-width: 0;
}

.topic-article-title {
  margin: 0 0 6px;
  font: 700 17.5px/1.4 var(--font-heading);
  color: #0f172a;
  letter-spacing: -0.01em;
}

.topic-article-title a {
  color: #0f172a;
}

.topic-article-title a:hover,
.topic-article-title a:focus-visible {
  color: var(--brand-primary);
  text-decoration: none;
}

.topic-excerpt {
  font: 400 14.5px/1.6 var(--font-body);
  color: #475569;
}

/* --- CVE & Product Chips (Dùng chung cho trang /cve/ và bài viết single.html) --- */
.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow-wrap: anywhere;
}

.article-topic-links {
  margin: 16px 0;
}

.topic-article .article-topic-links {
  margin: 10px 0 0;
  padding-left: 186px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 9px;
  border: 1px solid #d4e3f0;
  border-radius: 6px;
  background: #f3f8fc;
  color: var(--brand-primary);
  font: 600 12px/1.5 var(--font-heading);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.topic-chip:hover,
.topic-chip:focus-visible {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
  text-decoration: none;
}

.topic-chip.is-active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

.topic-chip-product {
  background: #effaf5;
  border-color: #bfe4d4;
  color: #146346;
}

.topic-chip-product:hover,
.topic-chip-product:focus-visible,
.topic-chip-product.is-active {
  background: #146346;
  border-color: #146346;
  color: #ffffff;
}

.topic-chip-more {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.topic-chip-more:hover,
.topic-chip-more:focus-visible {
  background: #334155;
  border-color: #334155;
  color: #ffffff;
}

.topic-empty {
  min-height: 200px;
}

/* --- Sidebar --- */
.topic-sidebar-card .sec-panel-header {
  gap: 10px;
}

.topic-sidebar-products {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.topic-sidebar-empty {
  font: 400 14px/1.55 var(--font-body);
  color: #64748b;
}

@media (min-width: 992px) {
  .topic-sidebar-sticky {
    position: sticky;
    top: 68px;
  }
}

@media (max-width: 991px) {
  .sec-topic-head-top {
    flex-direction: column;
    gap: 14px;
  }

  .topic-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .sec-topic-head {
    padding: 18px 16px 14px;
  }

  .sec-topic-stats {
    width: 100%;
  }

  .sec-topic-stat {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 10px;
  }

  .sec-topic-stat strong {
    font-size: 18px;
  }

  .topic-filters,
  .topic-filters.is-cve-detail {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 16px 16px;
    gap: 12px;
  }

  .topic-filter-actions {
    width: 100%;
  }

  .sec-topic-submit {
    flex: 1 1 auto;
  }

  .topic-article {
    padding: 14px;
  }

  .topic-article-main {
    gap: 12px;
  }

  .topic-image {
    flex: 0 0 104px;
    width: 104px;
  }

  .topic-article-title {
    font-size: 15.5px;
    margin-bottom: 4px;
  }

  .topic-article .article-topic-links {
    margin-top: 12px;
    padding-top: 10px;
    padding-left: 0;
    border-top: 1px solid #f1f5f9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topic-article,
  .topic-image img,
  .topic-chip,
  .sec-topic-submit,
  .topic-reset,
  .sec-topic-back-link,
  .sec-topic-active-pill {
    transition: none;
  }
}
