/**
 * Book Detail Page Styling
 * Individual book pages with progress tracking integration
 */

:root {
  --book-primary: #ff6b35;
  --book-secondary: #00bcd4;
  --book-accent: #4caf50;
  --book-dark: #0a0a0a;
  --book-dark-light: #1a1a1a;
  --book-text: #e0e0e0;
  --book-text-muted: #a0a0a0;
}

/* Breadcrumb */
.breadcrumb {
  padding: 1rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
}

.breadcrumb a {
  color: var(--book-text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb a:hover {
  color: var(--book-primary);
}

.breadcrumb-separator {
  color: var(--book-text-muted);
  opacity: 0.5;
}

.breadcrumb-current {
  color: var(--book-primary);
  font-weight: 600;
}

/* Book Hero Section */
.book-hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--book-dark) 0%, #151525 50%, #1a1a2e 100%);
  overflow: hidden;
}

.book-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 70%, rgba(255, 107, 53, 0.1) 0%, transparent 50%);
}

.book-hero .hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.book-hero .hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1400px;
  padding: 3rem 2rem;
}

.book-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 4rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

/* Book Cover */
.book-cover-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.book-cover {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, var(--book-primary), var(--book-secondary));
  border-radius: 8px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(255, 107, 53, 0.2);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 1000px;
  animation: float 6s ease-in-out infinite;
}

.book-cover::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  pointer-events: none;
}

.book-cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-family: 'Cinzel', serif;
}

.book-cover-fallback .book-series {
  font-size: 0.875rem;
  letter-spacing: 3px;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.book-cover-fallback .book-number {
  font-size: 1rem;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
}

.book-cover-fallback .book-title-small {
  font-size: 1.5rem;
  line-height: 1.3;
  letter-spacing: 2px;
}

.book-badge {
  margin-top: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Book Info */
.book-info {
  padding: 1rem 0;
}

.book-series-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.875rem;
  color: var(--book-secondary);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 0.5rem;
}

.book-info h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  color: #fff;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.book-strapline {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--book-text-muted);
  margin-bottom: 2rem;
  font-weight: 300;
}

.book-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.book-metadata .meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.925rem;
  color: var(--book-text-muted);
}

.book-metadata .meta-icon {
  font-size: 1.25rem;
}

.book-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Main Content */
.book-content {
  background: var(--book-dark-light);
}

.content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.content-wrapper > section {
  margin-bottom: 5rem;
}

/* Section Headers */
.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.section-header .section-subtitle {
  color: var(--book-text-muted);
  font-size: 1rem;
}

/* Synopsis Section */
.synopsis-content {
  max-width: 900px;
  line-height: 1.8;
  color: var(--book-text-muted);
}

.synopsis-content .lead-text {
  font-size: 1.25rem;
  color: var(--book-text);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.synopsis-content p {
  margin-bottom: 1.5rem;
}

/* Sample Chapter Section */
.excerpt-content {
  max-width: 900px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chapter-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chapter-label {
  display: inline-block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem;
  color: var(--book-primary);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 0.5rem;
}

.chapter-header .chapter-title {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: #fff;
  margin: 0;
}

.chapter-text {
  font-size: 1.125rem;
  line-height: 1.9;
  color: var(--book-text);
}

.chapter-text p {
  margin-bottom: 1.5rem;
}

.chapter-text p:first-child::first-letter {
  font-family: 'Cinzel', serif;
  font-size: 4rem;
  float: left;
  line-height: 1;
  margin-right: 0.5rem;
  color: var(--book-primary);
}

.excerpt-actions {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.excerpt-note {
  flex: 1;
  font-size: 0.875rem;
  color: var(--book-text-muted);
}

.excerpt-note .unlock-icon {
  margin-right: 0.5rem;
}

.excerpt-note .track-link {
  color: var(--book-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.excerpt-note .track-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* Progress Tracker Section */
.progress-tracker {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-info p {
  margin-bottom: 1rem;
  color: var(--book-text-muted);
}

.unlockables-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

.unlockables-list li {
  font-size: 0.875rem;
  color: var(--book-text-muted);
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

/* Book Details Section */
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

.detail-item strong {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--book-text-muted);
}

.detail-item span {
  font-size: 1rem;
  color: var(--book-text);
}

/* Series Navigation */
.series-books-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.series-book-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.series-book-item:hover {
  border-color: var(--book-secondary);
  transform: translateY(-3px);
}

.series-book-item.active {
  border-color: var(--book-primary);
  background: rgba(255, 107, 53, 0.05);
}

.series-book-item .book-number {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--book-text-muted);
  margin-bottom: 0.5rem;
}

.series-book-item .book-title-small {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--book-text);
  margin-bottom: 1rem;
}

.series-book-item .book-mini-cover {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, var(--book-primary), var(--book-secondary));
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.series-book-item .book-status-mini {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Purchase Section */
.purchase-notice {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  background: rgba(0, 188, 212, 0.1);
  border: 1px solid rgba(0, 188, 212, 0.3);
  border-radius: 12px;
  margin-bottom: 2rem;
}

.purchase-notice .notice-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.purchase-notice .notice-content h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 1rem;
}

.purchase-notice .notice-content p {
  color: var(--book-text-muted);
  line-height: 1.6;
}

.purchase-notice a {
  color: var(--book-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.purchase-notice a:hover {
  color: #fff;
  text-decoration: underline;
}

.purchase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.purchase-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.purchase-card:hover {
  border-color: var(--book-primary);
  transform: translateY(-5px);
}

.purchase-card .retailer-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.purchase-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.purchase-card .note {
  font-size: 0.875rem;
  color: var(--book-text-muted);
}

.purchase-card:not(.placeholder-purchase) a {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--book-primary);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.3s ease;
}

.purchase-card:not(.placeholder-purchase) a:hover {
  background: #ff8555;
}

/* Responsive */
@media (max-width: 1024px) {
  .book-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  
  .book-cover-container {
    max-width: 350px;
    margin: 0 auto;
  }
  
  .book-metadata {
    justify-content: center;
  }
  
  .book-actions {
    justify-content: center;
  }
  
  .progress-tracker {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .breadcrumb {
    padding: 1rem;
  }
  
  .book-hero {
    min-height: 70vh;
  }
  
  .book-info h1 {
    font-size: 2rem;
  }
  
  .excerpt-content {
    padding: 2rem 1.5rem;
  }
  
  .excerpt-actions {
    flex-direction: column;
  }
  
  .chapter-header .chapter-title {
    font-size: 1.5rem;
  }
  
  .chapter-text {
    font-size: 1rem;
  }
  
  .content-wrapper {
    padding: 2rem 1rem;
  }
  
  .purchase-notice {
    flex-direction: column;
    text-align: center;
  }
}