/* ============================================
   AURA READS — Library Page Styles
   Premium dark theme with gold accents.
   Designed for the book library with tabs,
   book cards, paywall modal, and premium unlock.
   ============================================ */

/* --- Inherit design tokens from style.css --- */

/* ============================================
   GENERAL / BODY
   ============================================ */
body.library-page {
  background: var(--bg-primary, var(--bg-primary));
  color: var(--text-primary, var(--text-primary));
  font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   LIBRARY HERO
   ============================================ */
.library-hero {
  position: relative;
  padding: clamp(7rem, 12vw, 10rem) 1.5rem clamp(3rem, 5vw, 5rem);
  text-align: center;
  overflow: hidden;
}

.library-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.library-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.library-hero__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.2rem, 1.8rem + 2vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.library-hero__title em {
  font-style: italic;
  color: var(--accent);
}

.library-hero__sub {
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.15rem);
  color: rgba(9, 9, 11, 0.6);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* ============================================
   TAB NAVIGATION
   ============================================ */
.library-tabs {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(9, 9, 11, 0.06);
  padding: 0 1.5rem;
}

.library-tabs__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

.library-tab {
  position: relative;
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  color: rgba(9, 9, 11, 0.45);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.3s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.library-tab:hover {
  color: rgba(9, 9, 11, 0.8);
}

.library-tab.active {
  color: var(--accent);
}

.library-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 70%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.library-tab.active::after {
  transform: translateX(-50%) scaleX(1);
}

.library-tab__icon {
  font-size: 1.1rem;
}

.library-tab__badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent);
  border-radius: 9999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.library-tab__lock {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

/* ============================================
   TAB CONTENT PANELS
   ============================================ */
.library-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  min-height: 60vh;
}

.tab-panel {
  display: none;
  animation: fadeInPanel 0.4s ease forwards;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeInPanel {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   FREE SECTION — Conversion Hook
   ============================================ */
.free-section__intro {
  text-align: center;
  margin-bottom: 2.5rem;
}

.free-section__tagline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.8rem);
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.free-section__desc {
  font-size: 0.95rem;
  color: rgba(9, 9, 11, 0.5);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Featured free book card — extra large, dramatic */
.free-book-featured {
  position: relative;
  max-width: 800px;
  margin: 0 auto 3rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
}

.free-book-featured:hover {
  border-color: rgba(249, 115, 22, 0.3);
  box-shadow: 0 8px 60px rgba(249, 115, 22, 0.1);
}

.free-book-featured__inner {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.free-book-featured__cover {
  position: relative;
  width: 280px;
  min-height: 380px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.free-book-featured__cover-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.free-book-featured__cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.free-book-featured__cover-gradient {
  width: 100%;
  height: 100%;
}

.free-book-featured__cover-text {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
}

.free-book-featured__cover-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  margin-bottom: 0.5rem;
}

.free-book-featured__cover-author {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  font-weight: 400;
}

.free-book-featured__info {
  flex: 1;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.free-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  width: fit-content;
}

.free-book-featured__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.5rem, 1.3rem + 0.5vw, 2rem);
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  line-height: 1.2;
}

.free-book-featured__author {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.free-book-featured__hook {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(249, 115, 22, 0.3);
}

.free-book-featured__meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.free-book-featured__tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  background: rgba(9, 9, 11, 0.05);
  border: 1px solid rgba(9, 9, 11, 0.08);
  border-radius: 6px;
  color: rgba(9, 9, 11, 0.5);
}

.free-book-featured__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.8rem;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  width: fit-content;
}

.free-book-featured__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(249, 115, 22, 0.3);
}

.free-book-featured__cta svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.free-book-featured__cta:hover svg {
  transform: translateX(4px);
}

/* Free section CTA to premium */
.free-section__upsell {
  text-align: center;
  padding: 2.5rem 2rem;
  background: rgba(249, 115, 22, 0.04);
  border: 1px solid rgba(249, 115, 22, 0.1);
  border-radius: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.free-section__upsell h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.free-section__upsell p {
  font-size: 0.9rem;
  color: rgba(9, 9, 11, 0.5);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.free-section__upsell-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 1px solid rgba(249, 115, 22, 0.4);
  color: var(--accent);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.free-section__upsell-btn:hover {
  background: rgba(249, 115, 22, 0.1);
  border-color: var(--accent);
}

/* ============================================
   BOOK GRID — Scales to 50+ books
   ============================================ */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Section headers in premium/bio panels */
.panel-header {
  text-align: center;
  margin-bottom: 2rem;
}

.panel-header__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.7rem);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.panel-header__desc {
  font-size: 0.9rem;
  color: rgba(9, 9, 11, 0.45);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Already unlocked state */
.premium-unlocked-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(249, 115, 22, 0.05));
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.1);
}

.premium-unlocked-bar svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.premium-unlocked-bar p {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(249, 115, 22, 0.2);
}

.premium-unlocked-bar__logout {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(9, 9, 11, 0.4);
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  margin-left: 0.5rem;
}

.premium-unlocked-bar__logout:hover {
  border-color: rgba(255, 107, 107, 0.4);
  color: #ff6b6b;
}

/* ============================================
   BOOK CARD — The core reusable card
   ============================================ */
.book-card {
  position: relative;
  background: rgba(20, 20, 35, 0.5);
  border: 1px solid rgba(9, 9, 11, 0.06);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-card:hover {
  border-color: rgba(249, 115, 22, 0.25);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(249, 115, 22, 0.06);
}

/* Cover area */
.book-card__cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.book-card__cover-bg {
  position: absolute;
  inset: 0;
}

.book-card__cover-gradient {
  width: 100%;
  height: 100%;
}

.book-card__cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Text overlay on cover (fallback when no image) */
.book-card__cover-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  z-index: 1;
}

.book-card__cover-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 2px 15px rgba(0,0,0,0.5);
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.book-card__cover-author {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.65);
  font-weight: 400;
}

/* Decorative lines on cover */
.book-card__cover::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  bottom: 15px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
}

/* Premium lock overlay */
.book-card__lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.book-card:hover .book-card__lock-overlay {
  opacity: 0.7;
}

.book-card__lock-icon {
  width: 36px;
  height: 36px;
  background: rgba(249, 115, 22, 0.2);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-card__lock-icon svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* Coming soon badge */
.book-card__coming-soon {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0.35rem 0.7rem;
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  z-index: 6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Card info below cover */
.book-card__info {
  padding: 1rem 1rem 1.2rem;
}

.book-card__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card__author {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.book-card__hook {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-style: italic;
}

/* Premium badge on card */
.book-card__premium-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 0.35rem 0.7rem;
  background: var(--gold);
  border: 1px solid var(--gold-light);
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  z-index: 6;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

/* Free badge on card */
.book-card__free-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 0.35rem 0.7rem;
  background: #111111;
  border: 1px solid rgba(105, 240, 174, 0.5);
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #69f0ae;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  z-index: 6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Unlocked card (premium user) — remove lock overlay */
.book-card.unlocked .book-card__lock-overlay {
  display: none;
}

.book-card.unlocked .book-card__premium-badge {
  background: rgba(10, 10, 10, 0.75);
  border-color: rgba(105, 240, 174, 0.4);
  color: #69f0ae;
}

/* ============================================
   PAYWALL MODAL
   ============================================ */
.paywall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeInOverlay 0.3s ease;
}

.paywall-overlay.visible {
  display: flex;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.paywall-modal {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  max-width: 520px;
  width: 100%;
  padding: 2.5rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), 0 0 30px rgba(249, 115, 22, 0.05);
  animation: slideUpModal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes slideUpModal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.paywall-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: rgba(9, 9, 11, 0.04);
  border: 1px solid rgba(9, 9, 11, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(9, 9, 11, 0.4);
  transition: all 0.3s ease;
}

.paywall-modal__close:hover {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.3);
  color: #ff6b6b;
}

.paywall-modal__close svg {
  width: 16px;
  height: 16px;
}

.paywall-modal__icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(249, 115, 22, 0.05));
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  box-shadow: inset 0 0 20px rgba(249, 115, 22, 0.05);
}

.paywall-modal__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.paywall-modal__book-name {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.paywall-modal__desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* Pricing cards in modal */
.paywall-pricing {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.paywall-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background: rgba(9, 9, 11, 0.03);
  border: 1px solid rgba(9, 9, 11, 0.08);
  border-radius: 12px;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.paywall-plan:hover {
  border-color: rgba(249, 115, 22, 0.4);
  background: rgba(249, 115, 22, 0.08);
}

.paywall-plan.featured {
  border-color: rgba(249, 115, 22, 0.3);
  background: rgba(249, 115, 22, 0.1);
}

.paywall-plan__info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.paywall-plan__name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.paywall-plan__badge {
  font-size: 0.6rem;
  padding: 0.15rem 0.4rem;
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent);
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.paywall-plan__local {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.paywall-plan__price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.paywall-plan__price span {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.paywall-plan__arrow {
  width: 20px;
  height: 20px;
  color: rgba(9, 9, 11, 0.3);
  transition: transform 0.3s ease, color 0.3s ease;
}

.paywall-plan:hover .paywall-plan__arrow {
  transform: translateX(4px);
  color: var(--accent);
}

/* Subscription steps inside modal */
.paywall-steps {
  background: rgba(9, 9, 11, 0.02);
  border: 1px solid rgba(9, 9, 11, 0.06);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.paywall-steps__title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.paywall-steps__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.paywall-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.paywall-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================
   COMING SOON MODAL
   ============================================ */
.coming-soon-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeInOverlay 0.3s ease;
}

.coming-soon-overlay.visible {
  display: flex;
}

.coming-soon-modal {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  max-width: 440px;
  width: 100%;
  padding: 3rem 2.5rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), 0 0 30px rgba(249, 115, 22, 0.05);
  animation: slideUpModal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.coming-soon-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: rgba(9, 9, 11, 0.04);
  border: 1px solid rgba(9, 9, 11, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(9, 9, 11, 0.4);
  transition: all 0.3s ease;
}

.coming-soon-modal__close:hover {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.3);
  color: #ff6b6b;
}

.coming-soon-modal__close svg {
  width: 16px;
  height: 16px;
}

.coming-soon-modal__icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(249, 115, 22, 0.02));
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: inset 0 0 20px rgba(249, 115, 22, 0.05);
}

.coming-soon-modal__icon svg {
  width: 32px;
  height: 32px;
}

.coming-soon-modal__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.coming-soon-modal__desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.coming-soon-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
}

.coming-soon-modal__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(249, 115, 22, 0.3);
}

/* ============================================
   BACK TO HOME LINK (top nav)
   ============================================ */
.library-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(9, 9, 11, 0.04);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
}

.library-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.library-nav__logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.library-nav__logo span {
  color: var(--accent);
}

.library-nav__logo:hover {
  opacity: 0.8;
}

.library-nav__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.library-nav__link {
  font-size: 0.85rem;
  color: rgba(9, 9, 11, 0.5);
  text-decoration: none;
  transition: color 0.3s ease;
}

.library-nav__link:hover {
  color: var(--accent);
}

.library-nav__subscribe {
  padding: 0.5rem 1.2rem;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
}

.library-nav__subscribe:hover {
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3);
  transform: translateY(-1px);
}

/* ============================================
   SCROLL REVEALS (consistent with index.html)
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }

/* ============================================
   BOOK COUNT / STATS BAR
   ============================================ */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgba(9, 9, 11, 0.4);
}

.stat-item__number {
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .free-book-featured__inner {
    flex-direction: column;
  }

  .free-book-featured__cover {
    width: 100%;
    min-height: 260px;
  }

  .free-book-featured__info {
    padding: 1.5rem;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 1rem;
  }

  .book-card__cover-title {
    font-size: 0.95rem;
  }

  .book-card__info {
    padding: 0.75rem 0.75rem 1rem;
  }

  .book-card__title {
    font-size: 0.85rem;
  }

  .library-tab {
    padding: 0.85rem 0.8rem;
    font-size: 0.8rem;
  }

  .library-tab__badge {
    display: none;
  }

  .paywall-modal {
    padding: 1.5rem;
    border-radius: 20px;
  }

  .premium-unlock-bar {
    flex-direction: column;
    text-align: center;
  }

  .paywall-unlock__form {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .library-hero__title {
    font-size: 1.8rem;
  }

  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .library-tab {
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
    gap: 0.3rem;
  }

  .library-tab__icon {
    font-size: 0.95rem;
  }

  .free-book-featured__cover-title {
    font-size: 1.4rem;
  }

  .library-nav__link {
    display: none;
  }
}

/* ============================================
   FOOTER
   ============================================ */
.library-footer {
  text-align: center;
  padding: 3rem 1.5rem;
  border-top: 1px solid rgba(249, 115, 22, 0.15);
  background: linear-gradient(to bottom, transparent, rgba(249, 115, 22, 0.03));
  color: rgba(9, 9, 11, 0.7);
  font-size: 0.9rem;
  font-weight: 500;
}

.library-footer a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.library-footer a:hover {
  opacity: 0.7;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.8rem 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 12px;
  color: #1a1a2e;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(249, 115, 22, 0.15);
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  border-left: 4px solid #f97316;
}

.toast.error {
  border-left: 4px solid #ef4444;
}
