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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

/* === Ambient Background Orbs === */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  filter: blur(100px);
}

body::before {
  width: 600px;
  height: 600px;
  top: -15%;
  left: -10%;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.06) 0%, transparent 70%);
  animation: orbFloat1 20s ease-in-out infinite;
}

body::after {
  width: 500px;
  height: 500px;
  bottom: -10%;
  right: -10%;
  background: radial-gradient(circle, rgba(79, 195, 247, 0.05) 0%, transparent 70%);
  animation: orbFloat2 25s ease-in-out infinite;
}

/* Noise overlay */
#app::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  display: block;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

/* =========================================
   HEADER — Frosted glass with gradient line
   ========================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-header);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

/* Gradient line at bottom */
.header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold-glow), var(--accent-blue-glow), var(--accent-purple-glow), transparent);
}

.header__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--accent-gold);
  white-space: nowrap;
  flex-shrink: 0;
  transition: text-shadow var(--transition-base);
}

.header__logo:hover {
  text-shadow: 0 0 20px var(--accent-gold-glow);
}

.header__logo-icon {
  font-size: 1.6rem;
  animation: float 4s ease-in-out infinite;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
  /* Fade mask on right edge to hint scrollability */
  mask-image: linear-gradient(to right, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
  padding-right: var(--space-md);
}
.header__nav::-webkit-scrollbar { display: none; }

.header__nav-link {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem; /* 13px — slightly smaller to fit all links */
  font-weight: var(--font-medium);
  letter-spacing: 0.3px;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition-base);
  position: relative;
}

.header__nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.header__nav-link.active {
  color: var(--accent-gold);
  background: rgba(240, 180, 41, 0.08);
}

.header__nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--accent-gold);
  border-radius: 2px;
}

.header__search {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0 var(--space-md);
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.header__search:focus-within {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.08), 0 0 20px rgba(240, 180, 41, 0.05);
  background: rgba(255, 255, 255, 0.06);
}

.header__search-input {
  background: transparent;
  border: none;
  outline: none;
  padding: 10px 12px;
  color: var(--text-primary);
  width: 170px;
  font-size: var(--text-sm);
}

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

.header__search-btn {
  padding: 6px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
}

.header__search-btn:hover {
  color: var(--accent-gold);
}

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

.header__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.header__hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.header__hamburger.active span:nth-child(2) { opacity: 0; }
.header__hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* =========================================
   LAYOUT
   ========================================= */
.main {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  position: relative;
  z-index: 1;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl);
}

/* =========================================
   HERO — Premium gradient with floating orbs
   ========================================= */
.hero {
  background: var(--gradient-hero);
  border-radius: var(--radius-xl);
  padding: var(--space-4xl) var(--space-3xl);
  margin-bottom: var(--space-3xl);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-xl), inset 0 1px 2px rgba(255, 255, 255, 0.1), inset 0 -1px 3px rgba(0, 0, 0, 0.6);
}

/* Decorative orbs */
.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.12) 0%, transparent 65%);
  border-radius: 50%;
  animation: orbFloat1 15s ease-in-out infinite;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -5%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(79, 195, 247, 0.08) 0%, transparent 65%);
  border-radius: 50%;
  animation: orbFloat2 18s ease-in-out infinite;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
}

.hero__title {
  font-family: var(--font-serif);
  font-size: var(--text-5xl);
  font-weight: 800; /* Extra bold for cinematic impact */
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.hero__title span {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textGlow 3s ease-in-out infinite;
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: var(--space-2xl);
  line-height: 1.7;
}

.hero__stats {
  display: flex;
  gap: var(--space-3xl);
}

.hero__stat {
  text-align: center;
  position: relative;
}

.hero__stat::after {
  content: '';
  position: absolute;
  right: calc(var(--space-3xl) / -2);
  top: 15%;
  height: 70%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border-color), transparent);
}

.hero__stat:last-child::after {
  display: none;
}

.hero__stat-number {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: var(--font-medium);
}

/* Hero category pills */
.hero__categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-2xl);
}

.hero__cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: all var(--transition-base);
  backdrop-filter: blur(4px);
}

.hero__cat-pill:hover {
  background: rgba(240, 180, 41, 0.1);
  border-color: rgba(240, 180, 41, 0.25);
  color: var(--accent-gold);
  transform: translateY(-2px);
}

/* =========================================
   SECTION HEADERS
   ========================================= */
.section {
  margin-bottom: var(--space-3xl);
}

.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.section__title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.section__title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 28px;
  background: var(--gradient-gold);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--accent-gold-glow);
}

.section__more {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-base);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(240, 180, 41, 0.2);
}

.section__more:hover {
  gap: 10px;
  background: rgba(240, 180, 41, 0.08);
  border-color: rgba(240, 180, 41, 0.3);
}

/* =========================================
   BOOK GRID
   ========================================= */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--space-xl);
}

.book-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

/* =========================================
   BOOK CARD — Glass-morphism with border glow
   ========================================= */
.book-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  border-top: 1px solid rgba(255, 255, 255, 0.12); /* Glass top edge highlight */
  border-left: 1px solid rgba(255, 255, 255, 0.06); /* Glass left edge highlight */
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
  position: relative;
}

/* Shine sweep on hover */
.book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-shine);
  z-index: 3;
  transition: left 0.6s ease;
  pointer-events: none;
}

.book-card:hover::before {
  left: 100%;
}

/* Golden glow border outline */
.book-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-md);
  padding: 1.5px;
  background: linear-gradient(135deg, 
    transparent 0%, 
    rgba(212, 175, 55, 0.1) 20%, 
    rgba(255, 215, 0, 0.6) 40%, 
    rgba(218, 165, 32, 0.8) 50%, 
    rgba(255, 215, 0, 0.6) 60%, 
    rgba(212, 175, 55, 0.1) 80%, 
    transparent 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.book-card:hover::after {
  opacity: 1;
}

.book-card:hover {
  border-color: rgba(212, 175, 55, 0.4);
  border-top-color: rgba(255, 215, 0, 0.6);
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(212, 175, 55, 0.15),
    0 0 40px rgba(212, 175, 55, 0.08),
    inset 0 1px 0 rgba(255, 215, 0, 0.1);
}

.book-card__cover {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--bg-secondary);
}

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

.book-card:hover .book-card__cover img {
  transform: scale(1.08);
}

/* Real cover image variant */
.cover-art--image {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  position: relative;
}

.cover-art__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}

.cover-art__img--sm {
  height: 60px;
  width: 45px;
  object-fit: cover;
  border-radius: var(--radius-xs);
}

.book-card:hover .cover-art__img {
  transform: scale(1.05);
}


.book-card__category {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: 4px 12px;
  background: rgba(240, 180, 41, 0.9);
  color: #000;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.book-card__info {
  padding: var(--space-md) var(--space-lg);
}

.book-card__title {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card__author {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.book-card__rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--accent-gold);
}

/* =========================================
   COVER ART (CSS-only book covers)
   ========================================= */
.cover-art {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-lg);
  overflow: hidden;
  aspect-ratio: 3/4;
}

.cover-art__accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  opacity: 0.8;
}

.cover-art__circle {
  position: absolute;
  top: -20%;
  right: -15%;
  width: 55%;
  height: 55%;
  border-radius: 50%;
  opacity: 0.08;
  filter: blur(1px);
}

.cover-art__circle--2 {
  top: auto;
  bottom: -10%;
  right: auto;
  left: -10%;
  width: 40%;
  height: 40%;
  opacity: 0.06;
}

.cover-art__line {
  position: absolute;
  top: 18%;
  right: 12%;
  width: 2px;
  height: 35%;
  opacity: 0.2;
  border-radius: 1px;
}

.cover-art__content {
  position: relative;
  z-index: 2;
}

.cover-art__title {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: #fff;
  line-height: 1.3;
  margin-bottom: var(--space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.cover-art__title--sm {
  font-size: var(--text-xs);
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.cover-art__author {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  opacity: 0.9;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.cover-art__brand {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-size: 0.5rem;
  font-weight: var(--font-bold);
  color: rgba(255,255,255,0.2);
  letter-spacing: 2px;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

/* =========================================
   BOOK DETAIL
   ========================================= */
.book-detail {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-3xl);
  animation: fadeIn 0.5s ease forwards;
}

.book-detail__cover {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl), inset 0 1px 2px rgba(255,255,255,0.1), inset 0 -1px 2px rgba(0,0,0,0.5);
  border: 1px solid var(--border-color);
  position: sticky;
  top: calc(var(--header-height) + var(--space-xl));
  align-self: start;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.book-detail__cover:hover {
  box-shadow: var(--shadow-xl), var(--shadow-glow-gold);
  transform: translateY(-4px);
}

.book-detail__cover img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.book-detail__content {
  padding: var(--space-md) 0;
}

.book-detail__category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px;
  background: rgba(240, 180, 41, 0.1);
  color: var(--accent-gold);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-lg);
  border: 1px solid rgba(240, 180, 41, 0.15);
}

.book-detail__title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.book-detail__author {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.book-detail__meta {
  display: flex;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
  padding: var(--space-lg) var(--space-xl);
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.book-detail__meta-item {
  text-align: center;
  flex: 1;
}

.book-detail__meta-value {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--accent-gold);
}

.book-detail__meta-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.book-detail__desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-sm);
  position: relative;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-detail__desc--collapsed {
  max-height: 9em; /* ~5 lines */
}

.book-detail__desc--expanded {
  max-height: 5000px;
}

.book-detail__desc-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4em;
  background: linear-gradient(to bottom, transparent, var(--bg-primary));
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.book-detail__desc--expanded .book-detail__desc-fade {
  opacity: 0;
}

.book-detail__desc p {
  margin-bottom: var(--space-md);
}

/* Read More button */
.book-detail__read-more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 10px 20px;
  background: rgba(240, 180, 41, 0.1);
  color: var(--color-gold);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  border: 1px solid rgba(240, 180, 41, 0.25);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  margin-bottom: var(--space-xl);
}

.book-detail__read-more:hover {
  background: rgba(240, 180, 41, 0.2);
  border-color: rgba(240, 180, 41, 0.4);
  transform: translateY(-1px);
}

.book-detail__read-more-arrow {
  transition: transform 0.3s ease;
}

/* Sticky Download Bar */
.sticky-download-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.sticky-download-bar--visible {
  transform: translateY(0);
  pointer-events: auto;
}

.sticky-download-bar__inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 12px 24px;
  background: rgba(15, 20, 30, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(240, 180, 41, 0.2);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
}

.sticky-download-bar__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50vw;
}

.sticky-download-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 10px 24px;
  background: var(--gradient-gold);
  color: #000;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  border-radius: var(--radius-full);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 2px 12px rgba(240, 180, 41, 0.3);
  flex-shrink: 0;
}

.sticky-download-bar__btn:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 20px rgba(240, 180, 41, 0.5);
}


.book-detail__download {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 16px 36px;
  background: var(--gradient-gold);
  color: #000;
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  box-shadow: 0 4px 20px rgba(240, 180, 41, 0.3);
  position: relative;
  overflow: hidden;
}

.book-detail__download::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.book-detail__download:hover::before {
  left: 100%;
}

.book-detail__download:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(240, 180, 41, 0.4);
}

/* ---- Countdown Download Button ---- */

.countdown-btn {
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.countdown-btn__icon {
  font-size: 1.1em;
}

.countdown-btn--active {
  background: linear-gradient(135deg, #1a1a2e, #16213e) !important;
  color: #f0b429 !important;
  box-shadow: 0 4px 30px rgba(240, 180, 41, 0.25), inset 0 0 20px rgba(240, 180, 41, 0.05) !important;
  animation: countdown-pulse 2s ease-in-out infinite;
  pointer-events: none;
  gap: var(--space-md) !important;
  padding: 14px 32px !important;
}

@keyframes countdown-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(240, 180, 41, 0.2), inset 0 0 20px rgba(240, 180, 41, 0.05); }
  50% { box-shadow: 0 4px 40px rgba(240, 180, 41, 0.45), inset 0 0 30px rgba(240, 180, 41, 0.1); }
}

.countdown-btn__timer {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.countdown-btn__ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.countdown-btn__ring-bg {
  fill: none;
  stroke: rgba(240, 180, 41, 0.15);
  stroke-width: 3;
}

.countdown-btn__ring-progress {
  fill: none;
  stroke: #f0b429;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 4px rgba(240, 180, 41, 0.6));
}

.countdown-btn__seconds {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
  font-weight: 700;
  color: #f0b429;
  font-variant-numeric: tabular-nums;
}

.countdown-btn__text--shimmer {
  background: linear-gradient(90deg, #f0b429 0%, #fff 40%, #f0b429 80%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer-text 2s ease-in-out infinite;
  font-size: 0.9rem;
}

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

.countdown-btn--ready {
  background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
  box-shadow: 0 4px 25px rgba(46, 204, 113, 0.4) !important;
  padding: 0 !important;
  overflow: hidden;
  animation: ready-celebrate 0.5s ease-out;
}

@keyframes ready-celebrate {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.countdown-btn__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 16px 36px;
  color: #fff;
  font-weight: 700;
  font-size: var(--text-base);
  text-decoration: none;
  width: 100%;
  height: 100%;
  justify-content: center;
}

.countdown-btn--ready:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 35px rgba(46, 204, 113, 0.5) !important;
}

/* =========================================
   CATEGORY PAGE
   ========================================= */
.category-header {
  margin-bottom: var(--space-2xl);
}

.category-header__title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.category-header__count {
  font-size: var(--text-base);
  color: var(--text-muted);
}

/* =========================================
   PAGINATION
   ========================================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-3xl);
}

.pagination__btn {
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  transition: all var(--transition-base);
  backdrop-filter: blur(6px);
}

.pagination__btn:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(240, 180, 41, 0.1);
}

.pagination__btn.active {
  background: var(--gradient-gold);
  color: #000;
  border-color: var(--accent-gold);
  font-weight: var(--font-bold);
  box-shadow: 0 0 20px rgba(240, 180, 41, 0.2);
}

.pagination__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* =========================================
   SIDEBAR
   ========================================= */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-2xl);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-xl));
}

.sidebar__section {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  transition: border-color var(--transition-base);
}

.sidebar__section:hover {
  border-color: var(--border-color-hover);
}

.sidebar__title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
}

.sidebar__book {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
}

.sidebar__book:last-child {
  border-bottom: none;
}

.sidebar__book:hover {
  background: rgba(255, 255, 255, 0.02);
  padding-left: var(--space-sm);
}

.sidebar__book-cover {
  width: 52px;
  height: 70px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

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

.sidebar__book-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar__book-author {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 3px;
}

/* Donate sidebar — special gradient glass */
.sidebar__donate {
  background: linear-gradient(135deg, rgba(240, 180, 41, 0.08), rgba(179, 136, 255, 0.06), rgba(79, 195, 247, 0.04));
  border-color: rgba(240, 180, 41, 0.15);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.sidebar__donate::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar__donate-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.7;
  position: relative;
}

.sidebar__donate-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  background: var(--gradient-gold);
  color: #000;
  font-weight: var(--font-bold);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  box-shadow: 0 4px 15px rgba(240, 180, 41, 0.25);
  position: relative;
  animation: pulseGlow 3s ease-in-out infinite;
}

.sidebar__donate-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 6px 25px rgba(240, 180, 41, 0.35);
}

/* =========================================
   SEARCH RESULTS
   ========================================= */
.search-results__query {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.search-results__query span {
  color: var(--accent-gold);
}

.search-results__count {
  color: var(--text-muted);
  margin-bottom: var(--space-2xl);
}

.search-results__empty {
  text-align: center;
  padding: var(--space-4xl);
  color: var(--text-muted);
}

.search-results__empty-icon {
  font-size: 5rem;
  margin-bottom: var(--space-lg);
  animation: float 3s ease-in-out infinite;
}

/* =========================================
   FOOTER — Dark glass with gradient top
   ========================================= */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-4xl);
  position: relative;
}

/* Gradient top line */
.footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold-glow), var(--accent-blue-glow), transparent);
}

.footer__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-xl) var(--space-xl);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer__title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

.footer__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  padding: 2px 0;
}

.footer__links a:hover {
  color: var(--accent-gold);
  padding-left: 6px;
}

.footer__donate-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--accent-rose), #e91e63);
  color: #fff;
  font-weight: var(--font-bold);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.2);
  animation: pulseGlow 3s ease-in-out infinite;
}

.footer__donate-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(255, 107, 157, 0.35);
}

.footer__bottom {
  text-align: center;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* =========================================
   MODAL — Frosted glass
   ========================================= */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
  animation: modalFadeIn 0.3s ease;
}

.modal__overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-modal-overlay);
  backdrop-filter: blur(8px);
}

.modal__content {
  position: relative;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl);
  max-width: 520px;
  width: 90%;
  animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-xl), var(--shadow-glow-gold);
}

.modal__close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  font-size: var(--text-2xl);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
}

.modal__close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.modal__title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.modal__desc {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  line-height: 1.7;
}

.modal__methods {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.modal__method {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--border-color);
  transition: border-color var(--transition-fast);
}

.modal__method:hover {
  border-color: var(--border-color-hover);
}

.modal__method h4 {
  font-size: var(--text-base);
  color: var(--accent-gold);
  margin-bottom: var(--space-sm);
}

.modal__method p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.modal__thanks {
  text-align: center;
  margin-top: var(--space-xl);
  font-size: var(--text-lg);
  color: var(--accent-gold);
  font-weight: var(--font-semibold);
}

/* =========================================
   BREADCRUMB
   ========================================= */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

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

.breadcrumb__sep {
  color: var(--text-muted);
  opacity: 0.4;
}

/* =========================================
   READING PROGRESS BAR
   ========================================= */
.progress-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient-gold);
  z-index: 999;
  transition: width 50ms linear;
  box-shadow: 0 0 8px var(--accent-gold-glow), 0 0 20px var(--accent-gold-glow);
}

/* =========================================
   BACK TO TOP BUTTON
   ========================================= */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.back-to-top:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: var(--shadow-glow-gold);
  transform: translateY(-4px);
}

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */
.toast-container {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  background: var(--bg-card-solid);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  white-space: nowrap;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast--success { border-color: rgba(105, 240, 174, 0.3); }
.toast--info { border-color: rgba(79, 195, 247, 0.3); }
.toast--warning { border-color: rgba(255, 183, 77, 0.3); }
.toast--error { border-color: rgba(239, 83, 80, 0.3); }

.toast__icon { font-size: 1rem; }
.toast__message { flex: 1; }

/* =========================================
   FILTER BAR (replaces sort toolbar)
   ========================================= */
.filter-bar {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.filter-bar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.filter-bar__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.filter-bar__count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: var(--font-normal);
}

.filter-bar__active-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--accent-gold);
  color: #000;
  font-size: 11px;
  font-weight: var(--font-bold);
  margin-left: var(--space-xs);
}

.filter-bar__reset {
  padding: 5px 14px;
  background: transparent;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: #ef4444;
  cursor: pointer;
  transition: all var(--transition-base);
  font-weight: var(--font-medium);
}

.filter-bar__reset:hover {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.5);
}

.filter-bar__groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.filter-bar__group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.filter-bar__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: var(--font-medium);
  min-width: 70px;
  white-space: nowrap;
}

.filter-bar__pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-bar__pill {
  padding: 5px 14px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  transition: all var(--transition-base);
  cursor: pointer;
  white-space: nowrap;
}

.filter-bar__pill:hover {
  border-color: var(--border-color-hover);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.filter-bar__pill.active {
  background: rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.35);
  color: var(--accent-gold);
}

.filter-bar__select {
  padding: 5px 30px 5px 12px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--transition-base);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.filter-bar__select:hover,
.filter-bar__select:focus {
  border-color: var(--border-color-hover);
  color: var(--text-primary);
  outline: none;
}

.filter-bar__select.active {
  background-color: rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.35);
  color: var(--accent-gold);
}

.filter-bar__select option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.filter-bar__divider {
  width: 100%;
  height: 1px;
  background: var(--border-color);
  margin: var(--space-xs) 0;
}

.filter-bar__result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-sm);
}

.filter-bar__result-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.filter-bar__result-text strong {
  color: var(--accent-gold);
  font-weight: var(--font-semibold);
}

/* Backward compat - old sort toolbar classes */
.sort-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-color);
}

.sort-toolbar__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: var(--font-medium);
  white-space: nowrap;
}

.sort-toolbar__btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  transition: all var(--transition-base);
  cursor: pointer;
  white-space: nowrap;
}

.sort-toolbar__btn:hover {
  border-color: var(--border-color-hover);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.sort-toolbar__btn.active {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.3);
  color: var(--accent-gold);
}

/* =========================================
   BOOK DETAIL ACTIONS (download + share row)
   ========================================= */
.book-detail__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.book-detail__share {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
  cursor: pointer;
}

.book-detail__share:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: var(--shadow-glow-blue);
}

/* =========================================
   HERO RANDOM BOOK BUTTON
   ========================================= */
.hero__random-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 32px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(218, 165, 32, 0.08));
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  border-radius: var(--radius-full);
  color: var(--accent-gold);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  backdrop-filter: blur(8px);
  letter-spacing: 0.3px;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.08);
}

.hero__random-btn:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(218, 165, 32, 0.15));
  border-color: rgba(255, 215, 0, 0.7);
  color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(212, 175, 55, 0.15);
}

/* =========================================
   BOOK DETAIL — BUY ORIGINAL SECTION
   ========================================= */
.book-detail__buy-original {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.06), rgba(218, 165, 32, 0.02));
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
}

.book-detail__buy-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.book-detail__buy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(218, 165, 32, 0.08));
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  border-radius: var(--radius-full);
  color: var(--accent-gold);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  transition: all var(--transition-base);
  letter-spacing: 0.3px;
}

.book-detail__buy-btn:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(218, 165, 32, 0.15));
  border-color: rgba(255, 215, 0, 0.7);
  color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.15);
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-lg);
  }
  .sidebar__section {
    margin-bottom: 0;
  }
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .header__nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    flex-direction: column;
    padding: var(--space-xl);
    gap: var(--space-sm);
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    overflow-y: auto;
    backdrop-filter: blur(20px);
  }
  .header__nav.active {
    transform: translateX(0);
  }
  .header__nav-link {
    font-size: var(--text-base);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
  }
  .header__hamburger {
    display: flex;
  }
  .header__search {
    display: none;
  }
  .hero {
    padding: var(--space-2xl) var(--space-lg);
    border-radius: var(--radius-lg);
  }
  .hero__title {
    font-size: var(--text-3xl);
  }
  .hero__stats {
    gap: var(--space-xl);
  }
  .hero__stat-number {
    font-size: var(--text-2xl);
  }
  .hero__stat::after {
    right: calc(var(--space-xl) / -2);
  }
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: var(--space-md);
  }
  .book-detail {
    grid-template-columns: 1fr;
  }
  .book-detail__cover {
    position: static;
    max-width: 260px;
    margin: 0 auto;
  }
  .book-detail__meta {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
  .book-detail__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .container {
    padding: var(--space-xl) var(--space-lg);
  }
  .sort-toolbar {
    gap: var(--space-xs);
  }
  .sort-toolbar__btn {
    padding: 4px 10px;
  }
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
  }
  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
    transform: none;
  }
  .toast {
    white-space: normal;
    border-radius: var(--radius-md);
  }
}

@media (max-width: 480px) {
  .container {
    padding: var(--space-lg) var(--space-md);
  }
  .hero {
    padding: var(--space-xl) var(--space-lg);
  }
  .hero__title {
    font-size: var(--text-2xl);
  }
  .hero__subtitle {
    font-size: var(--text-base);
  }
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
  .book-card__info {
    padding: var(--space-sm);
  }
  .book-card__title {
    font-size: var(--text-sm);
  }
  .section__title {
    font-size: var(--text-xl);
  }
}

/* =========================================
   HERO ACTIONS ROW
   ========================================= */
.hero__actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: var(--space-sm);
}

.hero__request-btn {
  padding: 14px 32px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--accent-gold);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.04);
  transition: all var(--transition-base);
  backdrop-filter: blur(8px);
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.hero__request-btn:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: rgba(255, 215, 0, 0.6);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.1);
  transform: translateY(-2px);
}

/* =========================================
   SIDEBAR — BOOK REQUEST SECTION
   ========================================= */
.sidebar__request {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.06), rgba(139, 92, 246, 0.06));
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.sidebar__request-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.sidebar__request-btn {
  display: block;
  width: 100%;
  padding: 10px 20px;
  background: linear-gradient(135deg, #0068ff, #0050c8);
  color: white;
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  border-radius: var(--radius-full);
  text-align: center;
  transition: all var(--transition-base);
  box-shadow: 0 4px 16px rgba(0, 104, 255, 0.25);
}

.sidebar__request-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 104, 255, 0.35);
}

/* =========================================
   MODAL — QR CODE STYLES
   ========================================= */
.modal__method--qr {
  text-align: center;
}

.modal__method--center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal__qr-img {
  max-width: 240px;
  max-height: 300px;
  width: 100%;
  border-radius: var(--radius-md);
  margin: var(--space-md) auto;
  display: block;
  background: white;
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  object-fit: contain;
}

.modal__qr-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-sm);
}

/* =========================================
   THEME TOGGLE BUTTON
   ========================================= */
.header__theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.08);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  color: var(--accent-gold);
  cursor: pointer;
  transition: all var(--transition-base);
  flex-shrink: 0;
  margin-left: var(--space-md);
}

.header__theme-toggle svg {
  width: 22px;
  height: 22px;
}

.header__theme-toggle:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(255, 215, 0, 0.6);
  color: #ffd700;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
  transform: rotate(15deg);
}

/* Dark mode: show moon, hide sun */
.theme-icon--sun { display: none; }
.theme-icon--moon { display: block; }

/* Light mode: show sun, hide moon */
[data-theme="light"] .theme-icon--sun { display: block; }
[data-theme="light"] .theme-icon--moon { display: none; }

/* =========================================
   LIGHT THEME SPECIFIC OVERRIDES
   ========================================= */
[data-theme="light"] .hero {
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .cover-art {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .book-card {
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .footer {
  background: #1a1a2e;
  color: #f1f5f9;
}

[data-theme="light"] .footer .footer__desc,
[data-theme="light"] .footer a {
  color: #94a3b8;
}

[data-theme="light"] .modal__content {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .sidebar__section {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .header__nav-link.active {
  background: rgba(184, 134, 11, 0.08);
}

/* Hide dark-mode ambient orbs and noise in light mode */
:root[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="light"] body::before,
html[data-theme="light"] body::after {
  opacity: 0;
  pointer-events: none;
}

html[data-theme="light"] #app::before {
  opacity: 0;
  pointer-events: none;
}

html[data-theme="light"] body {
  background: #f8f6f1;
}

/* Hero in light mode */
[data-theme="light"] .hero {
  background: linear-gradient(145deg, #f0ebe0, #e8e2d4);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .hero__title {
  color: #1a1a2e;
}

[data-theme="light"] .hero__title span {
  color: #b8860b;
}

[data-theme="light"] .hero__subtitle {
  color: #555568;
}

[data-theme="light"] .hero__stat-number {
  color: #1a1a2e;
}

[data-theme="light"] .hero__stat-label {
  color: #8888a0;
}

[data-theme="light"] .hero__cat-pill {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: #555568;
}

[data-theme="light"] .hero__random-btn {
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.1), rgba(184, 134, 11, 0.05));
  border-color: rgba(184, 134, 11, 0.4);
  color: #8b6914;
}

[data-theme="light"] .hero__request-btn {
  border-color: rgba(184, 134, 11, 0.3);
  color: #8b6914;
}

/* Header in light mode */
[data-theme="light"] .header {
  background: rgba(248, 246, 241, 0.9);
  backdrop-filter: blur(20px);
}

[data-theme="light"] .header__nav-link {
  color: #555568;
}

[data-theme="light"] .header__nav-link:hover {
  color: #b8860b;
}

[data-theme="light"] .header__search-input {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a2e;
}

/* Book cards in light mode */
[data-theme="light"] .book-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .book-card__title {
  color: #1a1a2e;
}

[data-theme="light"] .book-card__author {
  color: #555568;
}

/* Section titles */
[data-theme="light"] .section__title {
  color: #1a1a2e;
}

[data-theme="light"] .section__title::before {
  background: #b8860b;
}

/* Breadcrumb */
[data-theme="light"] .breadcrumb a {
  color: #555568;
}

/* Progress bar */
[data-theme="light"] .progress-bar {
  background: #b8860b;
}

/* Back to top */
[data-theme="light"] .back-to-top {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #1a1a2e;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Toast */
[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a2e;
  border-color: rgba(0, 0, 0, 0.1);
}

/* Book detail */
[data-theme="light"] .book-detail__meta {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

/* Pagination */
[data-theme="light"] .pagination__btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: #555568;
}

[data-theme="light"] .pagination__btn.active {
  background: #b8860b;
  color: white;
}

/* Sort toolbar */
[data-theme="light"] .sort-toolbar__btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: #555568;
}

[data-theme="light"] .sort-toolbar__btn.active {
  background: rgba(184, 134, 11, 0.1);
  border-color: rgba(184, 134, 11, 0.3);
  color: #b8860b;
}

/* Sidebar titles and text */
[data-theme="light"] .sidebar__title {
  color: #1a1a2e;
}

[data-theme="light"] .sidebar__desc {
  color: #555568;
}

[data-theme="light"] .sidebar__section p {
  color: #555568;
}

[data-theme="light"] .sidebar__section h3 {
  color: #1a1a2e;
}

/* Sidebar book lists (recent, recommended) */
[data-theme="light"] .sidebar__book-title,
[data-theme="light"] .sidebar__section a {
  color: #1a1a2e;
}

[data-theme="light"] .sidebar__book-author {
  color: #555568;
}

/* Sidebar category links */
[data-theme="light"] .sidebar__cat-link {
  color: #555568;
}

[data-theme="light"] .sidebar__cat-link:hover {
  color: #b8860b;
}

/* Cover art text overlay */
[data-theme="light"] .cover-art__title,
[data-theme="light"] .cover-art__author {
  color: #ffffff;
}

/* Book card rating */
[data-theme="light"] .book-card__rating {
  color: #8888a0;
}

/* Donate button in light mode */
[data-theme="light"] .sidebar__donate-btn {
  background: linear-gradient(135deg, #b8860b, #d4a017);
  color: #ffffff;
}

/* Header logo */
[data-theme="light"] .header__logo-text {
  color: #b8860b;
}

/* Book detail page */
[data-theme="light"] .book-detail__title {
  color: #1a1a2e;
}

[data-theme="light"] .book-detail__author {
  color: #555568;
}

[data-theme="light"] .book-detail__desc {
  color: #444;
}

[data-theme="light"] .book-detail__desc-fade {
  background: linear-gradient(to bottom, transparent, #f8f6f0);
}

[data-theme="light"] .sticky-download-bar__inner {
  background: rgba(248, 246, 240, 0.95);
  border-top-color: rgba(184, 134, 11, 0.2);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .sticky-download-bar__title {
  color: #1a1a2e;
}

[data-theme="light"] .book-detail__meta-value {
  color: #1a1a2e;
}

[data-theme="light"] .book-detail__meta-label {
  color: #8888a0;
}

[data-theme="light"] .book-detail__download {
  background: linear-gradient(135deg, #b8860b, #d4a017);
  color: #ffffff;
}

[data-theme="light"] .countdown-btn--active {
  background: linear-gradient(135deg, #f5f0e0, #ede4c8) !important;
  color: #8b6914 !important;
}

[data-theme="light"] .countdown-btn__ring-bg {
  stroke: rgba(139, 105, 20, 0.15);
}

[data-theme="light"] .countdown-btn__ring-progress {
  stroke: #b8860b;
  filter: drop-shadow(0 0 3px rgba(184, 134, 11, 0.5));
}

[data-theme="light"] .countdown-btn__seconds {
  color: #8b6914;
}

[data-theme="light"] .countdown-btn__text--shimmer {
  background: linear-gradient(90deg, #8b6914 0%, #d4a017 40%, #8b6914 80%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .book-detail__share {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: #555568;
}

[data-theme="light"] .book-detail__buy-original {
  background: linear-gradient(145deg, rgba(184, 134, 11, 0.06), rgba(184, 134, 11, 0.02));
  border-color: rgba(184, 134, 11, 0.2);
}

[data-theme="light"] .book-detail__buy-text {
  color: #555568;
}

/* Category badge */
[data-theme="light"] .book-detail__category {
  background: rgba(184, 134, 11, 0.08);
  color: #b8860b;
}

/* Breadcrumb */
[data-theme="light"] .breadcrumb {
  color: #8888a0;
}

/* Theme toggle in light mode */
[data-theme="light"] .header__theme-toggle {
  background: rgba(184, 134, 11, 0.08);
  border-color: rgba(184, 134, 11, 0.3);
  color: #b8860b;
}

/* Related books section title */
[data-theme="light"] .related-books__title {
  color: #1a1a2e;
}

/* Footer stays dark in light mode for contrast - already handled above */

/* =========================================
   RESPONSIVE — TABLET (max-width: 768px)
   ========================================= */
@media (max-width: 768px) {
  /* Prevent horizontal overflow */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Header */
  .header__container {
    padding: 0 var(--space-sm);
    gap: var(--space-xs);
  }

  .header__nav {
    display: none;
  }

  .header__search {
    display: none;
  }

  .header__logo-text {
    font-size: 1rem;
  }

  .header__theme-toggle {
    width: 40px;
    height: 40px;
    margin-left: auto;
  }

  .header__hamburger {
    display: flex;
  }

  /* Hero */
  .hero {
    padding: var(--space-lg) var(--space-md);
    margin: var(--space-sm);
    border-radius: var(--radius-lg);
  }

  .hero__title {
    font-size: 1.6rem;
  }

  .hero__desc {
    font-size: 0.9rem;
  }

  .hero__stats {
    gap: var(--space-md);
  }

  .hero__stat-number {
    font-size: 1.4rem;
  }

  .hero__categories {
    gap: var(--space-xs);
  }

  .hero__cat-btn {
    font-size: 0.75rem;
    padding: 6px 10px;
  }

  .hero__actions {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .hero__action-btn {
    width: 100%;
    justify-content: center;
  }

  /* Main Layout — stack sidebar below content */
  .main-layout {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding: 0 var(--space-sm);
  }

  /* Book Grid */
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  /* Section Titles */
  .section-title {
    font-size: 1.2rem;
    padding: 0 var(--space-sm);
  }

  /* Sidebar */
  .sidebar {
    position: static;
    width: 100%;
  }

  .sidebar__section {
    padding: var(--space-md);
  }

  /* Book Detail Page */
  .book-detail {
    padding: var(--space-sm);
  }

  .book-detail__header {
    flex-direction: column;
    gap: var(--space-md);
  }

  .book-detail__cover {
    width: 200px;
    margin: 0 auto;
  }

  .book-detail__info {
    text-align: center;
  }

  .book-detail__title {
    font-size: 1.4rem;
  }

  .book-detail__meta {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .book-detail__desc {
    font-size: 0.9rem;
    text-align: left;
  }

  .book-detail__actions {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .book-detail__download,
  .book-detail__share {
    width: 100%;
    justify-content: center;
  }

  .book-detail__buy-original {
    padding: var(--space-md);
  }

  /* Related Books */
  .related-books__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  /* Breadcrumb */
  .breadcrumb {
    padding: var(--space-sm);
    font-size: 0.8rem;
    flex-wrap: wrap;
  }

  /* Modal */
  .modal__content {
    width: 95%;
    margin: var(--space-sm);
    padding: var(--space-md);
    max-height: 90vh;
  }

  .modal__qr-grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer__container {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
    padding: var(--space-md);
  }

  /* Pagination */
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xs);
  }

  /* Sort toolbar */
  .sort-toolbar {
    flex-wrap: wrap;
    gap: var(--space-xs);
    padding: 0 var(--space-sm);
  }

  /* Back to top */
  .back-to-top {
    right: var(--space-sm);
    bottom: var(--space-sm);
  }

  /* Toast */
  .toast-container {
    left: var(--space-sm);
    right: var(--space-sm);
    bottom: var(--space-sm);
  }

  /* Cover Art */
  .cover-art__title {
    font-size: 0.85rem;
  }

  .cover-art__author {
    font-size: 0.7rem;
  }

  .cover-art__brand {
    font-size: 0.5rem;
  }
}

/* =========================================
   RESPONSIVE — PHONE (max-width: 480px)
   ========================================= */
@media (max-width: 480px) {
  /* Even smaller adjustments for phones */
  .hero {
    padding: var(--space-md) var(--space-sm);
    margin: var(--space-xs);
  }

  .hero__title {
    font-size: 1.3rem;
  }

  .hero__stats {
    flex-direction: row;
    justify-content: space-around;
  }

  .hero__stat-number {
    font-size: 1.2rem;
  }

  .hero__categories {
    justify-content: center;
  }

  /* Book Grid — 2 columns on small phones */
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .book-card__info {
    padding: var(--space-xs);
  }

  /* Book Detail */
  .book-detail__cover {
    width: 160px;
  }

  .book-detail__title {
    font-size: 1.2rem;
  }

  .book-detail__meta {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-detail__meta-value {
    font-size: 1rem;
  }

  /* Sidebar compact */
  .sidebar__book-item {
    gap: var(--space-xs);
  }

  /* Footer */
  .footer {
    font-size: 0.8rem;
  }
}

/* === Bookmark Button on Card === */
.book-card__bookmark {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
  z-index: 3;
  backdrop-filter: blur(6px);
}
.book-card:hover .book-card__bookmark {
  opacity: 1;
}
.book-card__bookmark.active {
  opacity: 1;
  background: rgba(240, 180, 41, 0.8);
}
.book-card__bookmark:hover {
  transform: scale(1.15);
}

/* === Save Button on Book Detail === */
.book-detail__save {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  background: var(--surface-alt);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
}
.book-detail__save:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.book-detail__save.active {
  background: rgba(240, 180, 41, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* === Search Autocomplete Dropdown === */
.header__search {
  position: relative;
}
.search-autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
  display: none;
}
.search-autocomplete.active {
  display: block;
}
.search-autocomplete__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition: background 0.15s;
  gap: var(--space-sm);
}
.search-autocomplete__item:hover {
  background: var(--surface-alt);
}
.search-autocomplete__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.search-autocomplete__title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-autocomplete__author {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.search-autocomplete__cat {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* === Reading List Nav Link === */
.header__nav-link--bookmark {
  color: var(--accent-primary) !important;
  font-weight: 600;
}

/* ==================== USER RATING SYSTEM ==================== */

.reviews-section {
  margin-top: var(--space-2xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--bg-tertiary);
}

.reviews-section__title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
}

/* Rating Summary */
.rating-summary {
  display: flex;
  gap: var(--space-2xl);
  align-items: flex-start;
  margin-bottom: var(--space-2xl);
  padding: var(--space-xl);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--bg-tertiary);
}

.rating-summary__big {
  text-align: center;
  min-width: 120px;
  flex-shrink: 0;
}

.rating-summary__number {
  font-size: 3rem;
  font-weight: var(--font-bold);
  color: var(--accent-gold);
  line-height: 1;
}

.rating-summary__stars {
  color: var(--accent-gold);
  font-size: var(--text-lg);
  margin-top: var(--space-xs);
}

.rating-summary__count {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-xs);
}

.rating-summary__bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rating-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.rating-bar__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  min-width: 28px;
  text-align: right;
}

.rating-bar__track {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.rating-bar__fill {
  height: 100%;
  background: var(--accent-gold);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.rating-bar__pct {
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 32px;
}

/* Star Input */
.rating-input {
  margin-bottom: var(--space-xl);
  padding: var(--space-xl);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--bg-tertiary);
}

.rating-input__label {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.rating-input__stars {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-md);
}

.rating-input__star {
  font-size: 2.2rem;
  cursor: pointer;
  color: var(--bg-tertiary);
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1;
}

.rating-input__star--filled {
  color: var(--accent-gold);
}

.rating-input__star:hover,
.rating-input__star--hover {
  color: var(--accent-gold);
  transform: scale(1.2);
  filter: drop-shadow(0 0 6px rgba(240, 180, 41, 0.5));
}

.rating-input__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.rating-input__textarea {
  width: 100%;
  min-height: 80px;
  padding: var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: var(--text-sm);
  resize: vertical;
  transition: border-color 0.2s;
}

.rating-input__textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.rating-input__textarea::placeholder {
  color: var(--text-muted);
}

.rating-input__actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.rating-input__submit {
  padding: var(--space-sm) var(--space-lg);
  background: var(--accent-gold);
  color: #000;
  border: none;
  border-radius: var(--radius-md);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.rating-input__submit:hover {
  background: #e6a817;
  transform: translateY(-1px);
}

.rating-input__submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.rating-input__delete {
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.rating-input__delete:hover {
  color: #ef4444;
  border-color: #ef4444;
}

/* User Review Card */
.review-card {
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--bg-tertiary);
  margin-top: var(--space-md);
}

.review-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.review-card__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.review-card__name {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.review-card__date {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-left: auto;
}

.review-card__stars {
  color: var(--accent-gold);
  font-size: var(--text-sm);
  margin-bottom: var(--space-sm);
}

.review-card__text {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* Badge on book cards */
.book-card__user-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent-gold);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 3px;
}

@media (max-width: 640px) {
  .rating-summary {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .rating-summary__big {
    min-width: unset;
  }
  .rating-summary__bars {
    width: 100%;
  }
}

/* =========================================
   STATIC PAGES (About, Contact)
   ========================================= */
.static-page {
  max-width: 800px;
  margin: 0 auto;
  animation: fadeIn 0.5s ease forwards;
}

.static-page__title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2xl);
  line-height: 1.3;
}

.static-page__content {
  color: var(--text-secondary);
  line-height: 1.85;
  font-size: var(--text-base);
}

.static-page__content p {
  margin-bottom: var(--space-lg);
}

.static-page__content h2 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.static-page__content ul {
  list-style: none;
  padding: 0;
  margin-bottom: var(--space-lg);
}

.static-page__content ul li {
  padding: var(--space-sm) 0;
  padding-left: var(--space-lg);
  position: relative;
}

.static-page__content ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--accent-gold);
  font-size: var(--text-sm);
}

.static-page__content strong {
  color: var(--text-primary);
}

.static-page__content em {
  color: var(--accent-gold);
  font-style: italic;
}

/* Contact Cards */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--transition-base);
}

.contact-card:hover {
  border-color: rgba(240, 180, 41, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 16px rgba(240, 180, 41, 0.08);
}

.contact-card__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.contact-card__title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.contact-card__desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.contact-card__link {
  display: inline-block;
  color: var(--accent-gold);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.contact-card__link:hover {
  text-shadow: 0 0 12px var(--accent-gold-glow);
}

.contact-card__link--btn {
  background: rgba(240, 180, 41, 0.1);
  border: 1px solid rgba(240, 180, 41, 0.3);
  border-radius: var(--radius-full);
  padding: 8px 20px;
  cursor: pointer;
  font-family: inherit;
}

.contact-card__link--btn:hover {
  background: rgba(240, 180, 41, 0.2);
}
