/* Latest Updates Page */
.updates-page {
  padding: var(--spacing-xl) 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-lg);
}

.breadcrumb a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

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

.breadcrumb .separator {
  opacity: 0.5;
}

.page-subtitle {
  color: var(--color-text-secondary);
  margin-top: var(--spacing-xs);
  margin-bottom: var(--spacing-xl);
}

.updates-table-wrapper {
  overflow-x: auto;
}

.updates-table {
  width: 100%;
  border-collapse: collapse;
}

.updates-table th {
  text-align: left;
  padding: var(--spacing-md);
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
}

.updates-table td {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.updates-table .col-title {
  width: 30%;
}

.updates-table .col-release {
  width: 35%;
}

.updates-table .col-translator {
  width: 20%;
}

.updates-table .col-time {
  width: 15%;
  text-align: right;
}

.novel-cell {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.novel-thumb {
  width: 40px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.novel-thumb.placeholder {
  color: var(--color-text-muted);
}

.novel-name {
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.3;
}

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

.chapter-link {
  color: var(--color-text-secondary);
  text-decoration: none;
}

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

.translator-name {
  color: var(--color-accent);
  font-size: var(--font-size-sm);
}

.time-ago {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.updates-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.page-nav {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.page-nav:hover:not(:disabled) {
  background: var(--color-bg-tertiary);
  border-color: var(--color-accent);
}

.page-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-dots {
  display: flex;
  gap: var(--spacing-sm);
}

.page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-bg-tertiary);
}

.page-dot.active {
  background: var(--color-accent);
}

.updates-footer {
  text-align: right;
  margin-top: var(--spacing-lg);
}

.all-updates-link {
  color: var(--color-accent);
  text-decoration: none;
  font-size: var(--font-size-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.all-updates-link:hover {
  text-decoration: underline;
}

/* Profile Page */
.profile-page {
  padding: var(--spacing-xl) 0;
  max-width: 900px;
  margin: 0 auto;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
  padding: var(--spacing-xl);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-xl);
}

.profile-avatar-wrapper {
  position: relative;
  width: 128px;
  height: 128px;
  flex-shrink: 0;
}

.profile-avatar-wrapper .profile-avatar {
  width: 100%;
  height: 100%;
}

.profile-avatar-wrapper .avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  border: 3px solid var(--color-bg-secondary);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.profile-avatar-wrapper .avatar-edit:hover {
  background: var(--color-accent-hover);
  transform: scale(1.1);
}

.profile-avatar-wrapper .avatar-edit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.profile-avatar-wrapper .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.profile-avatar {
  position: relative;
  width: 128px;
  height: 128px;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: var(--font-size-2xl);
  margin: 0 0 var(--spacing-xs);
}

.profile-email {
  color: var(--color-text-secondary);
  margin: 0 0 var(--spacing-xs);
}

.profile-member-since {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin: 0;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  background: var(--color-bg-secondary);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  text-align: center;
}

.stat-icon {
  color: var(--color-accent);
  margin-bottom: var(--spacing-sm);
}

.stat-value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.profile-quick-links {
  margin-bottom: var(--spacing-xl);
}

.profile-quick-links h2 {
  margin-bottom: var(--spacing-lg);
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
}

.quick-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-lg);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text-primary);
  transition: all 0.2s;
}

.quick-link-card:hover {
  background: var(--color-bg-tertiary);
  transform: translateY(-2px);
}

.quick-link-card svg {
  color: var(--color-accent);
}

.profile-activity h2 {
  margin-bottom: var(--spacing-lg);
}

.activity-list {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.activity-item {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-tertiary);
  border-radius: 50%;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.activity-content p {
  margin: 0;
  line-height: 1.4;
}

.activity-content a {
  color: var(--color-accent);
  text-decoration: none;
}

.activity-content a:hover {
  text-decoration: underline;
}

.activity-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.empty-activity {
  padding: var(--spacing-xl);
  text-align: center;
  color: var(--color-text-secondary);
}

/* Settings Page */
.settings-page {
  padding: var(--spacing-xl) 0;
}

.settings-message {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  color: #10b981;
  margin-bottom: var(--spacing-xl);
}

.settings-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: var(--spacing-xl);
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.settings-nav .nav-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}

.settings-nav .nav-item:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.settings-nav .nav-item.active {
  background: var(--color-accent);
  color: white;
}

.settings-content {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  overflow: auto;
}

.settings-form h2 {
  margin: 0 0 var(--spacing-xl);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select {
  width: 100%;
  padding: var(--spacing-md);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
}

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

.form-group input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-group small {
  display: block;
  margin-top: var(--spacing-xs);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.range-input {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.range-input input[type="range"] {
  flex: 1;
  height: 4px;
  background: var(--color-bg-tertiary);
  border-radius: 2px;
  appearance: none;
}

.range-input input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--color-accent);
  border-radius: 50%;
  cursor: pointer;
}

.range-value {
  min-width: 50px;
  text-align: right;
  color: var(--color-text-secondary);
}

.theme-options {
  display: flex;
  gap: var(--spacing-md);
}

.theme-option {
  cursor: pointer;
}

.theme-option input {
  display: none;
}

.theme-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 60px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  transition: border-color 0.2s;
}

.theme-preview.dark {
  background: #1a1a2e;
  color: #eee;
}

.theme-preview.light {
  background: #f5f5f5;
  color: #333;
}

/* Added sepia theme preview style */
.theme-preview.sepia {
  background: #f4ecd8;
  color: #5c4b37;
}

.theme-option input:checked + .theme-preview {
  border-color: var(--color-accent);
}

.checkbox-group {
  margin-bottom: var(--spacing-md);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--color-bg-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s;
}

.checkbox-label:hover {
  background: var(--color-bg-tertiary);
}

.checkbox-label input {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s;
}

.checkbox-label input:checked + .checkmark {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.checkbox-label input:checked + .checkmark::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-content {
  flex: 1;
}

.checkbox-title {
  display: block;
  font-weight: 500;
  margin-bottom: var(--spacing-xs);
}

.checkbox-description {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.settings-section {
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
  border-bottom: 1px solid var(--color-border);
}

.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section h3 {
  margin: 0 0 var(--spacing-sm);
}

.settings-section > p {
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-md);
}

.danger-zone {
  border-color: rgba(239, 68, 68, 0.3);
}

.danger-zone h3 {
  color: #ef4444;
}

.danger-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
  background: rgba(239, 68, 68, 0.05);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}

.danger-action:last-child {
  margin-bottom: 0;
}

.danger-info strong {
  display: block;
  margin-bottom: var(--spacing-xs);
}

.danger-info p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid #ef4444;
  color: #ef4444;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-danger {
  background: #ef4444;
  border: none;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Scroll to Top Button - Global */
.scroll-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: var(--color-accent);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* ========================================
   INDEX PAGE - Novel Home Grid (nh- classes)
   Added missing mobile responsive styles for homepage
   ======================================== */
.nh-home-container {
  padding: var(--spacing-lg) 0;
}

.nh-novel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

@media (min-width: 480px) {
  .nh-novel-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .nh-novel-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .nh-novel-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1280px) {
  .nh-novel-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.nh-novel-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.nh-novel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.nh-card-image {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

.nh-card-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.nh-novel-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.nh-novel-card:hover .nh-novel-thumbnail {
  transform: scale(1.05);
}

.nh-novel-rating {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.75);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #fff;
}

.nh-novel-rating i {
  color: #fbbf24;
}

.nh-card-info {
  padding: var(--spacing-sm);
}

.nh-novel-title {
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0 0 var(--spacing-xs);
  line-height: 1.3;
}

.nh-novel-title a {
  color: var(--color-text-primary);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nh-novel-title a:hover {
  color: var(--color-accent);
}

.nh-novel-meta {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.nh-chapter-count {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nh-chapter-count i {
  font-size: 0.7rem;
}

/* Mobile specific fixes for nh- cards */
@media (max-width: 480px) {
  .nh-novel-grid {
    gap: var(--spacing-sm);
  }

  .nh-card-info {
    padding: var(--spacing-xs);
  }

  .nh-novel-title {
    font-size: 0.8125rem;
  }

  .nh-novel-meta {
    font-size: 0.6875rem;
  }

  .nh-novel-rating {
    font-size: 0.6875rem;
    padding: 2px 6px;
  }
}

/* ========================================
   TABS HORIZONTAL SCROLL
   Added to fix overflow issue on homepage
   ======================================== */
.tabs-scroll-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.tabs-scroll-wrapper .tabs {
  display: flex;
  gap: var(--spacing-sm);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: var(--spacing-sm);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.tabs-scroll-wrapper .tabs::-webkit-scrollbar {
  display: none;
}

.tabs-scroll-wrapper .tab {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Fade effect on edges to indicate scrollability */
.tabs-scroll-wrapper::before,
.tabs-scroll-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s;
}

.tabs-scroll-wrapper::before {
  left: 0;
  background: linear-gradient(to right, var(--color-bg-primary), transparent);
}

.tabs-scroll-wrapper::after {
  right: 0;
  background: linear-gradient(to left, var(--color-bg-primary), transparent);
}

.tabs-scroll-wrapper.scrollable-left::before,
.tabs-scroll-wrapper.scrollable-right::after {
  opacity: 1;
}

/* Mobile responsive for tabs */
@media (max-width: 768px) {
  .tabs-scroll-wrapper .tabs {
    gap: var(--spacing-xs);
  }

  .tabs-scroll-wrapper .tab {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-stats,
  .quick-links-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
  }

  .settings-nav .nav-item {
    white-space: nowrap;
  }

  .updates-table .col-translator {
    display: none;
  }
}

/* ========================================
   RECOMMENDATIONS SECTION - Because You Read
   ======================================== */
.recommendations-section {
  padding: var(--spacing-xl) 0;
  background: var(--color-bg-secondary);
}

.recommendations-section .section-header {
  margin-bottom: var(--spacing-lg);
}

.recommendations-section .section-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.recommendations-section .section-title svg {
  color: var(--color-accent);
}

.recommendations-section .section-subtitle {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-xs);
}

.recommendation-row {
  margin-bottom: var(--spacing-xl);
}

.recommendation-row:last-child {
  margin-bottom: 0;
}

.recommendation-source {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  width: fit-content;
}

.source-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.source-novel {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 500;
}

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

.source-novel img {
  width: 24px;
  height: 32px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* ========================================
   CHAPTER READER THEME STYLES
   ======================================== */
.chapter-reader[data-theme="dark"] {
  --reader-bg: var(--color-bg-primary);
  --reader-text: var(--color-text-primary);
  --reader-secondary: var(--color-text-secondary);
}

.chapter-reader[data-theme="light"] {
  --reader-bg: #ffffff;
  --reader-text: #1a1a1a;
  --reader-secondary: #666666;
}

.chapter-reader[data-theme="sepia"] {
  --reader-bg: #f4ecd8;
  --reader-text: #5c4b37;
  --reader-secondary: #8b7355;
}

.chapter-reader .chapter-content {
  background: var(--reader-bg);
  color: var(--reader-text);
  transition: background 0.3s, color 0.3s;
}

.chapter-reader .chapter-text {
  color: var(--reader-text);
}

.chapter-reader .chapter-header {
  color: var(--reader-text);
}

.chapter-reader .chapter-meta {
  color: var(--reader-secondary);
}

/* Reading Settings Panel */
.reading-settings-panel {
  position: fixed;
  top: 60px;
  right: 20px;
  width: 300px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}
