/* Noveler-inspired design - dark theme with warm accents */
:root {
  --bg-dark: #0f0e14;
  --bg-card: #16151d;
  --bg-elevated: #1c1b24;
  --text: #e8e6e3;
  --text-muted: #9a9691;
  --accent: #c9a227;
  --accent-hover: #e0b83d;
  --accent-soft: rgba(201, 162, 39, 0.15);
  --border: #2a2835;
  --status-ongoing: #4ade80;
  --status-completed: #60a5fa;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo:hover {
  color: var(--accent-hover);
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--accent);
}

.search-form {
  display: flex;
  margin-left: auto;
  gap: 0.5rem;
}

.search-form input {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
  width: 200px;
}

.search-form input::placeholder {
  color: var(--text-muted);
}

.search-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-form button {
  padding: 0.5rem 1rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: var(--bg-dark);
  cursor: pointer;
  font-size: 1rem;
}

.search-form button:hover {
  background: var(--accent-hover);
}

/* Main */
.main {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* Section headings */
.section {
  margin-bottom: 3rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.section-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
}

.section-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Novel cards - grid */
.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
}

.novel-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.novel-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.novel-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.novel-card-cover {
  aspect-ratio: 2/3;
  background: var(--bg-elevated);
  overflow: hidden;
}

.novel-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.novel-card-cover .no-cover {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2rem;
}

.novel-card-body {
  padding: 0.75rem 1rem;
}

.novel-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.novel-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.novel-card-meta span {
  margin-right: 0.5rem;
}

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-ongoing {
  background: rgba(74, 222, 128, 0.2);
  color: var(--status-ongoing);
}

.status-completed {
  background: rgba(96, 165, 250, 0.2);
  color: var(--status-completed);
}

/* Trending list - horizontal scroll on mobile */
.trending-list {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
}

.trending-list::-webkit-scrollbar {
  height: 6px;
}

.trending-list::-webkit-scrollbar-track {
  background: var(--bg-elevated);
  border-radius: 3px;
}

.trending-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.trending-item {
  flex: 0 0 140px;
  scroll-snap-align: start;
}

/* Ranking list */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.rank-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
  min-width: 2rem;
  text-align: center;
}

.rank-item a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.rank-item a:hover {
  color: var(--accent);
}

.rank-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Two-column layout for rankings */
.rankings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

/* Genres */
.genres-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.genre-tag {
  padding: 0.4rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.genre-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero / Welcome */
.hero {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 3rem;
}

.hero h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0 0 1rem;
  color: var(--text);
}

.hero p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 1.5rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat strong {
  display: block;
  font-size: 1.5rem;
  color: var(--accent);
}

.hero-stat span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Novel detail page */
.novel-detail {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 640px) {
  .novel-detail {
    grid-template-columns: 1fr;
  }
}

.novel-detail-cover {
  aspect-ratio: 2/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
}

.novel-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.novel-detail-info h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
}

.novel-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.novel-detail-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.chapters-list {
  margin-top: 2rem;
}

.chapters-list-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

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

.chapter-link {
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.chapter-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* FAQ section */
.faq-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.faq-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item summary:hover,
.faq-item summary:focus {
  color: var(--accent);
  outline: none;
}

.faq-item p {
  margin: 0;
  padding: 0 1rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Chapter reading */
.chapter-reader {
  max-width: 720px;
  margin: 0 auto;
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

.chapter-nav a {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}

.chapter-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chapter-nav .disabled {
  opacity: 0.5;
  pointer-events: none;
}

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

.chapter-content p {
  margin-bottom: 1.25rem;
}

.chapter-content p:last-child {
  margin-bottom: 0;
}

/* Browse pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination a, .pagination span {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination .current {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Footer - higher contrast for accessibility (WCAG AA) */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.footer p {
  color: #c4c0b8;
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

.footer-copy {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #b8b4ae;
}

/* Search page */
.search-box {
  margin-bottom: 2rem;
}

.search-box input {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Browse filters */
.browse-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.browse-filters a {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
}

.browse-filters a:hover, .browse-filters a.active {
  border-color: var(--accent);
  color: var(--accent);
}
