.story-page {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  line-height: 1.6;
}

.chapter-selector-container {
  position: sticky;
  top: 0px !important;
  z-index: 100;
  background: white;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  transition: top 0.2s ease;
  width: 100%;
}
.chapter-selector-container .chapter-selector {
  position: relative;
  width: 100%;
}
.chapter-selector-container .selector-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.2s ease;
  gap: 30px;
}
.chapter-selector-container .selector-header:hover {
  background: #f8f9fa;
}
.chapter-selector-container .story-info {
  display: flex;
  align-items: center;
  gap: 15px;
}
.chapter-selector-container .story-info .story-cover {
  width: 60px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}
.chapter-selector-container .story-info .story-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chapter-selector-container .story-info .story-details h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 5px 0;
  color: #2c3e50;
  line-height: 1.4;
}
.chapter-selector-container .story-info .story-details .author {
  font-size: 14px;
  color: #6c757d;
  margin: 0;
}
.chapter-selector-container .current-chapter {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 500;
  color: #ff6b35;
  width: fit-content;
}
.chapter-selector-container .current-chapter .dropdown-arrow {
  transition: transform 0.2s ease;
}
.chapter-selector-container .current-chapter .dropdown-arrow img {
  width: 50px;
  height: 50px;
  transform: rotate(90deg);
  transition: transform 0.2s ease;
  filter: brightness(0.5) invert(0.5);
}
.chapter-selector-container .progress-container {
  width: 100%;
  height: 4px;
  background-color: #e9ecef;
  position: relative;
}
.chapter-selector-container .progress-container .progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #343434, #737373);
  width: 0%;
  transition: width 0.1s ease;
}
.chapter-selector-container .chapter-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 0 0 12px 12px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  z-index: 110;
  width: 460px;
  margin-left: 20px;
}
.chapter-selector-container .chapter-dropdown.active {
  max-height: 400px;
  overflow-y: auto;
}
.chapter-selector-container .chapter-dropdown .chapter-list {
  padding: 10px 0;
}
.chapter-selector-container .chapter-dropdown .chapter-list .chapter-item {
  display: block;
  padding: 12px 20px;
  text-decoration: none;
  color: #495057;
  transition: all 0.2s ease;
  border-left: 4px solid transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.chapter-selector-container .chapter-dropdown .chapter-list .chapter-item:hover {
  background-color: #f8f9fa;
  color: #ff6b35;
}
.chapter-selector-container .chapter-dropdown .chapter-list .chapter-item.active {
  background-color: #fff5f2;
  color: #ff6b35;
  border-left-color: #ff6b35;
}

.chapter-header {
  max-width: 1200px;
  margin: 0 auto 20px auto;
  padding: 0 20px;
}

.content-layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  padding: 0 20px;
}

.left-column {
  position: sticky;
  top: 200px !important;
  height: fit-content;
  transition: top 0.2s ease;
}
.left-column .author-section {
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}
.left-column .author-section .author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.left-column .author-section .author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.left-column .author-section .author-info h3 {
  margin: 0 0 5px 0;
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
}
.left-column .author-section .author-info span {
  font-size: 14px;
  color: #6c757d;
  display: block;
  margin-bottom: 15px;
}
.left-column .author-section .follow-btn {
  background: #ff6b35;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  width: 100%;
}
.left-column .author-section .follow-btn:hover {
  background: #e55a2b;
}
.left-column .social-media-section {
  padding: 20px;
}
.left-column .social-media-section h4 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  text-align: center;
}
.left-column .social-media-section .social-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.left-column .social-media-section .social-buttons .social-btn {
  width: 100%;
  height: 45px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s ease;
}
.left-column .social-media-section .social-buttons .social-btn:first-child img {
  width: 60px !important;
  height: 60px !important;
}
.left-column .social-media-section .social-buttons .social-btn img,
.left-column .social-media-section .social-buttons .social-btn svg {
  width: 50px !important;
  height: 50px !important;
  transition: filter 0.2s ease;
}

.chapter-header {
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}
.chapter-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #2c3e50;
  margin: 48px 30px 24px;
}
.chapter-header .chapter-stats {
  display: flex;
  gap: 20px;
  align-items: center;
}
.chapter-header .chapter-stats span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #6c757d;
}
.chapter-header .chapter-stats span img {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.right-column {
  padding: 30px;
  width: 100%;
}
.right-column .chapter-content {
  font-size: 16px;
  line-height: 1.8;
  color: #2c3e50;
  margin-bottom: 40px;
}
.right-column .chapter-content .paragraph-container {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  padding: 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
}
.right-column .chapter-content .paragraph-container:hover {
  background: #f8f9fa;
}
.right-column .chapter-content .paragraph-container.hovered {
  background: #fff5f2;
}
.right-column .chapter-content .paragraph-container p {
  margin: 0;
  text-align: justify;
  flex: 1;
}
.right-column .chapter-content .paragraph-container .paragraph-comments {
  flex-shrink: 0;
  margin-left: 10px;
  margin-top: 5px;
  display: flex;
  align-items: end;
}
.right-column .chapter-content .paragraph-container .paragraph-comments .paragraph-comment-toggle {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  color: #6c757d;
}
.right-column .chapter-content .paragraph-container .paragraph-comments .paragraph-comment-toggle:hover {
  background: #ff6b35;
  border-color: #ff6b35;
  color: white;
}
.right-column .chapter-content .paragraph-container .paragraph-comments .paragraph-comment-toggle:hover img {
  filter: brightness(0) invert(1);
}
.right-column .chapter-content .paragraph-container .paragraph-comments .paragraph-comment-toggle img {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  transition: filter 0.2s ease;
}
.right-column .chapter-content .paragraph-container .paragraph-comments .paragraph-comment-toggle .comment-count {
  font-weight: 600;
  font-size: 11px;
}
.right-column .chapter-navigation-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 30px;
  border-top: 1px solid #e9ecef;
}
.right-column .chapter-navigation-bottom .nav-btn {
  flex: 1;
  padding: 12px 24px;
  border: 2px solid #ff6b35;
  background: white;
  color: #ff6b35;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.right-column .chapter-navigation-bottom .nav-btn:hover {
  background: #ff6b35;
  color: white;
}

.sidebar-right {
  position: fixed;
  top: 0;
  right: -500px;
  width: 480px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 99999;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}
.sidebar-right.active {
  right: 0;
}
.sidebar-right .comments-header {
  padding: 20px 25px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  flex-shrink: 0;
  position: relative;
  z-index: 310;
}
.sidebar-right .comments-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #2c3e50;
}
.sidebar-right .comments-header .close-comments {
  background: none;
  border: none;
  font-size: 28px;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}
.sidebar-right .comments-header .close-comments:hover {
  background: #f8f9fa;
  color: #2c3e50;
}
.sidebar-right .comments-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.sidebar-right .comments-scrollable {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-right .paragraph-text {
  padding: 25px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
}
.sidebar-right .paragraph-text p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #2c3e50;
  text-align: justify;
}
.sidebar-right .comment-form {
  position: sticky;
  top: 0;
  padding: 20px;
  background: white;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
  z-index: 5;
}
.sidebar-right .comment-form .comment-input-container {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.sidebar-right .comment-form .comment-input-container textarea {
  flex: 1;
  height: 50px;
  padding: 12px 45px 12px 15px;
  border: 2px solid #222;
  border-radius: 25px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  background: white;
  transition: all 0.2s ease;
  overflow: hidden;
  line-height: 1.4;
}
.sidebar-right .comment-form .comment-input-container textarea:focus {
  outline: none;
  border-color: #222;
  box-shadow: 0 0 0 3px rgba(34, 34, 34, 0.1);
}
.sidebar-right .comment-form .comment-input-container textarea::placeholder {
  color: #9ca3af;
}
.sidebar-right .comment-form .comment-input-container textarea.error {
  border-color: #ff8282;
  background-color: #fffafa;
}
.sidebar-right .comment-form .comment-input-container div.error {
  display: none !important;
}
.sidebar-right .comment-form .comment-input-container .submit-comment {
  background: #222;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.sidebar-right .comment-form .comment-input-container .submit-comment:hover {
  background: #222;
  transform: scale(1.05);
}
.sidebar-right .comment-form .comment-input-container .submit-comment:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  transform: none;
}
.sidebar-right .comment-form .comment-input-container .submit-comment svg,
.sidebar-right .comment-form .comment-input-container .submit-comment img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}
.sidebar-right .comments-list {
  flex: 1;
  padding: 0;
}
.sidebar-right .comments-list .comment {
  display: flex;
  gap: 15px;
  padding: 20px 25px;
  border-bottom: 1px solid #f1f3f4;
  transition: background 0.2s ease;
}
.sidebar-right .comments-list .comment.admin-comment {
  background-color: rgba(0, 0, 0, 0.05);
  position: relative;
}
.sidebar-right .comments-list .comment.admin-comment .comment-avatar i {
  display: block;
  position: absolute;
  width: 24px;
  left: 10px;
  top: 10px;
}
.sidebar-right .comments-list .comment.admin-comment .comment-avatar i img {
  display: block;
  width: 100%;
  height: 100%;
}
.sidebar-right .comments-list .comment:hover {
  background: #fafbfc;
}
.sidebar-right .comments-list .comment:last-child {
  border-bottom: none;
}
.sidebar-right .comments-list .comment .comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-right .comments-list .comment .comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-right .comments-list .comment .reply-text {
  display: block;
  padding: 5px 0 5px 20px;
  background-color: #f0f8ff;
  border-radius: 6px;
  margin-bottom: 10px;
}
.sidebar-right .comments-list .comment .reply-text.admin-comment {
  background-color: rgba(0, 0, 0, 0.05);
}
.sidebar-right .comments-list .comment .comment-content {
  flex: 1;
}
.sidebar-right .comments-list .comment .comment-content .comment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sidebar-right .comments-list .comment .comment-content .comment-header .comment-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-right .comments-list .comment .comment-content .comment-header .comment-user-info .username {
  font-weight: 600;
  font-size: 15px;
  color: #2c3e50;
}
.sidebar-right .comments-list .comment .comment-content .comment-header .comment-user-info .comment-time {
  font-size: 12px;
  color: #8e8e93;
}
.sidebar-right .comments-list .comment .comment-content .comment-header .like-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  transition: all 0.2s ease;
}
.sidebar-right .comments-list .comment .comment-content .comment-header .like-action .like-icon {
  width: 18px;
  height: 18px;
  opacity: 0.6;
  transition: all 0.2s ease;
  filter: none;
}
.sidebar-right .comments-list .comment .comment-content .comment-header .like-action .like-count {
  font-size: 12px;
  font-weight: 500;
  color: #8e8e93;
}
.sidebar-right .comments-list .comment .comment-content .comment-header .like-action:hover .like-icon {
  transform: scale(1.1);
  opacity: 1;
}
.sidebar-right .comments-list .comment .comment-content .comment-header .like-action.liked .like-icon {
  opacity: 1;
}
.sidebar-right .comments-list .comment .comment-content .comment-header .like-action.liked .like-count {
  color: #222;
}
.sidebar-right .comments-list .comment .comment-content .comment-text {
  margin: 0 0 12px 0;
  font-size: 15px;
  line-height: 1.4;
  color: #2c3e50;
}
.sidebar-right .comments-list .comment .comment-content .comment-actions {
  margin-bottom: 10px;
}
.sidebar-right .comments-list .comment .comment-content .comment-actions .reply-link {
  font-size: 13px;
  color: #5cd2f6;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}
.sidebar-right .comments-list .comment .comment-content .comment-actions .reply-link:hover {
  color: #3aa2ed;
}
.sidebar-right .comments-list .comment .comment-content .reply-form {
  margin-top: 10px;
  padding-left: 0;
}
.sidebar-right .comments-list .comment .comment-content .reply-form .comment-input-container {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.sidebar-right .comments-list .comment .comment-content .reply-form .comment-input-container textarea {
  flex: 1;
  height: 50px;
  padding: 12px 45px 12px 15px;
  border: 2px solid #222;
  border-radius: 25px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  background: white;
  transition: all 0.2s ease;
  overflow: hidden;
  line-height: 1.4;
}
.sidebar-right .comments-list .comment .comment-content .reply-form .comment-input-container textarea:focus {
  outline: none;
  border-color: #222;
  box-shadow: 0 0 0 3px rgba(34, 34, 34, 0.1);
}
.sidebar-right .comments-list .comment .comment-content .reply-form .comment-input-container textarea::placeholder {
  color: #9ca3af;
}
.sidebar-right .comments-list .comment .comment-content .reply-form .comment-input-container .submit-reply {
  background: #222;
  color: white;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.sidebar-right .comments-list .comment .comment-content .reply-form .comment-input-container .submit-reply:hover {
  background: #2f2f2f;
  transform: scale(1.05);
}
.sidebar-right .comments-list .comment .comment-content .reply-form .comment-input-container .submit-reply img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}
.sidebar-right .comments-list .comment .comment-content .comment-actions {
  margin-bottom: 10px;
}
.sidebar-right .comments-list .comment .comment-content .comment-actions .reply-link {
  font-size: 13px;
  color: #5cd2f6;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}
.sidebar-right .comments-list .comment .comment-content .comment-actions .reply-link:hover {
  color: #3aa2ed;
}

body.comments-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  left: 0;
}
body.comments-open .chapter-selector-container {
  padding-right: var(--scrollbar-width, 0px);
  top: 0px !important;
}
body.comments-open::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99999;
}

@media (max-width: 1024px) {
  .content-layout {
    gap: 20px;
  }
  .left-column {
    top: 180px !important;
  }
}
@media (max-width: 768px) {
  .chapter-selector-container {
    top: 0px !important;
  }
  .chapter-selector-container .selector-header {
    padding: 15px;
  }
  .chapter-selector-container .story-details h2 {
    font-size: 16px;
  }
  .chapter-selector-container .current-chapter {
    font-size: 14px;
  }
  .chapter-header {
    padding: 20px 15px;
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  .chapter-header h1 {
    font-size: 24px;
  }
  .chapter-header .chapter-stats {
    gap: 15px;
  }
  .content-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 15px;
  }
  .left-column {
    position: static;
    order: 2;
  }
  .left-column .social-buttons {
    grid-template-columns: repeat(3, 1fr);
  }
  .right-column {
    order: 1;
    padding: 20px;
    width: 100%;
  }
  .right-column .paragraph-container {
    flex-direction: column;
    gap: 10px;
  }
  .right-column .paragraph-container .paragraph-comments {
    align-self: flex-end;
    margin-top: -5px;
    margin-left: 0;
  }
  .right-column .paragraph-container .paragraph-comments .paragraph-comment-toggle {
    padding: 4px 8px;
    font-size: 11px;
  }
  .right-column .paragraph-container .paragraph-comments .paragraph-comment-toggle img {
    width: 12px;
    height: 12px;
  }
  .right-column .paragraph-container .paragraph-comments .paragraph-comment-toggle .comment-count {
    font-size: 10px;
  }
  .right-column .chapter-navigation-bottom {
    flex-direction: column;
  }
  .sidebar-right {
    width: 100%;
    right: -100%;
  }
  .sidebar-right.active {
    right: 0;
  }
  .sidebar-right .paragraph-text {
    padding: 20px;
  }
  .sidebar-right .paragraph-text p {
    font-size: 15px;
  }
  .sidebar-right .comment-form {
    padding: 20px;
  }
  .sidebar-right .comments-list .comment {
    padding: 15px 20px;
  }
}
.chapter-dropdown::-webkit-scrollbar,
.comments-scrollable::-webkit-scrollbar {
  width: 6px;
}

.chapter-dropdown::-webkit-scrollbar-track,
.comments-scrollable::-webkit-scrollbar-track {
  background: #f8f9fa;
}

.chapter-dropdown::-webkit-scrollbar-thumb,
.comments-scrollable::-webkit-scrollbar-thumb {
  background: #dee2e6;
  border-radius: 3px;
}
.chapter-dropdown::-webkit-scrollbar-thumb:hover,
.comments-scrollable::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}