/**
 * LYVRE V3 - Page Détail Histoire
 * 
 * Styles pour la page de détail d'une histoire
 */

/* ==========================================================================
   HEADER HISTOIRE
   ========================================================================== */

.story-detail {
  min-height: 100vh;
}

.story-header {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-8);
  padding: var(--space-12) 0;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

@media (max-width: 768px) {
  .story-header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-6);
  }
}

/* Couverture */
.story-cover-wrapper {
  position: relative;
}

.story-cover {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 2px solid var(--border);
}

@media (max-width: 768px) {
  .story-cover {
    max-width: 200px;
    margin: 0 auto;
  }
}

/* Infos histoire */
.story-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Badges */
.story-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

@media (max-width: 768px) {
  .story-badges {
    justify-content: center;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: white;
  background: var(--muted);
}

.badge i {
  font-size: 0.75rem;
}

.badge-premium {
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  color: var(--primary);
}

.badge-complete {
  background: var(--success);
}

/* Titre */
.story-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--foreground);
  margin: 0;
}

@media (max-width: 768px) {
  .story-title {
    font-size: var(--text-2xl);
  }
}

/* Auteur */
.story-author {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--card);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all var(--transition-fast);
  width: fit-content;
}

@media (max-width: 768px) {
  .story-author {
    margin: 0 auto;
  }
}

.story-author:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.author-name {
  font-weight: var(--font-medium);
  color: var(--foreground);
}

.premium-icon {
  color: var(--accent);
  font-size: 0.875rem;
}

/* Statistiques */
.story-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .story-stats {
    justify-content: center;
    gap: var(--space-4);
  }
}

.story-stats .stat {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

.story-stats .stat i {
  color: var(--accent);
}

/* Actions */
.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

@media (max-width: 768px) {
  .story-actions {
    justify-content: center;
  }
}

/* ==========================================================================
   SYNOPSIS
   ========================================================================== */

.story-synopsis {
  padding: var(--space-12) 0;
  background: var(--background-alt);
}

.story-synopsis h2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-4);
  color: var(--foreground);
}

.story-synopsis p {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--muted-foreground);
  max-width: 800px;
}

/* ==========================================================================
   CHAPITRES
   ========================================================================== */

.story-chapters {
  padding: var(--space-12) 0;
}

.story-chapters h2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-6);
  color: var(--foreground);
}

.chapters-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.chapter-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.chapter-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.chapter-item.is-premium {
  opacity: 0.7;
}

.chapter-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--muted);
  color: var(--accent);
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.chapter-info {
  flex: 1;
  min-width: 0;
}

.chapter-title {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--foreground);
  margin: 0 0 var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-meta {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.chapter-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.chapter-arrow,
.premium-lock {
  color: var(--muted-foreground);
  transition: transform var(--transition-fast);
}

.chapter-item:hover .chapter-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

.premium-lock {
  color: var(--accent);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-12);
  color: var(--muted-foreground);
  font-style: italic;
}

/* ==========================================================================
   HISTOIRES SIMILAIRES
   ========================================================================== */

.similar-stories {
  padding: var(--space-12) 0;
  background: var(--background-alt);
}

.similar-stories h2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-6);
  color: var(--foreground);
}

.stories-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

/* ==========================================================================
   BARRE DE PROGRESSION DE LECTURE
   ========================================================================== */

.reading-progress-bar {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: var(--background-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}

.progress-label {
  color: var(--muted-foreground);
}

.progress-value {
  color: var(--foreground);
  font-weight: var(--font-medium);
}

.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 999px;
  transition: width 0.5s ease-out;
  min-width: 4px;
}

@media (max-width: 768px) {
  .reading-progress-bar {
    margin-top: var(--space-4);
  }
}

/* Barre de progression dans la liste des chapitres */
.chapter-item.is-read {
  opacity: 0.7;
}

.chapter-item.is-read .chapter-number {
  background: var(--success);
  color: white;
}

.chapter-item.is-read .chapter-number::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.75em;
}

.chapter-item.is-current {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
}

.chapter-item.is-current .chapter-number {
  background: var(--accent);
  color: var(--accent-foreground);
}

