/* ==========================================================================
   READ.DENNIS.VN — MODERN VIETNAMESE TYPOGRAPHY & MOBILE-FIRST LUXURY UI
   Font chữ: Be Vietnam Pro & Inter (Rõ nét, hiện đại, tối ưu tiếng Việt 100%)
   Giữ nguyên hiệu ứng ánh sáng kệ sách & sách 3D
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-obsidian: #0c0a09;
  --bg-surface: #14110e;
  --bg-elevated: #1c1713;
  --border-subtle: rgba(212, 175, 55, 0.18);
  --border-hover: rgba(212, 175, 55, 0.48);
  --gold-primary: #eab308;
  --gold-soft: #facc15;
  --text-primary: #fafaf9;
  --text-secondary: #d6d3d1;
  --text-muted: #a8a29e;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  font-family: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.65;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.07) 0%, transparent 50%),
    linear-gradient(180deg, #0c0a09 0%, #120e0b 50%, #0c0a09 100%);
}

/* Đổi toàn bộ class tiêu đề sang Be Vietnam Pro rõ nét, dễ đọc, không dùng font có chân nét mảnh khó đọc */
.font-serif-display,
.font-serif-classic {
  font-family: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.02em;
}

/* Chống rớt chữ trên mọi nút bấm và nhãn trạng thái */
.btn-no-wrap,
button,
a.btn-inline {
  white-space: nowrap;
}

/* Ẩn thanh cuộn cho danh sách tab ngang trên Mobile */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Thanh cuộn tinh giản */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #0e0b09;
}
::-webkit-scrollbar-thumb {
  background: #33251b;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #eab308;
}

/* ==========================================================================
   HIỆU ỨNG ÁNH SÁNG KỆ SÁCH & SÁCH 3D (GIỮ NGUYÊN THEO YÊU CẦU)
   ========================================================================== */

.grand-library-frame {
  position: relative;
  background: linear-gradient(180deg, #21140c 0%, #130b07 100%);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 20px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 223, 140, 0.16),
    inset 0 0 50px rgba(0, 0, 0, 0.75);
  padding: 24px 20px 28px;
}

@media (min-width: 640px) {
  .grand-library-frame {
    padding: 28px 26px 34px;
  }
}

.library-cornice {
  background: linear-gradient(90deg, #1b1009 0%, #301c10 50%, #1b1009 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}

.shelf-compartment {
  position: relative;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 196, 87, 0.06) 0%, transparent 70%),
    linear-gradient(180deg, #120b07 0%, #1b110b 78%, #2a190f 100%);
  border: 1px solid #382214;
  border-bottom: 14px solid #362011;
  border-radius: 14px 14px 6px 6px;
  padding: 22px 18px 18px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition:
    transform 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.38s ease,
    box-shadow 0.38s ease,
    background 0.38s ease;
  box-shadow:
    inset 0 14px 28px rgba(0, 0, 0, 0.85),
    inset 0 -4px 10px rgba(0, 0, 0, 0.65),
    0 10px 25px rgba(0, 0, 0, 0.5);
}

@media (min-width: 640px) {
  .shelf-compartment {
    padding: 26px 24px 20px;
  }
}

.shelf-compartment::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  background: linear-gradient(90deg, #2d1a0e, #52321b 50%, #2d1a0e);
  border-top: 1px solid rgba(212, 175, 55, 0.28);
}

.shelf-lamp-cone {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  height: 230px;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(255, 214, 102, 0.34) 0%,
    rgba(212, 175, 55, 0.14) 45%,
    transparent 78%
  );
  opacity: 0.22;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.banker-lamp-shade {
  width: 54px;
  height: 18px;
  border-radius: 26px 26px 5px 5px;
  background: linear-gradient(180deg, #065f46 0%, #047857 60%, #10b981 100%);
  border: 1.5px solid #d4af37;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
  position: relative;
  margin: 0 auto 10px;
  transition: all 0.35s ease;
}

.banker-lamp-shade::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 6px;
  border-radius: 50%;
  background: #fde68a;
  opacity: 0.35;
  filter: blur(2px);
  transition: all 0.35s ease;
}

.shelf-compartment:hover,
.shelf-compartment:active {
  transform: translateY(-5px) scale(1.008);
  border-color: #d4af37;
  background:
    radial-gradient(circle at 50% 0%, rgba(251, 191, 36, 0.22) 0%, transparent 72%),
    linear-gradient(180deg, #1f140c 0%, #291a10 80%, #3b2415 100%);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.85),
    0 0 32px rgba(212, 175, 55, 0.28),
    inset 0 0 35px rgba(251, 191, 36, 0.14);
}

.shelf-compartment:hover .shelf-lamp-cone,
.shelf-compartment:active .shelf-lamp-cone {
  opacity: 1;
  transform: translateX(-50%) scale(1.05);
}

.shelf-compartment:hover .banker-lamp-shade,
.shelf-compartment:active .banker-lamp-shade {
  background: linear-gradient(180deg, #10b981 0%, #34d399 70%, #a7f3d0 100%);
  box-shadow:
    0 0 22px rgba(16, 185, 129, 0.8),
    0 6px 20px rgba(251, 191, 36, 0.65);
}

.shelf-compartment:hover .banker-lamp-shade::after,
.shelf-compartment:active .banker-lamp-shade::after {
  opacity: 1;
  width: 42px;
  background: #fffbeb;
  box-shadow: 0 0 18px 6px rgba(251, 191, 36, 0.9);
}

.book-spines-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 70px;
  margin-top: 14px;
  padding: 0 8px;
}

.book-spine-item {
  width: 24px;
  border-radius: 3px 3px 1px 1px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: inset -3px 0 6px rgba(0,0,0,0.45), 2px 0 5px rgba(0,0,0,0.5);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
  position: relative;
}

.book-spine-item::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 3px;
  right: 3px;
  height: 2px;
  background: rgba(212, 175, 55, 0.65);
  box-shadow: 0 4px 0 rgba(212, 175, 55, 0.4);
}

.shelf-compartment:hover .book-spine-item:nth-child(odd) {
  transform: translateY(-7px);
}
.shelf-compartment:hover .book-spine-item:nth-child(even) {
  transform: translateY(-12px) rotate(-2deg);
  box-shadow: 0 8px 16px rgba(0,0,0,0.6), 0 0 12px rgba(212, 175, 55, 0.35);
}

/* ==========================================================================
   THẺ SÁCH & BÌA HARDCOVER 3D (HỖ TRỢ CẢ ẢNH BÌA EBOOK THẬT & BÌA 3D)
   ========================================================================== */

.executive-book-card {
  background: linear-gradient(180deg, #16120e 0%, #100d0a 100%);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.executive-book-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow:
    0 20px 42px rgba(0, 0, 0, 0.75),
    0 0 24px rgba(212, 175, 55, 0.12);
}

.hardcover-3d {
  position: relative;
  border-radius: 5px 9px 9px 5px;
  box-shadow:
    -5px 0 0 #261b13,
    -7px 0 0 rgba(212, 175, 55, 0.38),
    0 12px 24px rgba(0, 0, 0, 0.7),
    inset 3px 0 8px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.38);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.executive-book-card:hover .hardcover-3d {
  transform: perspective(700px) rotateY(-6deg) translateY(-3px);
  box-shadow:
    -7px 2px 0 #261b13,
    -9px 2px 0 rgba(212, 175, 55, 0.58),
    8px 16px 28px rgba(0, 0, 0, 0.82);
}

/* ==========================================================================
   MARKDOWN READER TYPOGRAPHY (FONT CHỮ HIỆN ĐẠI, DỄ ĐỌC TUYỆT ĐỐI)
   ========================================================================== */

.markdown-reader-body {
  font-family: 'Be Vietnam Pro', 'Inter', -apple-system, sans-serif;
  font-size: 1.05rem;
  line-height: 1.85;
  color: #f5f5f4;
}

@media (min-width: 640px) {
  .markdown-reader-body {
    font-size: 1.125rem;
  }
}

.markdown-reader-body h1 {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.35;
  color: #ffffff;
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
  padding-bottom: 0.75rem;
  margin-top: 0;
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .markdown-reader-body h1 {
    font-size: 2rem;
  }
}

.markdown-reader-body h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fde68a;
  margin-top: 2rem;
  margin-bottom: 0.85rem;
}

.markdown-reader-body h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fcd34d;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.markdown-reader-body blockquote {
  margin: 1.4rem 0;
  padding: 1rem 1.25rem;
  background: rgba(212, 175, 55, 0.08);
  border-left: 3px solid #eab308;
  border-radius: 0 10px 10px 0;
  color: #fef3c7;
  font-style: normal;
}

.markdown-reader-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
}

.markdown-reader-body th,
.markdown-reader-body td {
  border: 1px solid rgba(212, 175, 55, 0.22);
  padding: 10px 14px;
  text-align: left;
}

.markdown-reader-body th {
  background: rgba(212, 175, 55, 0.14);
  color: #fde68a;
  font-weight: 600;
}

/* ==========================================================================
   FLOATING CHAT BUTTON & HOVER POPOVER (HỖ TRỢ TÀI KHOẢN & HỢP TÁC DỰ ÁN)
   ========================================================================== */

.floating-chat-wrapper {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 45;
}

.floating-chat-popover {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: 320px;
  background: #16120e;
  border: 1px solid rgba(212, 175, 55, 0.38);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.98);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* Hiển thị khi rê chuột (hover) vào cụm button chat hoặc khi bấm mở trên mobile */
.floating-chat-wrapper:hover .floating-chat-popover,
.floating-chat-wrapper.chat-open .floating-chat-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
