/* table-of-contents.css */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
 
:root {
  --red:       #E63946;
  --offwhite:  #f8f6f2;
  --white:     #ffffff;
  --text:      #1c1c1c;
  --muted:     #888;
  --border:    #e2ddd7;
  --avatar-bg: #d4c9e8;
 
  /* chapter row background colors */
  --row-read:   #fde8e8;  /* light red  — user has read this chapter */
  --row-unread: #f0f0f0;  /* light gray — not yet started/ regular */
  --row-new:    #e8f5e9;  /* light green — newest chapter uploaded by author */
}
 
body {
  min-height: 100vh;
}
 
.page-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}
 
.book-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 20px;
}
 
.author-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
 
.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--avatar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
 
.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
 
.author-meta,
.year-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
 
.year-meta {
  margin-left: 32px;
}
 
.author-label {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
 
.author-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
 
/* status tags (complete, ongoing, etc) */
.status-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
 
.status-tag {
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 14px;
  font-weight: 600;
}
 
.tag-completed { background: #2d6a4f; color: #fff; }
.tag-ongoing   { background: #457b9d; color: #fff; }
.tag-mature    { background: #6b4c4c; color: #fff; }
.tag-new-part  { background: transparent; color: var(--red); border: 1.5px solid var(--red); }
 
/* table of contents */
.toc-card {
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  padding: 28px 28px 20px;
}
 
.toc-heading {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
  color: var(--text);
}
 
/* list of chapters */
.chapter-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
 
.loading-msg {
  color: var(--muted);
  font-style: italic;
  font-size: 15px;
  padding: 8px 0;
}
 
/* --chapter rows-- */
.chapter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.15s;
}
 
.chapter-row:hover {
  filter: brightness(0.95);
}
 
/* row color states set by JS via className */
.chapter-row.state-read   { background: var(--row-read); }
.chapter-row.state-unread { background: var(--row-unread); }
.chapter-row.state-new    { background: var(--row-new); }
 
.chapter-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
 
/* icon for chapter */
.chapter-icon {
  font-size: 0.85rem;
  width: 16px;
  flex-shrink: 0;
}
 
.icon-read   { color: #c0392b; }
.icon-new    { color: #2d6a4f; }
.icon-unread { color: transparent; }
 
.chapter-title-text {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}
 
/* read percentage */
.chapter-progress {
  font-size: 0.78rem;
  font-weight: 600;
  color: #c0392b;
  margin-left: 6px;
}
 
.chapter-row.state-unread .chapter-progress { color: var(--muted); }
.chapter-row.state-new    .chapter-progress { color: #2d6a4f; }