/* ==========================================================================
   NP E-Book — 4 Distinct Bookcase Themes
   ความแตกต่างอย่างสิ้นเชิงจาก AnyFlip:
   1. ไผ่งามหนองไผ่ (Bamboo Heritage)
   2. สถาบันไทยร่วมสมัย (Modern Thai Academic)
   3. หอสมุดไซเบอร์ล้ำอนาคต (Futuristic Holographic Cyber-Shelf)
   4. มินิมอลสมาร์ทคลีน (Glassmorphic Minimal)
   ========================================================================== */

/* --------------------------------------------------------------------------
   General Bookcase Container Styles
   -------------------------------------------------------------------------- */
.bookcase-section {
  margin-bottom: 4.5rem;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  transition: all var(--transition-normal);
  border: 1px solid var(--border-glass);
}

.bookcase-header {
  padding: 1.8rem 2.2rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.bookcase-title-group h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.01em;
}

.bookcase-title-group p {
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.bookcase-theme-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

/* Shelf Grid View */
.bookcase-shelf-stage {
  padding: 2.5rem 2.5rem 3.5rem;
  position: relative;
  z-index: 2;
}

.shelf-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 2.2rem;
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
}

/* Base Physical Shelf Beam (คานชั้นวาง) */
.shelf-beam {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22px;
  border-radius: 4px;
  z-index: 1;
}

/* ==========================================================================
   🎋 ธีมที่ 1: "ไผ่งามหนองไผ่" (Bamboo Heritage & Nature)
   เอกลักษณ์: ป่าไผ่ธรรมชาติ, ผืนน้ำ, กระบอกไม้ไผ่ผ่าซีก, ลายจักสาน
   ========================================================================== */
.theme-bamboo {
  background: radial-gradient(circle at 10% 20%, rgba(27, 94, 32, 0.45) 0%, rgba(5, 25, 10, 0.95) 75%);
  border-color: rgba(76, 175, 80, 0.35);
  box-shadow: 0 16px 40px rgba(10, 40, 15, 0.5), inset 0 1px 0 rgba(165, 214, 167, 0.2);
}

.theme-bamboo::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    radial-gradient(rgba(129, 199, 132, 0.08) 1.5px, transparent 1.5px),
    linear-gradient(135deg, rgba(46, 125, 50, 0.1) 0%, transparent 100%);
  background-size: 24px 24px, 100% 100%;
  pointer-events: none;
}

.theme-bamboo .bookcase-title-group h2 {
  color: #e8f5e9;
  text-shadow: 0 2px 8px rgba(0, 40, 0, 0.6);
}

.theme-bamboo .bookcase-title-group p {
  color: #a5d6a7;
}

.theme-bamboo .bookcase-theme-tag {
  background: rgba(46, 125, 50, 0.3);
  color: #c8e6c9;
  border: 1px solid rgba(129, 199, 132, 0.4);
}

/* ลำไม้ไผ่ผ่าซีกขัดเงา + ข้อไม้ไผ่ (Polished Bamboo Beam) */
.theme-bamboo .shelf-beam {
  height: 26px;
  background: linear-gradient(180deg, 
    #c49a45 0%, 
    #dfb76c 25%, 
    #9e7529 70%, 
    #694e18 100%);
  border-radius: 6px;
  box-shadow: 
    0 10px 24px rgba(0, 0, 0, 0.6), 
    inset 0 2px 3px rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.4);
  position: absolute;
  overflow: hidden;
}

/* ลายข้อไม้ไผ่ (Bamboo Nodes) */
.theme-bamboo .shelf-beam::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(90deg, 
    transparent 0px, 
    transparent 120px, 
    rgba(60, 40, 10, 0.4) 120px, 
    rgba(255, 230, 150, 0.5) 122px, 
    rgba(60, 40, 10, 0.4) 124px, 
    transparent 124px
  );
}

.theme-bamboo .book-card-item:hover {
  transform: translateY(-12px) scale(1.02);
}

.theme-bamboo .book-card-item:hover .book-cover-3d {
  box-shadow: -8px 16px 30px rgba(0, 30, 10, 0.9), 0 0 20px rgba(129, 199, 132, 0.4);
}

/* ==========================================================================
   🏛️ ธีมที่ 2: "สถาบันไทยร่วมสมัย" (Modern Thai Academic)
   เอกลักษณ์: สีกรมท่าราชการ, เส้นกนกไทยประยุกต์, ไม้สักขอบทองด้าน
   ========================================================================== */
.theme-thai {
  background: radial-gradient(circle at 80% 20%, rgba(13, 71, 161, 0.4) 0%, rgba(5, 15, 35, 0.96) 80%);
  border-color: rgba(255, 193, 7, 0.35);
  box-shadow: 0 16px 40px rgba(5, 15, 40, 0.6), inset 0 1px 0 rgba(255, 215, 0, 0.25);
}

.theme-thai::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  /* ลวดลายเพชรร่วมสมัยจำลองลายไทยกนก */
  background-image: 
    linear-gradient(45deg, rgba(255, 193, 7, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 193, 7, 0.04) 75%),
    linear-gradient(-45deg, rgba(255, 193, 7, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 193, 7, 0.04) 75%);
  background-size: 30px 30px;
  pointer-events: none;
}

.theme-thai .bookcase-title-group h2 {
  color: #fff8e1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.theme-thai .bookcase-title-group p {
  color: #ffecb3;
}

.theme-thai .bookcase-theme-tag {
  background: rgba(255, 193, 7, 0.15);
  color: #ffe082;
  border: 1px solid rgba(255, 193, 7, 0.4);
}

/* ไม้สักทองโมเดิร์น ขลิบขอบทองคำด้าน (Teak Wood with Brushed Gold) */
.theme-thai .shelf-beam {
  height: 24px;
  background: linear-gradient(180deg, 
    #ffd700 0%, 
    #b8860b 8%, 
    #3e2723 35%, 
    #211512 85%, 
    #ffd700 100%);
  border-radius: 4px;
  box-shadow: 
    0 12px 28px rgba(0, 0, 0, 0.7),
    0 0 10px rgba(255, 215, 0, 0.2),
    inset 0 1px 2px rgba(255, 255, 255, 0.7);
}

.theme-thai .book-card-item:hover {
  transform: translateY(-12px);
}

.theme-thai .book-card-item:hover .book-cover-3d {
  box-shadow: -8px 16px 32px rgba(0, 0, 0, 0.9), 0 0 24px rgba(255, 193, 7, 0.35);
}

/* ==========================================================================
   ⚡ ธีมที่ 3: "หอสมุดไซเบอร์ล้ำอนาคต" (Futuristic Holographic Shelf)
   เอกลักษณ์: แผ่นกระจกนีออนใสลอยตัว, Cyber Cyan & Purple, Hologram Glow
   ========================================================================== */
.theme-cyber {
  background: radial-gradient(circle at 50% 0%, rgba(0, 229, 255, 0.15) 0%, rgba(10, 10, 25, 0.98) 75%);
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(0, 229, 255, 0.15);
}

.theme-cyber::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(0, 229, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.06) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

.theme-cyber .bookcase-title-group h2 {
  color: #e0f7fa;
  text-shadow: 0 0 15px rgba(0, 229, 255, 0.7);
}

.theme-cyber .bookcase-title-group p {
  color: #80deea;
}

.theme-cyber .bookcase-theme-tag {
  background: rgba(0, 229, 255, 0.15);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}

/* แผ่นกระจกคริสตัลลอยตัว นีออนขอบฟ้าเรืองแสง (Floating Crystal Glass Beam) */
.theme-cyber .shelf-beam {
  height: 18px;
  background: linear-gradient(90deg, 
    rgba(0, 229, 255, 0.4) 0%, 
    rgba(168, 85, 247, 0.5) 50%, 
    rgba(0, 229, 255, 0.4) 100%);
  border: 1px solid rgba(0, 229, 255, 0.8);
  border-radius: 8px;
  box-shadow: 
    0 0 25px rgba(0, 229, 255, 0.6),
    0 10px 30px rgba(0, 0, 0, 0.8),
    inset 0 0 12px rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
}

.theme-cyber .book-card-item:hover {
  transform: translateY(-14px) scale(1.03);
}

.theme-cyber .book-card-item:hover .book-cover-3d {
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.7), 0 16px 35px rgba(0, 0, 0, 0.9);
}

.theme-cyber .book-badge-tag {
  background: linear-gradient(135deg, #00e5ff, #7c4dff);
  color: #05051e;
}

/* ==========================================================================
   ✨ ธีมที่ 4: "มินิมอลสมาร์ทคลีน" (Glassmorphic Minimal)
   เอกลักษณ์: กระจกอะคริลิกใส, โปร่งตา, เข้ากับทุกหน้าเว็บ WordPress
   ========================================================================== */
.theme-minimal {
  background: rgba(25, 33, 49, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.theme-minimal .bookcase-title-group h2 {
  color: #ffffff;
}

.theme-minimal .bookcase-title-group p {
  color: #94a3b8;
}

.theme-minimal .bookcase-theme-tag {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* แท่นวางอะคริลิกใส มินิมอลเรียบหรู (Frosted Acrylic Beam) */
.theme-minimal .shelf-beam {
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.theme-minimal .book-card-item:hover {
  transform: translateY(-10px);
}

.theme-minimal .book-card-item:hover .book-cover-3d {
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

/* Responsive Shelves */
@media (max-width: 768px) {
  .bookcase-header {
    padding: 1.2rem 1.4rem;
  }
  .bookcase-shelf-stage {
    padding: 1.5rem 1.2rem 2.5rem;
  }
  .shelf-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }
}
