/* =============================================
   VIEWS.CSS — Page-specific Styles
   ============================================= */

/* ---- DETAIL VIEW ---- */
.detail-header {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.detail-cover {
  width: 150px;
  min-width: 150px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.detail-cover img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.detail-cover .no-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: var(--surface2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

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

.detail-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.detail-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.detail-genres {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.detail-synopsis {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- CHAPTER LIST ---- */
.chapter-list-header {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.chapter-item:hover {
  border-color: var(--accent);
  background: var(--card-hover);
}

.chapter-name {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-date {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  margin-left: 0.5rem;
}

.empty-chapters {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 2rem;
  background: var(--surface2);
  border-radius: var(--radius-md);
}

/* ---- READER VIEW ---- */
.reader-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.reader-nav-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  transition: border-color 0.15s;
}

.reader-nav-btn:hover:not(:disabled) {
  border-color: var(--accent);
}

.reader-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.reader-title {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  flex: 1;
}

.reader-images {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reader-images img {
  width: 100%;
  max-width: 750px;
}

/* ---- RESPONSIVE: Detail ---- */
@media (max-width: 600px) {
  .detail-header {
    flex-direction: column;
  }

  .detail-cover {
    width: 130px;
  }

  .detail-title {
    font-size: 1.1rem;
  }
}

/* ---- SCROLL PROGRESS BAR (Reader) ---- */
#reader-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 999;
  transition: width 0.1s linear;
}

/* ---- READER: gap antar gambar ---- */
.reader-images img {
  display: block;
  margin-bottom: 2px;
}

/* ---- READER: sticky nav atas ---- */
.reader-nav-sticky {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

/* ---- DETAIL: meta rows (author, status, rating) ---- */
.detail-meta-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}
.detail-meta-row span:first-child {
  color: var(--muted);
  min-width: 60px;
}

/* ---- CARD: chapter badge ---- */
.chapter-badge {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
