@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0f111a;
  --bg-secondary: #18181B;
  --bg-card: #181b29;
  --text-primary: #f0f2f8;
  --text-secondary: #94a3b8;
  --accent-primary: #8B5CF6; /* Neon Purple for Galaxy feel */
  --accent-hover: #A78BFA;
  --accent-gradient: linear-gradient(135deg, #3B82F6, #8B5CF6); /* Blue to Purple */
  --danger: #EF4444;
  --success: #10B981;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(26, 28, 35, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);
  --box-shadow-panel: none;
  --box-shadow-card: none;
  
  --font-family: 'Prompt', 'Inter', sans-serif;
  --transition: all 0.3s ease;
}

:root.light-mode {
  --bg-primary: #f0f4f8; /* Softer, slightly blue-tinted background */
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --accent-primary: #6D28D9; /* Deep Purple for light mode */
  --accent-hover: #7C3AED;
  --accent-gradient: linear-gradient(135deg, #3B82F6, #8B5CF6);
  
  --border-color: rgba(0, 0, 0, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.8);
  --box-shadow-panel: 0 8px 30px rgba(0, 0, 0, 0.04);
  --box-shadow-card: 0 4px 15px rgba(0, 0, 0, 0.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition);
}

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

/* Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  box-shadow: var(--box-shadow-panel);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-align: center;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
}

.btn-outline:hover {
  background-color: rgba(139, 92, 246, 0.1);
  color: var(--accent-hover);
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: radial-gradient(circle at top center, rgba(139, 92, 246, 0.08), transparent 60%), var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.3);
  padding: 1rem 0;
  box-shadow: 0 4px 30px rgba(139, 92, 246, 0.15), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
}

.nav-collapsible {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-wrapper {
  display: flex;
  align-items: center;
}

.logo-link {
  transition: all 0.3s ease;
}

.logo-link:hover .logo-svg {
  transform: translateY(-2px) scale(1.05);
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.8));
}

.logo-link:hover .logo-text {
  text-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

.logo-svg {
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

.logo-text {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: all 0.3s ease;
}

.beta-badge {
  background: linear-gradient(135deg, #3B82F6, #8B5CF6);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  position: absolute;
  top: -5px;
  right: -30px;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0% { box-shadow: 0 0 5px rgba(139, 92, 246, 0.4); }
  50% { box-shadow: 0 0 15px rgba(139, 92, 246, 0.8); }
  100% { box-shadow: 0 0 5px rgba(139, 92, 246, 0.4); }
}

.global-search-container {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 99;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top;
}

.global-search-container.hidden {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  transform: scaleY(0);
}

.wallet-glow {
  position: relative;
  overflow: hidden;
}

.wallet-glow::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 215, 0, 0.2), transparent);
  transform: skewX(-20deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { left: -100%; }
  20% { left: 200%; }
  100% { left: 200%; }
}

.nav-links {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.light-mode .nav-links a {
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(0, 0, 0, 0.02);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.1);
}

.user-menu {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Main Content Area */
main {
  min-height: calc(100vh - 140px);
  padding: 2rem 0;
}

/* Grid for Novels */
.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.novel-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  cursor: pointer;
  position: relative;
  box-shadow: var(--box-shadow-card);
}

.novel-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-primary);
  box-shadow: 0 15px 30px rgba(0,0,0,0.4), 0 0 15px rgba(139, 92, 246, 0.2);
}

.novel-card img {
  transition: transform 0.5s ease;
}

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

.novel-cover {
  width: 100%;
  height: 280px;
  object-fit: cover;
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.novel-info {
  padding: 1rem;
}

.novel-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.novel-author {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.novel-categories {
  font-size: 0.8rem;
  color: var(--text-secondary);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.5rem;
}

.author-badge:hover {
  background: rgba(139, 92, 246, 0.2) !important;
  border-color: rgba(139, 92, 246, 0.4) !important;
}

/* Hero Banner & Carousel */
.hero-carousel {
  position: relative;
  width: 100%;
  height: 350px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
}

.hero-banner-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.3;
  filter: blur(10px);
  z-index: 0;
}

.hero-banner-content {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 2rem;
  padding: 2rem;
  background: linear-gradient(to top, var(--bg-primary) 0%, transparent 100%);
  width: 100%;
  align-items: flex-end;
}

:root.light-mode .hero-banner-content {
  background: linear-gradient(to top, var(--bg-primary) 0%, rgba(0, 0, 0, 0.6) 100%);
}

.hero-banner-cover {
  width: 160px;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  border: 1px solid var(--border-color);
}

.hero-banner-info {
  flex: 1;
  color: #fff;
}

.hero-banner-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero-banner-author {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.hero-banner-desc {
  font-size: 0.95rem;
  opacity: 0.8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.carousel-dots {
  position: absolute;
  bottom: 1rem;
  right: 2rem;
  display: flex;
  gap: 0.5rem;
  z-index: 2;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background: var(--accent-primary);
  width: 20px;
  border-radius: 5px;
}

/* Updates Ticker */
.updates-ticker {
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  gap: 1rem;
  box-shadow: var(--box-shadow-panel);
}

:root.light-mode .updates-ticker {
  background: rgba(139, 92, 246, 0.05); /* Purple tint in light mode */
  border: 1px solid rgba(139, 92, 246, 0.1);
}

.ticker-label {
  font-weight: bold;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.ticker-content-wrapper {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-content {
  display: inline-block;
  animation: tickerScroll 20s linear infinite;
}

.ticker-content:hover {
  animation-play-state: paused;
}

.ticker-item {
  cursor: pointer;
  transition: color 0.2s ease;
}

.ticker-item:hover {
  color: var(--accent-primary);
}

@keyframes tickerScroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.8rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.5rem;
  font-size: 0.9rem;
  text-align: center;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--box-shadow-card);
}

.category-card:hover {
  background: var(--accent-primary);
  color: #fff;
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .hero-carousel {
    height: 600px;
  }
  .hero-banner-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 1rem;
  }
  .hero-banner-cover {
    width: 120px;
    height: 180px;
  }
  .hero-banner-title {
    font-size: 1.8rem;
  }
}

.novel-card-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
}

.novel-stats-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.novel-stat-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-family);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Modals / Overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  border: 1px solid var(--glass-border);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  position: relative;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.5rem;
  z-index: 10;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* Anti-copy classes */
.unselectable {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Reader specific */
.reader-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-secondary);
  padding: 3rem 4rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  position: relative;
}

.reader-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: rgba(226, 232, 240, 0.9);
}

.watermark {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-size="20" fill="rgba(255,255,255,0.03)" transform="rotate(-45 100 100)">Protected</text></svg>');
}

/* Blur overlay for tab switching */
#blur-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#blur-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.blur-message {
  text-align: center;
  color: var(--accent-primary);
}

/* Chapters list */
.chapter-list {
  list-style: none;
  margin-top: 1.5rem;
}

.chapter-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.chapter-item:hover {
  background: rgba(255,255,255,0.02);
}

.chapter-title {
  color: var(--text-primary);
  cursor: pointer;
}

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

.chapter-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.coin-icon {
  color: #FBBF24;
}

.free-badge {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* PromptPay Mock */
.qr-code-mock {
  width: 200px;
  height: 200px;
  background: white;
  margin: 1.5rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-weight: bold;
  border-radius: 8px;
  border: 4px solid #113566; /* PromptPay Blue */
}

/* Writer Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
}

.sidebar {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu li {
  margin-bottom: 0.5rem;
}

.sidebar-menu a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
  background: var(--bg-card);
  color: var(--accent-primary);
}

/* Writer Dashboard Tables & CMS */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.table th, .table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.table tr:hover {
  background: rgba(255,255,255,0.02);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Utility classes */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 1rem; }
.gap-1 { gap: 0.5rem; }

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .nav-container {
    flex-wrap: wrap;
    padding: 1rem;
  }
  
  .mobile-menu-btn {
    display: flex;
    align-items: center;
  }

  .nav-collapsible {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 1rem;
    align-items: flex-start;
    gap: 1rem;
  }

  .nav-collapsible.show {
    display: flex;
  }
  
  .nav-links {
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .nav-links a {
    width: 100%;
    text-align: left;
  }

  .user-menu {
    width: 100%;
    justify-content: flex-start;
  }

  .reader-container {
    padding: 1.5rem 1rem; /* Reduce huge padding on mobile */
  }

  .reader-settings {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
  }

  .reader-settings > div {
    width: 100%;
    justify-content: space-between;
  }

  .flex.justify-between.align-center.mb-4 {
     flex-direction: column;
     gap: 1rem;
     align-items: flex-start;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .glass-panel {
     padding: 1.5rem 1rem !important;
  }

  h1 {
    font-size: 1.8rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
}

/* User Dropdown */
.user-dropdown-container {
    position: relative;
    display: inline-block;
    margin-left: 1rem;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s;
}

.user-profile-trigger:hover {
    background: var(--bg-card);
}

.avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Notifications */
.notification-menu {
    width: 300px;
    right: -50px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    transform: translateY(10px);
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .notification-menu {
        right: auto;
        left: -10px;
        width: 280px;
    }
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.user-dropdown-container:hover .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.3s;
}

.user-dropdown-menu a:hover {
    background: var(--bg-overlay);
    border-radius: 8px;
}

/* Horizontal Scroll for Home */
.horizontal-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-secondary);
}

.horizontal-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.horizontal-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.horizontal-scroll-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

.horizontal-scroll-container .novel-card {
    min-width: 200px;
    flex: 0 0 auto;
    scroll-snap-align: start;
    margin-bottom: 0;
}

/* Vertical Ranking List Styles */
.ranking-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .ranking-grid-container {
        grid-template-columns: 1fr;
    }
}

.ranking-column {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.ranking-column-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.ranking-item:hover {
    background: var(--glass-border);
}

.rank-1 { color: #FFD700; }
.rank-2 { color: #A0AEC0; }
.rank-3 { color: #CD7F32; }
.rank-other { color: var(--text-secondary); }

.title-sales { color: #FFD700; }
.title-views { color: #00ff88; }
.title-authors { color: #ff00ea; }

.light-mode .title-sales { color: var(--accent-primary); }
.light-mode .title-new { color: #3B82F6; }

.light-mode .rank-1 { color: var(--accent-primary); }
.light-mode .rank-2 { color: #64748B; }

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

.rank-number {
    font-size: 1.25rem;
    font-weight: bold;
    min-width: 24px;
    text-align: center;
}

.ranking-cover {
    width: 48px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
}

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

.ranking-title {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.2rem;
}

.ranking-stat {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Badges */
.badge-novel {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 10;
}

.badge-hot {
    background: linear-gradient(135deg, #FF416C 0%, #FF4B2B 100%);
}

.badge-new {
    background: linear-gradient(135deg, #00B4DB 0%, #0083B0 100%);
}

/* Hero Banner */
.hero-banner {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background-color: var(--bg-card);
}

.hero-banner-bg {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    object-fit: cover;
    filter: blur(20px) brightness(0.4);
    z-index: 0;
}

.light-mode .hero-banner-bg {
    filter: blur(20px) brightness(0.8);
}

.hero-banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.hero-banner-cover {
    width: 160px;
    height: 240px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    border: 2px solid rgba(255,255,255,0.1);
}

.hero-banner-info {
    flex: 1;
    color: #fff; /* Always white text on banner due to dark overlay */
}

.hero-banner-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero-banner-author {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 1.5rem;
}

.hero-banner-desc {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 1.5rem;
    max-width: 600px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .hero-banner {
        padding: 1.5rem;
    }
    .hero-banner-content {
        flex-direction: column;
        text-align: center;
    }
    .hero-banner-cover {
        width: 120px;
        height: 180px;
    }
    .hero-banner-title {
        font-size: 1.8rem;
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--border-color) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.skeleton-card {
    height: 360px;
    border-radius: 12px;
}

.package-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; } 
.package-item { display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); padding: 1rem; border-radius: 12px; transition: all 0.2s; } 
.package-item:hover { background: rgba(139, 92, 246, 0.1); border-color: var(--accent-primary); transform: translateY(-2px); } 
.package-info { display: flex; flex-direction: column; align-items: flex-start; } 
.package-coins { font-size: 1.1rem; font-weight: 600; color: var(--accent-primary); display: flex; align-items: center; gap: 0.5rem; } 
.package-price { font-size: 0.85rem; color: var(--text-secondary); } 
.mascot-container { text-align: center; margin-bottom: 0.5rem; animation: float 3s ease-in-out infinite; } 
@keyframes float { 0% { transform: translateY(0); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0); } }
