/* ====================================================================
   THƯ VIỆN HỌC VIỆN ÂM NHẠC QUỐC GIA VIỆT NAM (VNAM)
   GIAO DIỆN TỐI GIẢN - TRÀN VIỀN - SIÊU GỌN GÀNG (FLUID & ULTRA-CLEAN)
   ==================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #00569e;
  --primary-hover: #00447c;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text-title: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ================= CONTAINER TRÀN VIỀN (KHÔNG KHOẢNG TRỐNG THỪA) ================= */
.container-fluid {
  width: 100%;
  padding: 0 28px;
  margin: 0 auto;
}

/* ================= HEADER ================= */
/* ================= HEADER 10 ĐIỂM CHUẨN HỌC VIỆN ================= */
.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.25s ease;
}

.header-accent-bar {
  height: 3px;
  background: linear-gradient(90deg, #005fa8 0%, #0284c7 35%, #f59e0b 70%, #005fa8 100%);
  width: 100%;
}

.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.05);
}

.brand-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-title);
  letter-spacing: -0.2px;
  text-transform: uppercase;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-info-badge {
  height: 34px;
  padding: 0 12px;
  border-radius: 17px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 0.76rem;
  font-weight: 600;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: default;
}

.header-info-badge.badge-hotline {
  color: #0369a1;
  background: #f0f9ff;
  border-color: #bae6fd;
  cursor: pointer;
}

.header-info-badge.badge-hotline:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.25);
}

.header-info-badge.badge-about {
  color: #0f766e;
  background: #f0fdfa;
  border-color: #99f6e4;
  cursor: pointer;
}

.header-info-badge.badge-about:hover {
  background: #0f766e;
  color: #ffffff;
  border-color: #0f766e;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15, 118, 110, 0.25);
}

.header-info-badge.badge-guide {
  color: #7c3aed;
  background: #f5f3ff;
  border-color: #ddd6fe;
  cursor: pointer;
}

.header-info-badge.badge-guide:hover {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(124, 58, 237, 0.25);
}

.status-dot-sm {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  animation: pulseDot 2s infinite;
}

/* GUIDE MODAL TABLE */
.guide-modal-card {
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.guide-modal-body {
  padding: 18px 24px 22px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

.guide-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 10px 0;
}

.guide-section-title:first-child {
  margin-top: 0;
}

/* Sơ đồ 3 bước mượn sách trực quan */
.guide-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.guide-step-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 10px;
  position: relative;
  text-align: center;
  transition: all 0.2s ease;
}

.guide-step-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}

.guide-step-card .step-num {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #0284c7;
  background: #e0f2fe;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bae6fd;
}

.guide-step-card .step-icon {
  font-size: 1.3rem;
  color: var(--primary);
  margin-top: 4px;
  margin-bottom: 6px;
}

.guide-step-card strong {
  display: block;
  font-size: 0.78rem;
  color: var(--text-title);
  margin-bottom: 3px;
  line-height: 1.3;
}

.guide-step-card p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.35;
}

/* Bảng tra cứu mã tương tác 1-Click */
.guide-table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 8px 0 16px 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.guide-table th {
  background: #f1f5f9;
  padding: 9px 12px;
  text-align: left;
  font-weight: 700;
  color: var(--text-title);
  border-bottom: 1px solid var(--border);
}

.guide-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
  vertical-align: middle;
}

.guide-table tr:hover td {
  background: #f8fafc;
}

.guide-table tr:last-child td {
  border-bottom: none;
}

.guide-table code {
  background: #eff6ff;
  color: #0284c7;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.78rem;
  border: 1px solid #bae6fd;
}

.btn-guide-try {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-guide-try:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  transform: translateX(2px);
}

/* Thẻ chip từ khóa gợi ý */
.guide-tips-wrap {
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.guide-tips-wrap p {
  margin: 0 0 8px 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.guide-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.guide-chip {
  background: #ffffff;
  border: 1px solid #d6d3d1;
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #44403c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.guide-chip:hover {
  background: #f0f9ff;
  border-color: #38bdf8;
  color: #0284c7;
  transform: translateY(-1px);
}

/* Khung chính sách & hỗ trợ */
.guide-policy-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-policy-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.78rem;
  color: #166534;
  line-height: 1.45;
}

.guide-policy-row i {
  color: #16a34a;
  font-size: 0.95rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.guide-policy-link {
  color: #0284c7;
  font-weight: 700;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .guide-steps-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ================= POPUP GIỚI THIỆU THƯ VIỆN VNAM ================= */
.about-modal-card {
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.about-modal-body {
  padding: 18px 24px 22px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

.about-hero-box {
  background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.about-badge-year {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #0284c7;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.about-hero-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 6px 0;
  line-height: 1.35;
}

.about-hero-desc {
  font-size: 0.82rem;
  color: #334155;
  margin: 0;
  line-height: 1.6;
}

.about-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.about-stat-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
}

.about-stat-item .stat-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.about-stat-item .stat-txt {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.25;
}

.about-collections-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.collection-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s ease;
}

.collection-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}

.collection-icon {
  font-size: 1.25rem;
  color: var(--primary);
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.collection-info strong {
  display: block;
  font-size: 0.82rem;
  color: var(--text-title);
  margin-bottom: 3px;
}

.collection-info p {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.about-spaces-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.space-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.space-icon {
  font-size: 1.3rem;
  color: #0f766e;
  margin-bottom: 6px;
}

.space-card strong {
  font-size: 0.8rem;
  color: var(--text-title);
  display: block;
  margin-bottom: 3px;
}

.space-card span {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.about-contact-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.about-contact-card .contact-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.about-contact-card .contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
}

.contact-sub-item {
  font-size: 0.78rem;
  color: var(--text-body);
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-sub-item i {
  color: var(--primary);
  width: 14px;
  text-align: center;
  font-size: 0.85rem;
}

@media (max-width: 680px) {
  .about-collections-grid {
    grid-template-columns: 1fr;
  }
  .about-spaces-grid {
    grid-template-columns: 1fr;
  }
  .about-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-contact-card .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .header-info-badge.badge-hours {
    display: none;
  }
}

@media (max-width: 600px) {
  .header-badges {
    gap: 6px;
  }
  .header-info-badge.badge-hotline {
    display: none;
  }
}

@media (max-width: 480px) {
  .header-inner {
    height: 58px;
  }
  .brand {
    gap: 8px;
  }
  .brand-logo {
    height: 36px;
  }
  .brand-title {
    font-size: 0.78rem;
    line-height: 1.15;
  }
  .brand-sub {
    font-size: 0.62rem;
  }
}

/* ================= SEARCH DUY NHẤT (GỌN GÀNG, TRÀN RỘNG) ================= */
.search-wrapper {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 14px 0 16px;
}

/* ================= DẢI CHỈ SỐ KPI & LỐI TẮT NHANH TRƯỚC BỘ LỌC ================= */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 992px) {
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .kpi-strip {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: default;
  position: relative;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f0f7ff;
  border: 1px solid #dbeafe;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.kpi-card:hover .kpi-icon {
  transform: scale(1.05);
}

.kpi-card:nth-child(1) .kpi-icon,
.kpi-icon.kpi-icon-music {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}

.kpi-card:nth-child(2) .kpi-icon,
.kpi-icon.kpi-icon-theses {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}

.kpi-card:nth-child(3) .kpi-icon,
.kpi-icon.kpi-icon-langs {
  background: #fffbeb;
  border-color: #fde68a;
  color: #d97706;
}

.kpi-card:nth-child(4) .kpi-icon,
.kpi-icon.kpi-icon-covers {
  background: #fdf2f8;
  border-color: #fbcfe8;
  color: #db2777;
}

.kpi-info {
  flex: 1;
  min-width: 0;
}

.kpi-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-title);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.kpi-badge {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-card:nth-child(1) .kpi-badge,
.kpi-badge.kpi-badge-blue {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.kpi-card:nth-child(2) .kpi-badge,
.kpi-badge.kpi-badge-green {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.kpi-card:nth-child(3) .kpi-badge,
.kpi-badge.kpi-badge-amber {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.kpi-card:nth-child(4) .kpi-badge,
.kpi-badge.kpi-badge-pink {
  color: #be185d;
  background: #fdf2f8;
  border-color: #fbcfe8;
}

.search-box-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  align-items: center;
}

.search-input-field {
  flex: 1 1 240px;
  min-width: 220px;
  position: relative;
}

.search-select-wrapper {
  position: relative;
  flex: 0 0 auto;
  min-width: 165px;
}

.search-select-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.9rem;
  pointer-events: none;
}

.search-select-wrapper i.fa-layer-group {
  color: #8b5cf6;
}

.search-select-wrapper i.fa-globe {
  color: #0284c7;
}

.search-select-field {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-body);
  background: #f8fafc;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-select-field:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 86, 158, 0.1);
}

.btn-filter-toggle {
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f8fafc;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-filter-toggle i {
  color: #db2777;
}

.btn-filter-toggle.active {
  background: #fdf2f8;
  border-color: #fbcfe8;
  color: #be185d;
}

.btn-filter-toggle.active i {
  color: #db2777;
}

.search-input-field {
  flex: 1;
  position: relative;
}

.search-input-field i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #3b82f6;
  font-size: 1rem;
}

.search-input-field input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--text-title);
  background: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
}

.search-input-field input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 86, 158, 0.1);
}

.btn-primary {
  height: 44px;
  padding: 0 24px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-filter-reset {
  height: 44px;
  padding: 0 16px;
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-filter-reset i {
  color: #64748b;
  transition: transform 0.3s ease, color 0.2s ease;
}

.btn-filter-reset:hover {
  background: #fff1f2;
  color: #e11d48;
  border-color: #fecdd3;
}

.btn-filter-reset:hover i {
  color: #e11d48;
  transform: rotate(-180deg);
}

/* ================= MAIN CONTENT ================= */
.catalog-content {
  padding: 16px 0 16px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.results-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.results-count strong {
  color: var(--text-title);
  font-weight: 700;
}

.view-toggles {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ffffff;
}

.toggle-btn {
  height: 30px;
  width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.toggle-btn.active {
  background: #f1f5f9;
  color: var(--primary);
}

/* ================= LƯỚI CARD TÀI LIỆU RESPONSIVE DÙNG CSS GRID ================= */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
}

.book-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 0;
  box-sizing: border-box;
  perspective: 800px;
}

.book-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.12), 0 4px 8px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-3px);
}

.book-thumb {
  width: 92px;
  height: 124px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  position: relative;
  display: block;
  padding: 0;
  box-sizing: border-box;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), inset -2px 0 4px rgba(0, 0, 0, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.book-card:hover .book-thumb {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18), inset -2px 0 5px rgba(0, 0, 0, 0.08);
}

/* Hiệu ứng gáy sách nổi bên trái che mép chụp gáy */
.book-thumb::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.28) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(0, 0, 0, 0.1) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Mép trang giấy thật bên cạnh phải cuốn sách */
.book-paper-edge {
  position: absolute;
  top: 2px;
  right: 0;
  bottom: 2px;
  width: 4px;
  background: repeating-linear-gradient(
    to bottom,
    #ffffff,
    #ffffff 1px,
    #cbd5e1 1px,
    #cbd5e1 2px
  );
  z-index: 3;
  border-radius: 0 2px 2px 0;
  box-shadow: -1px 0 2px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.book-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transform: scale(1.15) translateZ(0); /* Đề xuất 1: Cắt sạch 7.5% viền thừa mép bàn mọi phía mà giữ ảnh bìa đứng thẳng 100% */
  opacity: 0;
  transition: opacity 0.22s ease-in-out, transform 0.22s ease-out;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.book-thumb:hover img,
.book-card:hover .book-thumb img {
  transform: scale(1.18) translateZ(0);
}

.book-thumb img.loaded {
  opacity: 1;
}

/* Skeleton Loading Shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-shimmer {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-card {
  pointer-events: none;
}

.skeleton-thumb {
  width: 88px;
  height: 122px;
  flex-shrink: 0;
  border-radius: 4px;
}

.skeleton-line {
  height: 12px;
  margin-bottom: 8px;
}

.book-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.book-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  min-width: 0;
}

.book-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: #f0f7ff;
  padding: 1px 6px;
  border-radius: 3px;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-year {
  font-size: 0.72rem;
  color: var(--text-light);
  font-weight: 500;
  flex-shrink: 0;
}

.book-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-title);
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.book-card:hover .book-title {
  color: var(--primary);
}

.book-author {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.book-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.72rem;
  min-width: 0;
}

.major-tag {
  color: var(--text-muted);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}

.pub-tag {
  color: var(--text-light);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 130px;
  flex-shrink: 1;
  text-align: right;
}

/* LIST VIEW */
.books-grid.list-view {
  grid-template-columns: 1fr;
  gap: 8px;
}

.books-grid.list-view .book-card {
  padding: 10px 16px;
  align-items: center;
}

.books-grid.list-view .book-thumb {
  width: 44px;
  height: 60px;
}

/* ================= MODAL ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 760px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  animation: modalIn 0.15s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-title);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-body {
  padding: 24px;
}

.modal-top-grid {
  display: flex;
  gap: 22px;
  margin-bottom: 22px;
}

.modal-cover {
  width: 165px;
  height: 228px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #94a3b8;
  flex-shrink: 0;
  display: block;
  padding: 0;
  position: relative;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.22), inset -3px 0 6px rgba(0, 0, 0, 0.1);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hiệu ứng gáy sách 3D sang trọng trong popup */
.modal-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.3) 0%, rgba(255, 255, 255, 0.25) 50%, rgba(0, 0, 0, 0.1) 100%);
  z-index: 3;
  pointer-events: none;
}

.modal-cover:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
}

.modal-cover::after {
  content: '🔍 Bấm phóng to';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 4;
}

.modal-cover:hover::after {
  opacity: 1;
}

.modal-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transform: scale(1.08) translateZ(0);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transition: transform 0.2s ease;
}

.modal-cover:hover img {
  transform: scale(1.12) translateZ(0);
}

/* ================= LIGHTBOX PHÓNG TO ẢNH HD ================= */
.image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.image-lightbox.active {
  display: flex;
}

.image-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  object-fit: contain;
  background: #ffffff;
  padding: 6px;
}

.modal-info-main {
  flex: 1;
  min-width: 0;
}

.modal-book-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-title);
  line-height: 1.35;
  margin-bottom: 6px;
}

.modal-author {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 10px;
}

.modal-code-badge {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 4px;
  color: var(--text-title);
}

.modal-props-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  font-size: 0.8rem;
  background: #f8fafc;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.modal-prop-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
}

.modal-prop-label {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.prop-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.modal-prop-item:hover .prop-icon {
  transform: scale(1.15);
}

.prop-icon.icon-music {
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

.prop-icon.icon-type {
  color: #7c3aed;
  background: #f5f3ff;
  border: 1px solid #ede9fe;
}

.prop-icon.icon-genre {
  color: #db2777;
  background: #fdf2f8;
  border: 1px solid #fce7f3;
}

.prop-icon.icon-publisher {
  color: #0d9488;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
}

.prop-icon.icon-year {
  color: #d97706;
  background: #fffbeb;
  border: 1px solid #fef3c7;
}

.prop-icon.icon-place {
  color: #ea580c;
  background: #fff7ed;
  border: 1px solid #ffedd5;
}

.prop-icon.icon-stock {
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #d1fae5;
}

.prop-icon.icon-pages {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.prop-icon.icon-lang {
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #e0f2fe;
}

.prop-icon.icon-compiler {
  color: #9333ea;
  background: #faf5ff;
  border: 1px solid #f3e8ff;
}

.prop-icon.icon-advisor {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

.prop-icon.icon-edition {
  color: #16a34a;
  background: #f0fdf4;
  border: 1px solid #dcfce7;
}

.modal-prop-val {
  font-weight: 600;
  color: var(--text-title);
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.modal-notice {
  margin-top: 16px;
  padding: 10px 14px;
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: #854d0e;
  line-height: 1.45;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.btn-secondary {
  height: 36px;
  padding: 0 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

/* ================= FOOTER ================= */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  position: relative;
  box-sizing: border-box;
}

.footer-accent-bar {
  height: 4px;
  background: linear-gradient(90deg, #005fa8 0%, #0284c7 35%, #f59e0b 70%, #005fa8 100%);
  width: 100%;
}

.footer-container {
  padding-top: 36px;
  padding-bottom: 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.1fr;
  gap: 36px;
  align-items: start;
}

.footer-col {
  font-size: 0.82rem;
  color: var(--text-body);
  line-height: 1.6;
}

.footer-brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.footer-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.footer-brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
  margin: 0;
}

.footer-brand-sub {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 14px;
  line-height: 1.55;
}

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

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #334155;
}

.footer-heading {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f1f5f9;
}

.footer-heading i {
  color: var(--primary);
  font-size: 0.9rem;
}

.footer-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-info-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8rem;
}

.footer-info-list .info-label {
  font-weight: 600;
  color: var(--text-title);
  min-width: 110px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.footer-info-list .info-val {
  color: var(--text-body);
}

.contact-icon {
  font-size: 0.95rem;
  color: var(--primary);
  margin-top: 3px;
  flex-shrink: 0;
}

.footer-info-list li strong {
  display: block;
  font-size: 0.78rem;
  color: var(--text-title);
}

.footer-info-list li p {
  margin: 2px 0 0;
  color: var(--text-body);
  font-size: 0.8rem;
}

.footer-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  text-decoration: underline;
}

.server-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-top: 4px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* SUB-FOOTER */
.sub-footer {
  background: #f8fafc;
  border-top: 1px solid var(--border);
  padding: 14px 0;
  font-size: 0.78rem;
}

.sub-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.copyright-text {
  margin: 0;
  color: var(--text-muted);
}

.copyright-text strong {
  color: var(--text-title);
}

.sub-footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-vnam-secure {
  font-size: 0.72rem;
  color: #0d9488;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.back-to-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
  transition: all 0.2s ease;
}

.back-to-top-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* NÚT NỔI FLOATING BACK TO TOP */
.floating-back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 95, 168, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 990;
}

.floating-back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.floating-back-to-top:hover {
  background: #0284c7;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 18px rgba(0, 95, 168, 0.45);
}

/* RESPONSIVE FOOTER */
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  .footer-col.col-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .sub-footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* PAGINATION */
.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 18px;
  margin-bottom: 2px;
}

.pagination-row {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 30px;
  padding: 5px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.page-btn {
  height: 32px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  background: #ffffff;
  color: var(--text-title);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-btn:hover:not(:disabled) {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: #e2e8f0;
  background: #f1f5f9;
}

.page-info {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 700;
  padding: 0 8px;
  white-space: nowrap;
}

/* ================= THEME TOGGLE BUTTON ================= */
.theme-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* ================= MUSIC SOUNDWAVE WAVEFORM ================= */
.music-soundwave-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.soundwave-bar {
  width: 3px;
  background: linear-gradient(180deg, #38bdf8, var(--primary));
  border-radius: 2px;
  height: 6px;
  animation: soundwaveBeat 1.2s ease-in-out infinite alternate;
}

.soundwave-bar:nth-child(1)  { height: 6px;  animation-delay: 0.0s; }
.soundwave-bar:nth-child(2)  { height: 14px; animation-delay: 0.2s; }
.soundwave-bar:nth-child(3)  { height: 18px; animation-delay: 0.4s; }
.soundwave-bar:nth-child(4)  { height: 8px;  animation-delay: 0.1s; }
.soundwave-bar:nth-child(5)  { height: 20px; animation-delay: 0.5s; }
.soundwave-bar:nth-child(6)  { height: 12px; animation-delay: 0.3s; }
.soundwave-bar:nth-child(7)  { height: 16px; animation-delay: 0.6s; }
.soundwave-bar:nth-child(8)  { height: 9px;  animation-delay: 0.15s; }
.soundwave-bar:nth-child(9)  { height: 19px; animation-delay: 0.35s; }
.soundwave-bar:nth-child(10) { height: 11px; animation-delay: 0.25s; }
.soundwave-bar:nth-child(11) { height: 15px; animation-delay: 0.45s; }
.soundwave-bar:nth-child(12) { height: 7px;  animation-delay: 0.05s; }

@keyframes soundwaveBeat {
  0% {
    transform: scaleY(0.3);
    opacity: 0.5;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
  100% {
    transform: scaleY(0.4);
    opacity: 0.6;
  }
}

.soundwave-label {
  margin-left: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ================= QUICK PILLS FILTER BAR ================= */
.quick-pills-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.pills-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 4px;
}

.pills-title i {
  color: #ea580c;
}

.quick-pill {
  height: 32px;
  padding: 0 13px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-body);
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.quick-pill .pill-icon {
  font-size: 0.95rem;
}

.quick-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f9ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 104, 140, 0.12);
}

.quick-pill.active {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 3px 10px rgba(0, 104, 140, 0.28);
}

/* ================= VIBRANT MUSIC BADGES ================= */
.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-piano {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fef08a;
}

.badge-string {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}

.badge-folk {
  background: #ccfbf1;
  color: #115e59;
  border: 1px solid #99f6e4;
}

.badge-score {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-thesis {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.badge-cd {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
}

.badge-music {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.fa-spin-hover {
  animation: spinSlow 3s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ================= CONCERT DARK MODE (SÂN KHẤU NGHỆ THUẬT) ================= */
body.dark-theme {
  --bg-page: #0b1120;
  --bg-card: #151f32;
  --border: #243247;
  --text-title: #f1f5f9;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  background-color: var(--bg-page);
  color: var(--text-body);
}

body.dark-theme .site-header {
  background: rgba(9, 18, 30, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: #1e293b;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-theme .header-info-badge {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

body.dark-theme .header-info-badge.badge-hotline {
  background: rgba(2, 132, 199, 0.15);
  border-color: rgba(2, 132, 199, 0.3);
  color: #7dd3fc;
}

body.dark-theme .header-info-badge.badge-about {
  background: rgba(15, 118, 110, 0.15);
  border-color: rgba(15, 118, 110, 0.35);
  color: #5eead4;
}

body.dark-theme .header-info-badge.badge-guide {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.3);
  color: #c4b5fd;
}

body.dark-theme .guide-step-card {
  background: #151f32;
  border-color: #243247;
}

body.dark-theme .guide-step-card:hover {
  border-color: #38bdf8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

body.dark-theme .guide-step-card .step-num {
  background: #0f172a;
  border-color: #334155;
  color: #38bdf8;
}

body.dark-theme .guide-table th {
  background: #0f172a;
  border-bottom-color: #334155;
  color: #f1f5f9;
}

body.dark-theme .guide-table td {
  border-bottom-color: #1e293b;
  color: #cbd5e1;
}

body.dark-theme .guide-table tr:hover td {
  background: #1e293b;
}

body.dark-theme .guide-table code {
  background: #1e293b;
  border-color: #334155;
  color: #93c5fd;
}

body.dark-theme .btn-guide-try {
  background: rgba(2, 132, 199, 0.2);
  border-color: rgba(2, 132, 199, 0.4);
  color: #7dd3fc;
}

body.dark-theme .btn-guide-try:hover {
  background: #0284c7;
  color: #ffffff;
}

body.dark-theme .guide-tips-wrap {
  background: #151f32;
  border-color: #243247;
}

body.dark-theme .guide-chip {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-theme .guide-chip:hover {
  background: #1e293b;
  border-color: #38bdf8;
  color: #38bdf8;
}

body.dark-theme .guide-policy-box {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
}

body.dark-theme .guide-policy-row {
  color: #86efac;
}

body.dark-theme .guide-policy-row i {
  color: #4ade80;
}

body.dark-theme .about-hero-box {
  background: linear-gradient(135deg, #091e2b 0%, #0d1e33 100%);
  border-color: #0369a1;
}

body.dark-theme .about-hero-desc {
  color: #cbd5e1;
}

body.dark-theme .about-stat-item {
  background: #151f32;
  border-color: #243247;
}

body.dark-theme .collection-card {
  background: #151f32;
  border-color: #243247;
}

body.dark-theme .collection-card:hover {
  border-color: #38bdf8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

body.dark-theme .collection-icon {
  background: rgba(2, 132, 199, 0.2);
  border-color: rgba(2, 132, 199, 0.4);
  color: #7dd3fc;
}

body.dark-theme .space-card {
  background: #151f32;
  border-color: #243247;
}

body.dark-theme .space-icon {
  color: #2dd4bf;
}

body.dark-theme .about-contact-card {
  background: #151f32;
  border-color: #243247;
}

body.dark-theme .about-contact-card .contact-header {
  border-bottom-color: #243247;
}

body.dark-theme .theme-toggle-btn {
  background: #f59e0b;
  color: #0f172a;
  border-color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

body.dark-theme .search-wrapper {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
}

body.dark-theme .kpi-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .kpi-card:hover {
  border-color: #38bdf8;
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.15);
}

body.dark-theme .search-box-row {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

body.dark-theme .search-input-field input {
  color: #f1f5f9;
}

body.dark-theme .search-input-field input::placeholder {
  color: #64748b;
}

body.dark-theme .search-select-field {
  background-color: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark-theme .search-select-wrapper i {
  color: #94a3b8;
}

body.dark-theme .btn-filter-toggle {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

body.dark-theme .btn-filter-toggle.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

body.dark-theme .btn-filter-reset {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-theme .btn-filter-reset:hover {
  background: #1e293b;
  color: #f8fafc;
}

body.dark-theme .quick-pills-row {
  border-top-color: #334155;
}

body.dark-theme .quick-pill {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-theme .quick-pill:hover {
  background: #0f172a;
  border-color: #38bdf8;
  color: #38bdf8;
}

body.dark-theme .quick-pill.active {
  background: #0284c7 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

body.dark-theme .book-card {
  background: #151f32;
  border-color: #243247;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

body.dark-theme .book-card:hover {
  border-color: #38bdf8;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 12px rgba(56, 189, 248, 0.15);
}

body.dark-theme .book-thumb {
  background: #0b1120;
  border-color: #334155;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-theme .book-code {
  background: #0f172a;
  color: #93c5fd;
  border-color: #1e3a8a;
}

body.dark-theme .book-year {
  background: #0f172a;
  color: #fcd34d;
  border-color: #78350f;
}

body.dark-theme .pub-tag {
  background: #0f172a;
  color: #94a3b8;
  border-color: #334155;
}

body.dark-theme .badge-piano {
  background: rgba(254, 240, 138, 0.15);
  color: #fef08a;
  border-color: rgba(254, 240, 138, 0.3);
}

body.dark-theme .badge-string {
  background: rgba(233, 213, 255, 0.15);
  color: #e9d5ff;
  border-color: rgba(233, 213, 255, 0.3);
}

body.dark-theme .badge-folk {
  background: rgba(153, 246, 228, 0.15);
  color: #5eead4;
  border-color: rgba(153, 246, 228, 0.3);
}

body.dark-theme .badge-score {
  background: rgba(254, 202, 202, 0.15);
  color: #fca5a5;
  border-color: rgba(254, 202, 202, 0.3);
}

body.dark-theme .badge-thesis {
  background: rgba(187, 247, 208, 0.15);
  color: #86efac;
  border-color: rgba(187, 247, 208, 0.3);
}

body.dark-theme .badge-cd {
  background: rgba(186, 230, 253, 0.15);
  color: #7dd3fc;
  border-color: rgba(186, 230, 253, 0.3);
}

body.dark-theme .badge-music {
  background: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}

body.dark-theme .toggle-btn {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

body.dark-theme .toggle-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

body.dark-theme .pagination-row {
  background: #151f32;
  border-color: #243247;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .page-btn {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-theme .page-btn:hover:not(:disabled) {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

body.dark-theme .page-btn:disabled {
  background: #151f32;
  border-color: #1e293b;
  color: #475569;
}

body.dark-theme .page-info {
  color: #38bdf8;
}

body.dark-theme .modal-card {
  background: #151f32;
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-theme .modal-header, body.dark-theme .modal-footer {
  background: #0f172a;
  border-color: #243247;
}

body.dark-theme .modal-prop-row {
  border-bottom-color: #1e293b;
}

body.dark-theme .modal-notice {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.3);
  color: #fef08a;
}

body.dark-theme .site-footer {
  background: #09121e;
  border-top-color: #1e293b;
}

body.dark-theme .footer-heading {
  border-bottom-color: #1e293b;
  color: #f1f5f9;
}

body.dark-theme .footer-brand-title {
  color: #38bdf8;
}

body.dark-theme .footer-brand-sub,
body.dark-theme .footer-desc,
body.dark-theme .copyright-text {
  color: #94a3b8;
}

body.dark-theme .stat-pill {
  background: #151f32;
  border-color: #243247;
  color: #cbd5e1;
}

body.dark-theme .footer-info-list .info-label,
body.dark-theme .footer-info-list li strong {
  color: #f1f5f9;
}

body.dark-theme .footer-info-list .info-val,
body.dark-theme .footer-info-list li p {
  color: #cbd5e1;
}

body.dark-theme .server-status-badge {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

body.dark-theme .sub-footer {
  background: #060b13;
  border-top-color: #1e293b;
}

body.dark-theme .back-to-top-btn {
  background: #151f32;
  border-color: #243247;
  color: #93c5fd;
}

body.dark-theme .back-to-top-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

body.dark-theme .floating-back-to-top {
  background: #0284c7;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

body.dark-theme #emptyIndicator {
  background: #151f32;
  border-color: #334155;
}

/* ================= BANNER TRẠNG THÁI ĐANG TÌM KIẾM CSDL ================= */
.search-loading-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 18px 24px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #bae6fd;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.08);
  margin-bottom: 24px;
  animation: fadeIn 0.25s ease;
}

.search-loading-spinner {
  font-size: 2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-loading-content {
  text-align: left;
}

.loading-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 3px 0;
}

.loading-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

body.dark-theme .search-loading-banner {
  background: #151f32;
  border-color: #0369a1;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

body.dark-theme .loading-title {
  color: #38bdf8;
}

body.dark-theme .loading-desc {
  color: #94a3b8;
}
