:root {
  --bg-color: #f7f9fa;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f0f4f8;
  --text-primary: #555151;
  --text-secondary: #7a7a7a;
  --accent-primary: #2596be;
  --accent-secondary: #1d7a9c;
  --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  --border-color: rgba(85, 81, 81, 0.1);
  --error: #e53e3e;
  --success: #38a169;
  
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --shadow-glass: 0 4px 12px rgba(37, 150, 190, 0.08);
  --blur-glass: blur(12px);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

/* Ambient Background */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-color);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: var(--accent-primary);
  animation-delay: 0s;
}

.blob-2 {
  bottom: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: var(--accent-secondary);
  animation-delay: -5s;
}

.blob-3 {
  top: 40%;
  left: 50%;
  width: 40vw;
  height: 40vw;
  background: #a3d9eb;
  animation-delay: -10s;
  transform: translate(-50%, -50%);
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(5%, 5%) scale(1.1); }
  66% { transform: translate(-5%, 10%) scale(0.9); }
  100% { transform: translate(0, -5%) scale(1.05); }
}

/* Typography Utilities */
.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Navigation */
.glass-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: var(--accent-primary);
  border-bottom: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 4px 12px rgba(37, 150, 190, 0.2);
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-item {
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s ease;
  position: relative;
}

.nav-item:hover, .nav-item.active {
  color: #ffffff;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background: #ffffff;
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-item.active::after {
  width: 100%;
}

.auth-buttons, .user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(37, 150, 190, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(37, 150, 190, 0.5);
  filter: brightness(1.1);
}

.glass-nav .btn-primary {
  background: #ffffff;
  color: var(--accent-primary);
}
.glass-nav .btn-primary:hover {
  background: #f0f4f8;
}

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

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-primary);
}

.btn-ghost {
  color: rgba(255, 255, 255, 0.8);
}

.btn-ghost:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.15);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-icon {
  padding: 0.5rem;
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--bg-surface-hover);
}

.btn-icon:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.w-full {
  width: 100%;
}

/* Main Content Area */
main {
  padding-top: 80px; /* Space for nav */
  min-height: 100vh;
}

.view {
  display: none;
  animation: fadeIn 0.4s ease forwards;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.view.active {
  display: block;
}

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

/* Hero Section & Carousel */
.home-banner-container {
  margin: 2rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-glass);
}

.banner-carousel {
  display: flex;
}

.banner-slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4rem;
  border-radius: var(--radius-lg);
  gap: 2rem;
}

.banner-content {
  flex: 1;
}

.banner-content .hero-subtitle {
  color: rgba(255, 255, 255, 0.9);
}

.banner-image img {
  max-width: 200px;
  border-radius: var(--radius-md);
}

.categories-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 150, 190, 0.3) transparent;
}
.categories-scroll::-webkit-scrollbar {
  height: 5px;
  display: block;
}
.categories-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.categories-scroll::-webkit-scrollbar-thumb {
  background: rgba(37, 150, 190, 0.3);
  border-radius: var(--radius-full);
}
.categories-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 150, 190, 0.6);
}

.category-pill {
  padding: 0.8rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}
.category-pill:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.hero {
  text-align: center;
  padding: 6rem 0 4rem 0;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(3rem, 5vw, 4.5rem);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-inline: auto;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Sections */
.section-title {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-title h2 {
  font-size: 2rem;
}

/* Grid & Cards */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.ebook-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
}

.ebook-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glass);
}

.ebook-cover {
  width: 100%;
  height: 200px;
  background: linear-gradient(45deg, #e0e5ec, #f0f4f8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: rgba(85,81,81,0.4);
  position: relative;
  overflow: hidden;
}

.ebook-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  transform: skewX(-20deg);
}

.ebook-card:hover .ebook-cover::before {
  animation: shine 1.5s ease;
}

@keyframes shine {
  100% { left: 200%; }
}

.ebook-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ebook-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

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

.ebook-price {
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--accent-primary);
  margin-top: auto;
  margin-bottom: 1rem;
}

/* Forms */
.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: var(--blur-glass);
}

.form-panel {
  max-width: 600px;
  margin: 0 auto;
}

.form-panel h3 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

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

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

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

input, textarea, select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

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

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

.glass-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  backdrop-filter: var(--blur-glass);
  box-shadow: var(--shadow-glass);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .glass-modal {
  transform: scale(1);
}

.btn-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: var(--text-secondary);
}

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

.auth-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.auth-tab {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1.1rem;
  position: relative;
}

.auth-tab.active {
  color: var(--text-primary);
}

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-gradient);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.form-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  min-height: 1.2em;
}

/* Reader View */
.reader-container {
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: var(--blur-glass);
}

.reader-header {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0,0,0,0.3);
}

.reader-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page-indicator {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.canvas-wrapper {
  flex: 1;
  position: relative;
  overflow: auto;
  text-align: center;
  background: #121318;
}

#reader-canvas {
  max-width: none;
  max-height: none;
  display: inline-block;
  margin: 20px auto;
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
  transform-style: preserve-3d;
  transform-origin: left center;
}

.page-flip-next {
  animation: flipNext 0.4s ease-in forwards;
}

.page-flip-prev {
  animation: flipPrev 0.4s ease-in forwards;
}

@keyframes flipNext {
  0% { transform: rotateY(0deg); opacity: 1; }
  100% { transform: rotateY(-90deg); opacity: 0; }
}

@keyframes flipPrev {
  0% { transform: rotateY(90deg); opacity: 0; }
  100% { transform: rotateY(0deg); opacity: 1; }
}

.watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 4vw;
  color: rgba(255, 255, 255, 0.05);
  pointer-events: none;
  font-family: var(--font-display);
  font-weight: 700;
  white-space: nowrap;
  user-select: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 229, 255, 0.2);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 1s ease-in-out infinite;
  margin: 2rem auto;
}

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

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 3rem;
  grid-column: 1 / -1;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .hero-title { font-size: 2.5rem; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .reader-header { flex-wrap: wrap; gap: 1rem; }
}

@media (max-width: 600px) {
  main { padding-top: 130px; }
  .nav-container { 
    flex-direction: row; 
    flex-wrap: wrap; 
    gap: 0.5rem; 
    padding: 0.5rem 1rem; 
    justify-content: space-between; 
  }
  .logo { font-size: 1.2rem; gap: 0.5rem; }
  .logo img { height: 32px !important; }
  .nav-links { 
    order: 3; 
    width: 100%; 
    flex-wrap: nowrap; 
    justify-content: flex-start; 
    gap: 1rem; 
    overflow-x: auto; 
    padding-bottom: 5px; 
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-item { font-size: 0.85rem; white-space: nowrap; }
  .user-profile { 
    flex-direction: row; 
    width: auto; 
    gap: 0.75rem; 
  }
  .auth-buttons { gap: 0.5rem; }
  .btn { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
  .hero-title { font-size: 2rem; }
  .form-row { flex-direction: column; }
  .reader-controls { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .reader-header { flex-direction: column; align-items: stretch; gap: 0.5rem; padding: 0.5rem; }
  .reader-header h3 { font-size: 1rem; text-align: center; margin: 0; }
  .glass-panel > div { grid-template-columns: 1fr !important; }
  .view { padding: 1rem; }
  .reader-container { height: calc(100vh - 160px); }
}

/* NEW HERO BANNER STYLES */
.new-hero-banner { position: relative; width: 100%; max-width: 1100px; height: 320px; border-radius: 16px; overflow: hidden; display: flex; align-items: center; background: #0f1e2e; margin: 0 auto; }

/* backgrounds */
.new-hero-banner .bg { position: absolute; inset: 0; transition: opacity .4s; }
.new-hero-banner .bg-dark { background: linear-gradient(135deg, #1A2E44 0%, #0d1e30 60%, #122436 100%); }
.new-hero-banner .bg-teal { background: linear-gradient(135deg, #0a3d2e 0%, #0F6E56 60%, #1D9E75 100%); opacity: 0; }
.new-hero-banner .bg-purple { background: linear-gradient(135deg, #1a1040 0%, #2d1b69 60%, #534AB7 100%); opacity: 0; }

.new-hero-banner .blob1 { position: absolute; width: 400px; height: 400px; border-radius: 50%; top: -180px; right: -80px; opacity: .12; transition: background .4s; }
.new-hero-banner .blob2 { position: absolute; width: 260px; height: 260px; border-radius: 50%; bottom: -120px; right: 180px; opacity: .09; transition: background .4s; }
.new-hero-banner .grid-lines { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px); background-size: 40px 40px; }

/* content */
.new-hero-content { position: relative; z-index: 2; padding: 0 48px; flex: 1; max-width: 600px; text-align: left; }
.new-hero-content .logo-row { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; justify-content: flex-start; }
.new-hero-content .logo-badge { background: rgba(37,150,190,.25); border: 0.5px solid rgba(37,150,190,.4); border-radius: 8px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: #7dd3f0; letter-spacing: .02em; }
.new-hero-content .logo-by { font-size: 11px; color: #5DCAA5; opacity: .8; }

.new-hero-content .headline { font-size: 36px; font-weight: 700; line-height: 1.2; color: #fff; margin-bottom: 6px; }
.new-hero-content .headline span { color: #5DCAA5; }
.new-hero-content .new-hero-subtitle { font-size: 14px; color: #94b8cc; line-height: 1.6; margin-bottom: 24px; max-width: 380px; margin-inline: 0; }

.new-hero-content .cta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-start; }
.new-hero-content .banner-btn-primary { background: #2596BE; color: #fff; border: none; border-radius: 10px; padding: 12px 28px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s, transform .1s; }
.new-hero-content .banner-btn-primary:hover { background: #1d7fa3; transform: translateY(-1px); }
.new-hero-content .banner-btn-secondary { background: none; color: #94b8cc; border: 0.5px solid rgba(148,184,204,.35); border-radius: 10px; padding: 12px 22px; font-size: 14px; cursor: pointer; transition: all .15s; }
.new-hero-content .banner-btn-secondary:hover { border-color: #5DCAA5; color: #5DCAA5; }

.new-hero-content .stats-row { display: flex; gap: 20px; margin-top: 22px; }
.new-hero-content .stat { font-size: 11px; color: #7a9ab0; text-align: left; line-height: 1.3; }
.new-hero-content .stat b { font-size: 15px; font-weight: 600; color: #fff; display: block; }

/* badge floating */
.new-hero-banner .badge-float { position: absolute; top: 22px; right: 22px; z-index: 3; background: rgba(29,158,117,.88); border: 0.5px solid #1D9E75; border-radius: 20px; padding: 5px 14px; font-size: 12px; font-weight: 500; color: #fff; backdrop-filter: blur(4px); }

/* illustration */
.new-hero-banner .illustration { position: absolute; right: 0; top: 0; height: 100%; width: 380px; z-index: 1; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 0; }
.new-hero-banner .illustration svg { height: 100%; width: auto; }

@media (max-width: 768px) {
  .new-hero-banner { height: auto; padding: 2rem 0; flex-direction: column; }
  .new-hero-content { padding: 0 1.5rem; text-align: center; max-width: 100%; }
  .new-hero-content .logo-row, .new-hero-content .cta-row, .new-hero-content .stats-row { justify-content: center; }
  .new-hero-content .new-hero-subtitle { margin-inline: auto; }
  .new-hero-banner .illustration { position: relative; width: 100%; height: 250px; margin-top: 2rem; }
  .new-hero-banner .badge-float { top: 10px; right: 10px; font-size: 10px; }
}

/* STICKY PROFILE TABS & USER PROFILE STYLING */
.sticky-tabs-container {
  display: flex;
  gap: 2rem;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border-color);
  padding: 0 1.5rem;
  position: sticky;
  top: 79px;
  z-index: 99;
}
.profile-tab {
  padding: 1rem 0;
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}
.profile-tab:hover, .profile-tab.active {
  color: #2596BE !important;
}
.profile-tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #2596BE;
  transition: width 0.2s ease;
}
.profile-tab.active::after {
  width: 100%;
}
.category-badge {
  display: inline-block;
  font-family: var(--font-body);
}

/* SEARCH & FILTER STYLING */
.search-filter-container {
  max-width: 680px;
  margin: 2.5rem auto 1.5rem auto;
  padding: 0 1rem;
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input-wrapper input {
  width: 100%;
  padding: 0.9rem 2.8rem 0.9rem 1.2rem;
  background: var(--bg-surface);
  border: 2px solid #2596be;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(37, 150, 190, 0.08);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-wrapper input:focus {
  border-color: #1d9e75;
  box-shadow: 0 4px 15px rgba(29, 158, 117, 0.15);
}

.search-icon {
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1.1rem;
  pointer-events: none;
}

/* Category Filter Row */
.category-filters-row {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 150, 190, 0.3) transparent;
  width: 100%;
}

.category-filters-row::-webkit-scrollbar {
  height: 5px;
  display: block;
}
.category-filters-row::-webkit-scrollbar-track {
  background: transparent;
}
.category-filters-row::-webkit-scrollbar-thumb {
  background: rgba(37, 150, 190, 0.3);
  border-radius: var(--radius-full);
}
.category-filters-row::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 150, 190, 0.6);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  background: #ffffff;
  border: 1px solid rgba(85, 81, 81, 0.15);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  user-select: none;
}

.filter-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.filter-pill .count-badge {
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-pill.active {
  color: #ffffff;
  border-color: transparent;
}

.filter-pill.active .count-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Search results section */
.search-results-section {
  margin-top: 3rem;
  display: none;
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.results-count strong {
  color: var(--text-primary);
}

.btn-reset-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--error);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(229, 62, 62, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(229, 62, 62, 0.04);
  transition: all 0.2s ease;
}

.btn-reset-filter:hover {
  background: rgba(229, 62, 62, 0.08);
  border-color: rgba(229, 62, 62, 0.4);
}

/* Skeletons */
.skeleton-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 380px;
  display: flex;
  flex-direction: column;
}

.skeleton-cover {
  width: 100%;
  height: 200px;
  background: linear-gradient(90deg, #eaf0f6 25%, #f5f8fb 50%, #eaf0f6 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
}

.skeleton-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-text {
  height: 14px;
  background: linear-gradient(90deg, #eaf0f6 25%, #f5f8fb 50%, #eaf0f6 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 75%; }
.skeleton-text.long { width: 100%; }

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

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

/* Payout Styles */
.payout-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

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

.payout-table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.payout-status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.payout-status-badge.pending {
  background: rgba(229, 180, 62, 0.15);
  color: #d69e2e;
}

.payout-status-badge.paid {
  background: rgba(56, 161, 105, 0.15);
  color: var(--success);
}

.payout-status-badge.rejected {
  background: rgba(229, 62, 62, 0.15);
  color: var(--error);
  cursor: help;
}

/* Tooltip Styles */
.tooltip-wrapper {
  position: relative;
  display: inline-block;
}

/* Custom CSS Tooltip */
[data-tooltip] {
  position: relative;
  cursor: pointer;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: normal;
  width: max-content;
  max-width: 200px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  line-height: 1.4;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Lucide Reader Icon Buttons styling */
.reader-icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF; /* High-contrast white */
  opacity: 0.8;
  cursor: pointer;
  border-radius: 6px;
  background: transparent;
  border: none;
  transition: opacity 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  padding: 0;
}

.reader-icon-btn:hover {
  opacity: 1.0;
  color: var(--accent-primary); /* Transition to premium brand blue on hover */
  background-color: rgba(255, 255, 255, 0.1); /* Soft white overlay contrast on hover */
}

.reader-icon-btn svg, .reader-icon-btn i {
  width: 18px;
  height: 18px;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 2px !important;
}

.reader-icon-btn svg path,
.reader-icon-btn svg polygon,
.reader-icon-btn svg line,
.reader-icon-btn svg circle,
.reader-icon-btn svg polyline,
.reader-icon-btn svg rect {
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 2px !important;
}

/* TOC Sidebar Panel */
#toc-panel {
  position: fixed;
  left: -280px;
  top: 56px;
  width: 260px;
  height: calc(100vh - 56px);
  background: #1A2E44;
  color: white;
  overflow-y: auto;
  transition: left 0.3s ease, bottom 0.3s ease;
  z-index: 100;
  padding: 16px;
  box-shadow: 4px 0 20px rgba(0,0,0,0.3);
}

#toc-panel.open {
  left: 0px;
}

#reader-toolbar-bottom {
  display: none;
}

/* Hide mobile-only buttons by default */
.mobile-only {
  display: none !important;
}

/* Make sure reader-icon-btn supports label spacing */
.reader-icon-btn {
  width: auto !important;
  height: 36px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.reader-icon-btn span.btn-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

/* Desktop Styles default (min-width: 1024px) */
@media (min-width: 1024px) {
  .desktop-only {
    display: flex !important;
  }
}

/* Tablet Responsive Rules (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .desktop-only {
    display: flex !important;
  }
  /* Icon labels hidden, icons only */
  .reader-icon-btn span.btn-label {
    display: none !important;
  }
  .reader-icon-btn {
    width: 32px !important;
    padding: 0;
    justify-content: center;
  }
}

/* Mobile Responsive Rules (below 768px) */
@media (max-width: 767px) {
  main {
    padding-top: 0 !important;
  }
  
  .desktop-only {
    display: none !important;
  }
  
  .mobile-only {
    display: block !important;
  }
  
  #view-reader {
    padding: 0 !important;
  }
  
  .reader-container {
    height: auto !important;
    min-height: auto !important;
    border: none !important;
    border-radius: 0 !important;
  }
  
  #reader-toolbar-top {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 48px;
    background: #1A2E44;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  #reader-toolbar-top .btn-fullscreen {
    display: none !important;
  }
  
  #reader-toolbar-bottom {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 52px;
    background: #1A2E44;
    display: flex !important;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    z-index: 100;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  
  #reader-toolbar-bottom .reader-icon-btn {
    width: 32px !important;
    height: 32px !important;
    padding: 0;
    justify-content: center;
  }
  
  #reader-toolbar-top .btn-label {
    display: none !important;
  }
  
  #reader-content-wrapper {
    margin-top: 48px !important;
    margin-bottom: 52px !important;
    padding: 8px !important;
    height: auto !important;
    min-height: auto !important;
  }
  
  /* PDF page fills screen width */
  #pdf-container {
    width: 100% !important;
    overflow-x: hidden !important;
  }
  
  #pdf-container canvas {
    max-width: none !important;
    height: auto !important;
  }
  
  #pdf-container img {
    width: 100% !important;
    height: auto !important;
  }

  /* MOBILE TOC — bottom sheet */
  #toc-panel {
    position: fixed;
    left: 0 !important;
    right: 0 !important;
    bottom: -100% !important;
    top: auto !important;
    width: 100% !important;
    height: 60vh !important;
    border-radius: 16px 16px 0 0;
    transition: bottom 0.3s ease;
    z-index: 100;
  }
  
  #toc-panel.open {
    bottom: 52px !important; /* above bottom toolbar */
  }
}



