/* ==========================================================================
   ByteByteGo - Book & Document Exports
   Minimalist Design · Tactile 3D Hardcover Physics · Zero Filler
   ========================================================================== */

.books-library-section {
  position: relative;
  z-index: 1;
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--border-color);
  scroll-margin-top: 70px;
}

/* Section Header */
.library-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 36px;
}

.library-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
  margin: 0 0 10px;
  line-height: 1.2;
}

.library-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 auto 20px;
}

/* Minimal Format Chips */
.library-formats-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.format-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.format-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* Books Grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Single Book Card Container */
.book-showcase-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 18px 20px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.book-showcase-card:hover {
  border-color: var(--primary);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
}

/* 3D Book Stage */
.book-3d-stage {
  perspective: 1000px;
  margin-bottom: 20px;
  width: 210px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* 3D Physical Book Item */
.book-3d-object {
  width: 200px;
  height: 290px;
  position: relative;
  transform: rotateY(-9deg) rotateX(3deg);
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
  cursor: pointer;
  border-radius: 3px 10px 10px 3px;
  box-shadow:
    -5px 3px 12px rgba(0, 0, 0, 0.4),
    0 12px 24px rgba(0, 0, 0, 0.3);
}

.book-showcase-card:hover .book-3d-object {
  transform: rotateY(-2deg) rotateX(0deg) translateY(-6px) scale(1.02);
  box-shadow:
    -6px 6px 18px rgba(0, 0, 0, 0.48),
    0 18px 34px rgba(0, 0, 0, 0.35);
}

/* Stacked Paper Edge */
.book-3d-object::after {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  right: -7px;
  width: 7px;
  background: repeating-linear-gradient(
    to bottom,
    #FDFBF7,
    #FDFBF7 2px,
    #E8E4DD 2px,
    #E8E4DD 4px
  );
  border-radius: 0 3px 3px 0;
  box-shadow: inset 1px 0 2px rgba(0,0,0,0.15);
  transform: skewY(4deg);
  transform-origin: left top;
}

/* Book Front Cover Surface */
.book-surface {
  position: absolute;
  inset: 0;
  border-radius: 3px 10px 10px 3px;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-sizing: border-box;
  user-select: none;
}

/* Subtle Spine Indentation */
.book-surface::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10px;
  width: 2px;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.1);
  z-index: 5;
}

/* Clean Typography Blocks */
.book-cover-title-wrap {
  padding-left: 6px;
  z-index: 2;
}

.book-cover-h1 {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  text-transform: uppercase;
  color: #FFFFFF;
}

.book-cover-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  opacity: 0.9;
}

.book-cover-graphic {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
  padding-left: 6px;
  z-index: 2;
}

.book-cover-graphic svg {
  width: 90px;
  height: 90px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.book-cover-bottom {
  padding-left: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  z-index: 2;
}

/* Colorway Themes */
.theme-sdi {
  background: linear-gradient(145deg, #182236 0%, #0D131F 100%);
  border-top: 4px solid #00BA83;
}
.theme-sdi .book-cover-sub { color: #00BA83; }

.theme-coding {
  background: linear-gradient(145deg, #FAF8F5 0%, #EFEBE4 100%);
  border-top: 4px solid #DC2626;
  box-shadow: -5px 3px 12px rgba(0,0,0,0.35);
}
.theme-coding .book-cover-h1 { color: #18181B; }
.theme-coding .book-cover-sub { color: #DC2626; }
.theme-coding .book-cover-bottom { color: #18181B; border-color: rgba(0,0,0,0.15); }
.theme-coding::before { background: rgba(0,0,0,0.08); }

.theme-behavior {
  background: linear-gradient(145deg, #3D1A0F 0%, #220B04 100%);
  border-top: 4px solid #F97316;
}
.theme-behavior .book-cover-sub { color: #FDBA74; }

.theme-ood {
  background: linear-gradient(145deg, #0B2545 0%, #031224 100%);
  border-top: 4px solid #38BDF8;
}
.theme-ood .book-cover-sub { color: #38BDF8; }

.theme-ml {
  background: linear-gradient(145deg, #064E3B 0%, #022C22 100%);
  border-top: 4px solid #10B981;
}
.theme-ml .book-cover-sub { color: #6EE7B7; }

.theme-mobile {
  background: linear-gradient(145deg, #1E293B 0%, #0F172A 100%);
  border-top: 4px solid #3B82F6;
}
.theme-mobile .book-cover-sub { color: #60A5FA; }

.theme-genai {
  background: linear-gradient(145deg, #1E1B4B 0%, #0F0E2A 100%);
  border-top: 4px solid #8B5CF6;
}
.theme-genai .book-cover-sub { color: #C4B5FD; }

.theme-resume {
  background: linear-gradient(145deg, #271810 0%, #150C08 100%);
  border-top: 4px solid #F59E0B;
}
.theme-resume .book-cover-sub { color: #FBBF24; }

/* Card Details */
.book-details {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.book-details-header {
  text-align: center;
}

.book-details-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}

.book-details-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Clean Editorial Book Card Actions */
.book-card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.book-read-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  text-decoration: none;
  background: var(--primary);
  color: #FFFFFF !important;
  border: 1px solid transparent;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.book-read-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 186, 131, 0.25);
}

.book-read-btn svg {
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.book-read-btn:hover svg {
  transform: translateX(3px);
}

.book-formats-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 0;
}

.book-format-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s ease;
  padding: 2px 5px;
  border-radius: 4px;
}

.book-format-link:hover {
  color: var(--text-main);
  background: var(--border-color);
}

.format-sep {
  opacity: 0.35;
  font-size: 10px;
  user-select: none;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .library-title {
    font-size: 24px;
  }
  
  .books-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
  }
}
