/* 3D BOOK READER & GALLERY STYLES */

.reader-view-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  gap: 20px;
}

/* --- 3D BOOK CONTAINER & SPREAD --- */

.book-stage {
  perspective: 2000px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.book-spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 1180px;
  min-height: 640px;
  background: #0B0E14;
  border-radius: var(--radius-lg);
  box-shadow: 
    0 30px 60px -12px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(229, 184, 66, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

/* Center book spine seam & depth shadow */
.book-spread::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 30px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, 
    rgba(0, 0, 0, 0.3) 0%, 
    rgba(0, 0, 0, 0.6) 45%, 
    rgba(255, 255, 255, 0.05) 50%, 
    rgba(0, 0, 0, 0.6) 55%, 
    rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
  z-index: 10;
}

/* Base Book Page (Left & Right share identical structural padding & flex column) */
.book-page {
  padding: 30px 36px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #FAF8F5; /* Premium soft ivory paper */
  color: #1A1A1A;
  box-sizing: border-box;
  height: 100%;
}

.book-page-left {
  border-top-left-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-lg);
  box-shadow: inset -15px 0 25px rgba(0, 0, 0, 0.05);
}

.book-page-right {
  border-top-right-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  box-shadow: inset 15px 0 25px rgba(0, 0, 0, 0.05);
}

/* Symmetric Page Header (Top Row) */
.page-header-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 10px;
  margin-bottom: 14px;
  width: 100%;
}

.page-chapter-label {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-badge.age-badge {
  background: rgba(0, 0, 0, 0.06);
  color: #1E293B;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.book-page-number-display {
  font-family: var(--font-serif);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold-dark);
  display: block;
  margin-bottom: 4px;
}

.book-mandala-heading {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.25;
  margin-bottom: 12px;
}

/* Center Content on Left Page */
.page-content-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

/* Quote Card */
.mandala-mindful-quote-card {
  background: rgba(229, 184, 66, 0.08);
  border-left: 3px solid var(--gold-primary);
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  position: relative;
}

.quote-symbol {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--gold-dark);
  line-height: 1;
  margin-bottom: 2px;
}

.quote-text {
  font-family: var(--font-quote);
  font-size: 1.08rem;
  font-style: italic;
  color: #334155;
  line-height: 1.45;
}

/* Prompt Box */
.coloring-prompt-box {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.coloring-prompt-box h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  margin-bottom: 4px;
}

.coloring-prompt-box p {
  font-size: 0.88rem;
  color: #1E293B;
  line-height: 1.4;
}

.difficulty-rating-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.difficulty-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748B;
}

.difficulty-stars {
  color: var(--gold-primary);
  font-size: 1rem;
  letter-spacing: 1px;
}

/* Color Test Circles */
.color-test-swatches-guide {
  margin-top: 4px;
}

.test-swatch-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748B;
  margin-bottom: 6px;
}

.swatches-test-row {
  display: flex;
  gap: 8px;
}

.test-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px dashed #CBD5E1;
  background: #FFFFFF;
}

/* Center Mandala Artwork Frame on Right Page (Symmetric Padding & Centering) */
.mandala-art-frame-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px 0;
  min-height: 0;
}

.mandala-art-frame {
  width: 100%;
  max-width: 440px;
  max-height: 440px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 8px;
  box-sizing: border-box;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mandala-art-frame:hover {
  transform: scale(1.015);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.mandala-art-frame svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Symmetric Page Footer (Bottom Row) */
.book-page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 10px;
  margin-top: 14px;
  font-size: 0.75rem;
  color: #94A3B8;
  width: 100%;
}

.page-action-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.pill-btn.pill-color {
  background: var(--gold-gradient);
  color: #0F172A;
  box-shadow: 0 2px 8px rgba(229, 184, 66, 0.25);
}

.pill-btn.pill-color:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(229, 184, 66, 0.35);
}

.pill-btn.pill-print {
  background: rgba(0, 0, 0, 0.06);
  color: #334155;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.pill-btn.pill-print:hover {
  background: rgba(0, 0, 0, 0.12);
  color: #0F172A;
}

.book-page-number-display-right {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748B;
  letter-spacing: 0.05em;
}
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.page-hover-overlay span {
  background: var(--gold-gradient);
  color: #0F172A;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.book-page-right:hover .page-hover-overlay {
  opacity: 1;
}

/* --- READER BOTTOM CONTROL BAR --- */

.reader-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.reader-control-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.reader-control-btn:hover {
  background: var(--gold-primary);
  color: #0F172A;
}

.page-indicator-text {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold-light);
  min-width: 110px;
  text-align: center;
}

/* --- GALLERY VIEW & FILTER BAR --- */

.gallery-view-wrapper {
  padding: 24px 32px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Covers Hero Banner */
.gallery-covers-hero {
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  gap: 30px;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 30px;
  align-items: center;
  box-shadow: var(--shadow-lux);
}

.cover-card {
  position: relative;
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--gold-primary);
}

.cover-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 18px 40px rgba(229, 184, 66, 0.25);
}

.cover-card img {
  width: 100%;
  display: block;
}

.cover-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.9);
  color: var(--gold-light);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  padding: 6px;
  text-transform: uppercase;
}

.cover-info-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-badge {
  align-self: flex-start;
  background: var(--gold-gradient);
  color: #0F172A;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cover-info-hero h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--text-main);
}

.cover-info-hero p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

/* Filters Bar */
.gallery-filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
}

.filter-group-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Cards Flow Grid */
.mandala-cards-flow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.mandala-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.mandala-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(229, 184, 66, 0.1);
}

.card-thumb-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #FFFFFF;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  padding: 8px;
}

.card-thumb-wrapper svg {
  width: 100%;
  height: 100%;
}

.card-hover-tag {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  font-weight: 700;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.card-thumb-wrapper:hover .card-hover-tag {
  opacity: 1;
}

.colored-indicator-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent-teal);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-page-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-primary);
  text-transform: uppercase;
}

.card-difficulty {
  color: var(--gold-light);
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

.card-title:hover {
  color: var(--gold-light);
}

.card-chapter {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-footer-btns {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.card-action-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.card-action-btn.primary {
  background: var(--gold-gradient);
  color: #0F172A;
  border: none;
}

.card-action-btn:hover {
  opacity: 0.9;
}

@media (max-width: 900px) {
  .book-spread {
    grid-template-columns: 1fr;
  }
  .book-page-left {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .book-page-right {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
  .book-spread::after {
    display: none;
  }
  .gallery-covers-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .cover-card {
    max-width: 240px;
    margin: 0 auto;
  }
}
