/* ============================================
   Manhwaxen - Manga/Manhwa Reading Platform
   Modern Dark Theme Stylesheet
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
ul, ol { list-style: none; }
input, select, textarea { font: inherit; color: inherit; background: none; border: none; outline: none; }

/* --- CSS Variables --- */
:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --bg-card: #1e1e35;
  --bg-header: #0a0a14;
  --bg-input: #17151f;
  --bg-overlay: rgba(10, 10, 20, 0.85);
  --bg-reader: #000000;

  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-dark: #6d28d9;
  --accent-glow: rgba(139, 92, 246, 0.15);
  --accent-gradient: linear-gradient(135deg, #8b5cf6, #6d28d9);

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-heading: #f8fafc;
  --text-muted: #64748b;

  --border: #2d2d44;
  --border-light: #3d3d5c;

  --green: #22c55e;
  --red: #ef4444;
  --orange: #f97316;
  --yellow: #fbbf24;
  --blue: #3b82f6;
  --pink: #ec4899;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 4px 20px rgba(139, 92, 246, 0.2);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --header-height: 64px;
  --sidebar-width: 320px;
  --container-max: 1280px;
  --reader-max: 800px;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  --z-header: 100;
  --z-mobile-menu: 150;
  --z-modal: 200;
  --z-overlay: 190;
  --z-reader-controls: 50;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.25rem); }
h4 { font-size: 1.1rem; }

p { color: var(--text-secondary); }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.page-content {
  padding-top: calc(var(--header-height) + 24px);
  padding-bottom: 60px;
  min-height: 100vh;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr var(--sidebar-width);
  }
}

.section {
  margin-bottom: 40px;
}

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

.section-header h2 {
  position: relative;
  padding-left: 14px;
}

.section-header h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.section-header .view-all {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.section-header .view-all:hover {
  color: var(--accent-hover);
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-header);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 38px;
  height: 30px;
  object-fit: contain;
  display: block;
  background: #fff;
  border-radius: 6px;
  padding: 2px 4px;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 8px;
}

.nav-desktop a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text-heading);
  background: rgba(139, 92, 246, 0.1);
}

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

@media (min-width: 768px) {
  .nav-desktop { display: flex; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

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

.btn-icon svg {
  width: 20px;
  height: 20px;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: all var(--transition-base);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (min-width: 768px) {
  .hamburger { display: none; }
}

/* --- Mobile Menu --- */
.mobile-menu {
  position: fixed;
  top: var(--header-height);
  right: -300px;
  width: 280px;
  height: calc(100vh - var(--header-height));
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: var(--z-mobile-menu);
  transition: right var(--transition-slow);
  padding: 24px;
  overflow-y: auto;
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  margin-bottom: 4px;
}

.mobile-menu a:hover,
.mobile-menu a.active {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent);
}

.mobile-menu a svg {
  width: 20px;
  height: 20px;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-mobile-menu) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.mobile-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* --- Search Modal --- */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.search-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.search-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.search-modal-content {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-lg);
}

.search-modal.open .search-modal-content {
  transform: translateY(0);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.search-input-wrap svg {
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input-wrap input {
  flex: 1;
  font-size: 1.05rem;
  color: var(--text-heading);
}

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

.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.search-results::-webkit-scrollbar {
  width: 6px;
}

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

.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.search-result-item:hover {
  background: rgba(139, 92, 246, 0.08);
}

.search-result-cover {
  width: 48px;
  height: 64px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  overflow: hidden;
}

.search-result-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.search-result-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.search-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* --- Hero Carousel --- */
.hero {
  position: relative;
  width: 100%;
  height: 420px;
  margin-bottom: 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.hero-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 40px;
}

.hero-slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: blur(2px) brightness(0.4);
  transform: scale(1.1);
}

.hero-slide-content {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 24px;
  align-items: flex-end;
  max-width: 700px;
}

.hero-slide-cover {
  width: 140px;
  height: 200px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-slide-info {
  flex: 1;
}

.hero-slide-info .badge-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.hero-slide-info h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  margin-bottom: 8px;
  color: #fff;
}

.hero-slide-info p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
  line-height: 1.6;
}

.hero-slide-info .btn-primary {
  display: inline-flex;
}

.hero-dots {
  position: absolute;
  bottom: 16px;
  right: 24px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

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

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

.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: all var(--transition-fast);
  color: white;
  opacity: 0;
}

.hero:hover .hero-nav {
  opacity: 1;
}

.hero-nav:hover {
  background: var(--accent);
}

.hero-nav.prev { left: 16px; }
.hero-nav.next { right: 16px; }

.hero-nav svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 640px) {
  .hero { height: 380px; }
  .hero-slide { padding: 20px; }
  .hero-slide-cover { width: 110px; height: 155px; }
  .hero-slide-bg { background-position: center 20%; }
  .hero-slide-info p { display: none; }
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--accent-gradient);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

/* --- Manga Cards --- */
.manga-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 20px;
}

.manga-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  transition: all var(--transition-base);
  cursor: pointer;
}

.manga-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

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

.manga-card-cover .cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.manga-card-cover .cover-gradient {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  padding: 16px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.manga-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 12px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
}

.manga-card-type {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}

.manga-card-rating {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--yellow);
}

.manga-card-rating svg {
  width: 12px;
  height: 12px;
}

.manga-card-info {
  padding: 12px;
}

.manga-card-info h3 {
  font-size: 0.88rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  line-height: 1.4;
}

.manga-card-info .chapter-badge {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.manga-card-info .chapter-badge span {
  color: var(--green);
  font-weight: 500;
}

/* --- Latest Updates List --- */
.updates-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.update-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.update-item:hover {
  background: var(--bg-tertiary);
  transform: translateX(4px);
}

.update-item-cover {
  width: 56px;
  height: 76px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  overflow: hidden;
}

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

.update-item-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.update-item-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.update-item-chapters a {
  padding: 3px 10px;
  background: var(--bg-primary);
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.update-item-chapters a:hover {
  background: var(--accent);
  color: white;
}

.update-item-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* --- Sidebar --- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar-widget {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border);
}

.sidebar-widget h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.popular-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popular-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.popular-item:hover {
  background: rgba(139, 92, 246, 0.06);
}

.popular-rank {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-muted);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.popular-item:nth-child(1) .popular-rank { color: var(--yellow); }
.popular-item:nth-child(2) .popular-rank { color: var(--text-secondary); }
.popular-item:nth-child(3) .popular-rank { color: #cd7f32; }

.popular-cover {
  width: 44px;
  height: 60px;
  border-radius: 4px;
  flex-shrink: 0;
  overflow: hidden;
}

.popular-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genre-tag {
  padding: 6px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.genre-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(139, 92, 246, 0.06);
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-manhwa { background: rgba(139, 92, 246, 0.15); color: var(--accent); }
.badge-manga { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.badge-manhua { background: rgba(236, 72, 153, 0.15); color: var(--pink); }
.badge-ongoing { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.badge-completed { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.badge-hiatus { background: rgba(249, 115, 22, 0.15); color: var(--orange); }
.badge-new { background: rgba(34, 197, 94, 0.2); color: var(--green); }
.badge-hot { background: rgba(239, 68, 68, 0.2); color: var(--red); }

/* --- Manga Detail Page --- */
.manga-detail {
  padding-top: calc(var(--header-height) + 24px);
}

.manga-banner {
  position: relative;
  height: 300px;
  margin: calc(-1 * (var(--header-height) + 24px)) -20px 0;
  overflow: hidden;
}

.manga-banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(20px) brightness(0.3);
  transform: scale(1.2);
}

.manga-banner-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--bg-primary) 100%);
}

.manga-info-section {
  position: relative;
  display: flex;
  gap: 28px;
  margin-top: -120px;
  z-index: 2;
  padding: 0 20px;
}

.manga-cover-wrap {
  flex-shrink: 0;
}

.manga-cover-large {
  width: 200px;
  height: 285px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--bg-primary);
}

.manga-meta {
  flex: 1;
  min-width: 0;
  padding-top: 90px;
}

.manga-meta h1 {
  margin-bottom: 6px;
}

.manga-meta .alt-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.manga-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.manga-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.manga-meta-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.manga-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn-bookmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-bookmark:hover {
  border-color: var(--red);
  color: var(--red);
}

.btn-bookmark.active {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--red);
  color: var(--red);
}

.btn-bookmark svg {
  width: 18px;
  height: 18px;
}

.manga-synopsis {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.manga-synopsis h3 {
  margin-bottom: 12px;
}

.manga-synopsis p {
  font-size: 0.9rem;
  line-height: 1.7;
}

.synopsis-text {
  position: relative;
  max-height: 120px;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.synopsis-text.expanded {
  max-height: 1000px;
}

.synopsis-text::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(to top, var(--bg-card), transparent);
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.synopsis-text.expanded::after {
  opacity: 0;
}

.synopsis-toggle {
  margin-top: 8px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

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

/* --- Stats Bar --- */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-top: 20px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 120px;
}

.stat-item svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.stat-item .stat-value {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-heading);
}

.stat-item .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Chapter List --- */
.chapter-section {
  margin-top: 28px;
}

.chapter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.chapter-tab {
  padding: 12px 24px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.chapter-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.chapter-tab:hover {
  color: var(--text-primary);
}

.chapter-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.chapter-search svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.chapter-search input {
  flex: 1;
  font-size: 0.9rem;
}

.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
}

.chapter-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--border);
}

.chapter-item.read {
  opacity: 0.5;
}

.chapter-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chapter-item-left h4 {
  font-size: 0.9rem;
  font-weight: 500;
}

.chapter-item-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chapter-item-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chapter-load-more {
  text-align: center;
  margin-top: 16px;
}

.chapter-order-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.chapter-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

/* --- Rating Widget --- */
.rating-widget {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rating-stars {
  display: flex;
  gap: 2px;
}

.rating-star {
  cursor: pointer;
  color: var(--border);
  transition: color var(--transition-fast);
}

.rating-star.filled,
.rating-star:hover,
.rating-stars:hover .rating-star {
  color: var(--yellow);
}

.rating-stars:hover .rating-star:hover ~ .rating-star {
  color: var(--border);
}

.rating-star svg {
  width: 20px;
  height: 20px;
}

.rating-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--yellow);
  margin-left: 4px;
}

.rating-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Reader --- */
.reader-page {
  background: var(--bg-reader);
  min-height: 100vh;
}

.reader-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: rgba(10, 10, 20, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: var(--z-reader-controls);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform var(--transition-base);
}

.reader-header.hidden {
  transform: translateY(-100%);
}

.reader-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.reader-header-left .back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.reader-header-left .back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.reader-header-left .back-btn svg {
  width: 20px;
  height: 20px;
}

.reader-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.reader-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chapter-select {
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
}

.chapter-select option {
  background: var(--bg-secondary);
}

.reader-progress {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  z-index: var(--z-reader-controls);
}

.reader-progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  transition: width 100ms linear;
  border-radius: 0 2px 2px 0;
}

.reader-content {
  max-width: var(--reader-max);
  margin: 0 auto;
  padding: 60px 0 80px;
}

.reader-content.fit-width {
  max-width: 100%;
}

.reader-content.fit-height img,
.reader-content.fit-height .reader-page-placeholder {
  max-height: 100vh;
  width: auto;
  margin: 0 auto;
}

.reader-page-img {
  width: 100%;
  display: block;
  user-select: none;
}

.reader-page-placeholder {
  width: 100%;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 50%, #1a1a2e 100%);
  color: var(--text-muted);
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  gap: 8px;
}

.reader-page-placeholder .page-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.3;
}

.reader-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(10, 10, 20, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  z-index: var(--z-reader-controls);
  transition: transform var(--transition-base);
}

.reader-bottom-nav.hidden {
  transform: translateY(100%);
}

.reader-bottom-nav .btn-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.reader-bottom-nav .btn-nav:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.reader-bottom-nav .btn-nav:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.reader-bottom-nav .btn-nav svg {
  width: 16px;
  height: 16px;
}

.reader-bottom-nav .chapter-indicator {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- Settings Panel --- */
.settings-panel {
  position: fixed;
  top: 52px;
  right: -320px;
  width: 300px;
  height: calc(100vh - 52px);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: calc(var(--z-reader-controls) + 1);
  padding: 24px;
  transition: right var(--transition-slow);
  overflow-y: auto;
}

.settings-panel.open {
  right: 0;
}

.settings-panel h3 {
  margin-bottom: 20px;
  font-size: 1rem;
}

.setting-group {
  margin-bottom: 20px;
}

.setting-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.setting-options {
  display: flex;
  gap: 8px;
}

.setting-option {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.setting-option.active {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Browse Page --- */
.browse-header {
  margin-bottom: 28px;
}

.browse-header h1 {
  margin-bottom: 8px;
}

.browse-header p {
  font-size: 0.9rem;
}

.browse-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select {
  padding: 8px 32px 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.filter-select:focus {
  border-color: var(--accent);
}

.browse-search {
  flex: 1;
  min-width: 200px;
}

.browse-search input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.browse-search input:focus {
  border-color: var(--accent);
}

.browse-genre-filters {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.genre-filter-btn {
  padding: 5px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.genre-filter-btn.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

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

.browse-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.results-count {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.results-count span {
  color: var(--accent);
  font-weight: 600;
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.no-results svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.no-results h3 {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* --- Bookmarks Page --- */
.bookmarks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.bookmarks-empty {
  text-align: center;
  padding: 80px 20px;
}

.bookmarks-empty svg {
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  opacity: 0.3;
  margin-bottom: 20px;
}

.bookmarks-empty h2 {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.bookmarks-empty p {
  margin-bottom: 24px;
}

.bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
}

.bookmark-card {
  position: relative;
}

.bookmark-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  color: var(--red);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.bookmark-card:hover .bookmark-remove {
  opacity: 1;
}

.bookmark-remove svg {
  width: 14px;
  height: 14px;
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.footer-about h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.footer-about p {
  font-size: 0.85rem;
  line-height: 1.7;
}

.footer-links h4 {
  font-size: 0.9rem;
  margin-bottom: 14px;
  color: var(--text-heading);
}

.footer-links a {
  display: block;
  padding: 4px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  margin-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

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

.skeleton-cover {
  aspect-ratio: 2/3;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-text.short {
  width: 60%;
}

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

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

.stagger > * {
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}

.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.4s; }
.stagger > *:nth-child(9) { animation-delay: 0.45s; }
.stagger > *:nth-child(10) { animation-delay: 0.5s; }
.stagger > *:nth-child(n+11) { animation-delay: 0.55s; }

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* --- Utilities --- */
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .sidebar { display: none; }
  .manga-info-section { flex-direction: column; align-items: center; text-align: center; }
  .manga-meta { padding-top: 16px; }
  .manga-actions { justify-content: center; }
  .manga-meta-row { justify-content: center; }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .container { padding: 0 16px; }

  .manga-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
  }

  .browse-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .manga-cover-large {
    width: 160px;
    height: 228px;
  }

  .stats-bar {
    gap: 12px;
  }

  .stat-item {
    min-width: 100px;
  }

  .browse-filters {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .manga-grid,
  .browse-grid,
  .bookmarks-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .manga-card-info {
    padding: 8px;
  }

  .manga-card-info h3 {
    font-size: 0.8rem;
  }

  .hero-slide-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-slide-cover {
    display: none;
  }
}

/* --- Auth Buttons (Header) --- */
.btn-auth-signin {
  padding: 7px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-auth-signin:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-auth-signup {
  padding: 7px 18px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  transition: all var(--transition-fast);
}

.btn-auth-signup:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-premium {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: #1a1a2e;
  transition: all var(--transition-fast);
}

.btn-premium svg {
  width: 16px;
  height: 16px;
}

.btn-premium:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

@media (max-width: 768px) {
  .btn-auth-signin,
  .btn-auth-signup,
  .btn-premium span { display: none; }
  .btn-premium { padding: 7px 10px; }
}

@media (max-width: 480px) {
  .btn-premium { display: none; }
}

/* --- Auth Modal --- */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.auth-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

.auth-modal-content {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-lg);
}

.auth-modal.open .auth-modal-content {
  transform: scale(1) translateY(0);
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  z-index: 2;
}

.auth-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.auth-close svg {
  width: 18px;
  height: 18px;
}

.auth-form {
  padding: 36px 32px 28px;
}

.auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-logo {
  width: 48px;
  height: 48px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  color: white;
  margin: 0 auto 14px;
}

.auth-header h2 {
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.auth-header p {
  font-size: 0.88rem;
}

.auth-promo-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.auth-promo-banner svg {
  width: 20px;
  height: 20px;
  color: #f59e0b;
  flex-shrink: 0;
}

.auth-promo-banner span {
  font-size: 0.82rem;
  font-weight: 500;
  color: #fbbf24;
  line-height: 1.4;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.auth-input-wrap:focus-within {
  border-color: var(--accent);
}

.auth-input-wrap svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.auth-input-wrap input {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-heading);
}

.auth-input-wrap input::placeholder {
  color: var(--text-muted);
}

.auth-input-wrap input.error {
  color: var(--red);
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 0.82rem;
}

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}

.auth-checkbox input {
  accent-color: var(--accent);
  cursor: pointer;
}

.auth-link {
  color: var(--accent);
  transition: color var(--transition-fast);
}

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

.btn-auth-submit {
  width: 100%;
  padding: 12px;
  background: var(--accent-gradient);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
}

.btn-auth-submit:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-switch {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 0.85rem;
}

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

/* --- Promo Banner (Homepage) --- */
.promo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 24px;
  margin-bottom: 32px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  cursor: pointer;
}

.promo-banner:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(245, 158, 11, 0.14));
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.promo-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.promo-badge {
  padding: 4px 10px;
  background: var(--accent-gradient);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  color: white;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.promo-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-heading);
  margin-bottom: 2px;
}

.promo-text span {
  font-size: 0.82rem;
  color: var(--accent);
}

.promo-plans {
  display: flex;
  align-items: center;
  gap: 12px;
}

.promo-plan {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.promo-plan strong {
  color: #fbbf24;
  font-weight: 700;
}

.promo-divider {
  color: var(--border);
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .promo-plans { display: none; }
  .promo-banner { padding: 14px 18px; }
}

/* --- Pricing Section --- */
.pricing-section {
  padding: 60px 0;
}

.pricing-header {
  text-align: center;
  margin-bottom: 40px;
}

.pricing-header h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: 10px;
}

.pricing-header p {
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

.pricing-promo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-xl);
  margin-bottom: 16px;
}

.pricing-promo svg {
  width: 22px;
  height: 22px;
  color: #f59e0b;
}

.pricing-promo span {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fbbf24;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pricing-card.popular {
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.15);
}

.pricing-card.popular::before {
  content: 'BEST VALUE';
  position: absolute;
  top: 12px;
  right: -35px;
  background: var(--accent-gradient);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 5px 45px;
  transform: rotate(45deg);
  text-align: center;
  z-index: 1;
}

.pricing-card-duration {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pricing-card-price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.2;
  margin-bottom: 4px;
}

.pricing-card-price .currency {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  vertical-align: super;
}

.pricing-card-per {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.pricing-card-savings {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
  border-radius: var(--radius-xl);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.pricing-card-features {
  text-align: left;
  margin-bottom: 24px;
}

.pricing-card-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.pricing-card-features li svg {
  width: 18px;
  height: 18px;
  color: var(--green);
  flex-shrink: 0;
}

.pricing-card .btn-pricing {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  transition: all var(--transition-fast);
}

.pricing-card .btn-pricing-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-accent);
}

.pricing-card .btn-pricing-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.pricing-card .btn-pricing-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.pricing-card .btn-pricing-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Pricing Page --- */
.pricing-faq {
  max-width: 700px;
  margin: 48px auto 0;
}

.pricing-faq h2 {
  text-align: center;
  margin-bottom: 24px;
}

.faq-item {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.faq-item h4 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--text-heading);
}

.faq-item p {
  font-size: 0.88rem;
  line-height: 1.6;
}

/* --- Auth Alerts --- */
.auth-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 12px;
  font-weight: 500;
}

.auth-alert-error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-alert-success {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* --- User Profile Button (Header) --- */
.btn-user-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-xl);
  background: var(--accent-glow);
  color: var(--accent-hover);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-user-profile svg {
  width: 16px;
  height: 16px;
}

.btn-user-profile:hover {
  background: var(--accent);
  color: #fff;
}

/* --- Profile Page --- */
.profile-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 0;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.profile-avatar {
  flex-shrink: 0;
}

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

.profile-avatar-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
}

.profile-info h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.profile-email {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.profile-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-badges .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.profile-badges .badge svg {
  width: 14px;
  height: 14px;
}

.profile-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.profile-section-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
}

.profile-section-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text-heading);
}

.profile-section-card h3 svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.profile-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

.btn-secondary {
  padding: 10px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--red);
  color: var(--red);
}

/* --- Top Rated Stars --- */
.top-rated-stars {
  color: var(--yellow);
  font-size: 0.7rem;
  letter-spacing: -1px;
}

/* --- Empty State (no data) --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 80px;
  height: 80px;
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .profile-card {
    flex-direction: column;
    text-align: center;
  }
  .profile-badges {
    justify-content: center;
  }
}

/* --- Print --- */
@media print {
  .site-header, .site-footer, .reader-header, .reader-bottom-nav { display: none; }
  body { background: white; color: black; }
}

/* --- Profile Bookmark List --- */
.profile-bookmark-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-bookmark-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  text-decoration: none;
  color: var(--text-heading);
}

.profile-bookmark-item:hover {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.06);
}

.profile-bookmark-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 22px;
  text-align: center;
  opacity: 0.5;
}

.profile-bookmark-title {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-bookmark-item:hover .profile-bookmark-title {
  color: var(--accent);
}

.profile-bookmark-arrow {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  color: var(--text-muted);
  opacity: 0;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.profile-bookmark-item:hover .profile-bookmark-arrow {
  opacity: 1 !important;
  color: var(--accent) !important;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
