:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --bg-color: #f9fafb;
  --surface-color: #ffffff;
  --text-color: #111827;
  --text-color-secondary: #6b7280;
  --border-color: #e5e7eb;
  --font-main: "Vazirmatn", sans-serif;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --success-color: #10b981;
  --danger-color: #ef4444;
}

body.single-novel #page,
body.single-novel #content,
body.single-novel .site-content,
body.single-novel .ast-container,
body.single-novel .entry-content {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.single-novel article.nvl-novel-article {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  width: 100% !important;
}

.nvl-wrapper {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.7;
  padding: 2rem 0;
  direction: rtl;
  width: 100%;
  min-height: 100vh;
}

.nvl-container {
  max-width: 1400px;
  width: 95%;
  margin: 0 auto;
  padding: 0;
}

.nvl-wrapper * {
  box-sizing: border-box;
}

a {
  text-decoration: none;
}

.nvl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.2s ease-in-out;
}
.nvl-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  color: white;
}
.nvl-btn.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}
.nvl-btn.btn-secondary:hover {
  background-color: var(--primary-color);
  color: white;
}
.nvl-btn.liked {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
  color: white;
}

.nvl-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  color: white;
}
.nvl-badge.ongoing {
  background-color: #3b82f6;
}
.nvl-badge.completed {
  background-color: #8b5cf6;
}
.nvl-badge.cancelled {
  background-color: #ef4444;
}

.hero-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  background-color: var(--surface-color);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  width: 100%;
}

.hero-header {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-cover {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
  align-self: center;
}

.hero-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-color);
  margin: 0;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.hero-subtitle {
  font-family: sans-serif;
  color: var(--text-color-secondary);
  font-size: 1.1rem;
  margin: 0;
  font-weight: 400;
  overflow-wrap: break-word;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 0.5rem;
}

.genre-tags a {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9rem;
  background: #eef2ff;
  padding: 4px 12px;
  border-radius: 20px;
  transition: 0.2s;
}
.genre-tags a:hover {
  background: var(--primary-color);
  color: white;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin: 1.5rem 0;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-color-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}
.stat-item i {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.synopsis {
  line-height: 1.8;
  color: var(--text-color-secondary);
  font-size: 1rem;
  text-align: justify;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: auto;
}

.main-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

.content-area {
  flex-grow: 1;
  width: 100%;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.widget {
  background-color: var(--surface-color);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
}
.widget h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}
.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.widget ul li {
  padding: 0.8rem 0;
  border-bottom: 1px dashed var(--border-color);
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}
.widget ul li:last-child {
  border-bottom: none;
}

.cta-widget {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-hover)
  );
  color: white;
  text-align: center;
}
.cta-widget h3 {
  color: white;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}
.cta-widget p {
  opacity: 0.9;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.cta-widget .nvl-btn {
  background-color: white;
  color: var(--primary-color);
  width: 100%;
}

.tabs-nav {
  display: flex;
  list-style: none;
  border-bottom: 2px solid var(--border-color);
  gap: 2rem;
  margin: 0 0 2rem 0;
  padding: 0;
  overflow-x: auto;
  white-space: nowrap;
}
.tabs-nav li a {
  display: block;
  padding: 0.8rem 0.5rem;
  text-decoration: none;
  color: var(--text-color-secondary);
  font-weight: 600;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  font-size: 1.05rem;
}
.tabs-nav li a.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}
.tab-pane {
  display: none;
  animation: fadeIn 0.4s;
}
.tab-pane.active {
  display: block;
}

.volume-container {
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--surface-color);
}
.volume-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background-color: #f3f4f6;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-color);
  transition: background-color 0.2s;
}
.volume-header:hover {
  background-color: #e5e7eb;
}
.volume-header .chevron-icon {
  transition: transform 0.3s ease;
}
.volume-container.expanded .chevron-icon {
  transform: rotate(180deg);
}

.volume-chapters {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
  background-color: var(--surface-color);
  margin: 0;
  padding: 0;
}
.volume-container.expanded .volume-chapters {
  max-height: 3000px;
  transition: max-height 0.6s ease-in;
}

.volume-chapters li {
  border-top: 1px solid var(--border-color);
}
.volume-chapters li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  color: var(--text-color);
  text-decoration: none;
  transition: 0.2s;
  font-size: 0.95rem;
}
.volume-chapters li a:hover {
  background-color: #f9fafb;
  color: var(--primary-color);
}
.chapter-date {
  font-size: 0.85rem;
  color: #9ca3af;
}

.nvl-comments-area {
  margin-top: 1rem;
}

.nvl-comments-notice {
  background-color: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  padding: 1rem;
  border-radius: 0.75rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  line-height: 1.6;
}
.nvl-comments-notice i {
  font-size: 1.2rem;
  margin-top: 3px;
}

.comments-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment-list li.comment {
  margin-bottom: 1.5rem;
}

.comment-body {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.comment-body:hover {
  box-shadow: var(--shadow-md);
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 0.75rem;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-style: normal;
}

.comment-author img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eef2ff;
}

.comment-author .fn {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-color);
}
.comment-author .fn a {
  color: inherit;
  text-decoration: none;
}

.comment-metadata {
  font-size: 0.8rem;
  color: var(--text-color-secondary);
}
.comment-metadata a {
  color: inherit;
  text-decoration: none;
}

.comment-content {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #374151;
  margin-bottom: 1rem;
}
.comment-content p {
  margin-bottom: 0.5rem;
}

.nvl-comment-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.comment-reply-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
  background-color: #eef2ff;
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
}
.comment-reply-link:hover {
  background-color: var(--primary-color);
  color: white;
}

.nvl-comment-actions {
  display: flex;
  gap: 0.5rem;
}

.nvl-vote-button {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-color-secondary);
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  transition: all 0.2s;
  background: #fff;
}
.nvl-vote-button:hover {
  border-color: var(--text-color-secondary);
  background-color: #f9fafb;
}
.nvl-vote-button.active {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background-color: #eef2ff;
}
.nvl-vote-button.dislike.active {
  color: var(--danger-color);
  border-color: var(--danger-color);
  background-color: #fef2f2;
}

.comment-list .children {
  list-style: none;
  padding-right: 2rem;
  margin-top: 1.5rem;
  border-right: 2px solid var(--border-color);
}
@media (max-width: 600px) {
  .comment-list .children {
    padding-right: 1rem;
  }
}

.comment-respond {
  background-color: var(--surface-color);
  padding: 2rem;
  border-radius: 1rem;
  margin-top: 3rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.comment-reply-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: block;
}
.comment-reply-title small a {
  color: var(--danger-color);
  font-size: 0.85rem;
  font-weight: normal;
  margin-right: 1rem;
}

.comment-form p {
  margin-bottom: 1rem;
}

.comment-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background-color: var(--bg-color);
}
.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  background-color: #fff;
}

.comment-form .submit {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 0.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 1rem;
}
.comment-form .submit:hover {
  background-color: var(--primary-hover);
}

.nvl-login-prompt {
  text-align: center;
  padding: 2rem;
  background-color: #f3f4f6;
  border-radius: 0.75rem;
  color: #4b5563;
}
.nvl-login-prompt a {
  color: var(--primary-color);
  font-weight: 700;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.5rem;
}
.related-item a {
  text-decoration: none;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.related-item img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}
.related-item:hover img {
  transform: translateY(-5px);
}
.related-title {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  margin: 0;
}

@media (min-width: 900px) {
  .hero-header {
    flex-direction: row;
    align-items: flex-start;
  }
  .hero-cover {
    align-self: flex-start;
  }
  .main-content-wrapper {
    flex-direction: row;
    align-items: flex-start;
  }
  .content-area {
    flex: 1;
  }
  .sidebar {
    width: 320px;
    flex-shrink: 0;
  }
  .action-buttons {
    flex-direction: row;
    width: fit-content;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
