/* ===== India Library — Main Stylesheet ===== */

:root {
  /* Indian-inspired palette */
  --saffron: #FF9933;
  --saffron-light: #FFB366;
  --saffron-dark: #E68A2E;
  --green: #138808;
  --green-light: #1DA80E;
  --green-dark: #0D6006;
  --maroon: #800000;
  --maroon-light: #A52A2A;
  --gold: #FFD700;
  --gold-light: #FFE44D;
  --navy: #000080;
  --navy-light: #1A1A99;
  
  /* Neutrals */
  --cream: #FFF8F0;
  --ivory: #FFFFF0;
  --warm-white: #FEFCF7;
  --warm-gray: #8B7E74;
  --text: #2D1B0E;
  --text-light: #5C4A3A;
  --text-muted: #9B8B7A;
  --border: #E8DDD0;
  --card-bg: #FFFFFF;
  --shadow: rgba(45, 27, 14, 0.08);
  --shadow-hover: rgba(45, 27, 14, 0.15);
  
  /* Layout */
  --max-width: 1280px;
  --nav-height: 64px;
  --bottom-nav-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

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

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

body {
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav-height) + 16px);
  overflow-x: hidden;
}

/* Mandala background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(255, 153, 51, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(19, 136, 8, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(128, 0, 0, 0.02) 0%, transparent 40%);
  pointer-events: none;
  z-index: -1;
}

a { color: var(--maroon); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--saffron-dark); }

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

h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; color: var(--text); line-height: 1.3; }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ===== Top Navigation ===== */
.top-nav {
  background: linear-gradient(135deg, var(--maroon) 0%, #5C0000 100%);
  height: var(--nav-height);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.top-nav .container {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 20px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}

.nav-logo .logo-icon {
  font-size: 1.6rem;
}

.nav-logo .hindi-subtitle {
  font-size: 0.7rem;
  opacity: 0.85;
  font-family: 'Noto Sans Devanagari', 'Noto Sans', sans-serif;
  display: block;
  line-height: 1;
  margin-top: -2px;
}

.nav-search {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.nav-search input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  background: rgba(255,255,255,0.12);
  color: white;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s;
}

.nav-search input::placeholder { color: rgba(255,255,255,0.6); }
.nav-search input:focus {
  background: rgba(255,255,255,0.2);
  border-color: var(--saffron);
}

.nav-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
  color: white;
  background: rgba(255,255,255,0.15);
}

.lang-toggle {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Noto Sans', sans-serif;
}

.lang-toggle:hover { background: rgba(255,255,255,0.25); }

/* ===== Bottom Navigation (Mobile) ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: white;
  border-top: 1px solid var(--border);
  z-index: 100;
  box-shadow: 0 -2px 12px var(--shadow);
}

.bottom-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.bottom-nav-item .nav-icon { font-size: 1.4rem; }
.bottom-nav-item.active { color: var(--saffron-dark); }
.bottom-nav-item:hover { color: var(--saffron); }

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(135deg, var(--maroon) 0%, #5C0000 40%, #3D0000 100%);
  padding: 60px 0 50px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,153,51,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(19,136,8,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,215,0,0.2);
  border: 1px solid rgba(255,215,0,0.4);
  color: var(--gold);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  color: white;
  font-size: 3rem;
  margin-bottom: 8px;
}

.hero .hindi-title {
  font-family: 'Noto Sans Devanagari', 'Noto Sans', sans-serif;
  font-size: 1.5rem;
  opacity: 0.9;
  margin-bottom: 16px;
  font-weight: 400;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto 30px;
}

.hero-search {
  max-width: 560px;
  margin: 0 auto 30px;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 16px 56px 16px 24px;
  border: none;
  border-radius: 50px;
  font-size: 1.05rem;
  background: white;
  color: var(--text);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  outline: none;
}

.hero-search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--saffron);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-search button:hover { background: var(--saffron-dark); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 10px;
}

.hero-stat {
  text-align: center;
}

.hero-stat .number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
}

.hero-stat .label {
  font-size: 0.8rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== Decorative Divider ===== */
.mandala-divider {
  text-align: center;
  padding: 20px 0;
  color: var(--saffron);
  font-size: 1.2rem;
  opacity: 0.5;
  letter-spacing: 8px;
}

/* ===== Section Titles ===== */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 4px;
}

.section-title h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title h2 .emoji { font-family: inherit; }

.section-title .hindi-text {
  font-family: 'Noto Sans Devanagari', 'Noto Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 8px;
}

.section-title .view-all {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--saffron-dark);
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-title .view-all:hover { color: var(--maroon); }

/* ===== Category Pills ===== */
.categories {
  padding: 30px 0;
}

.category-pills {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar { display: none; }

.category-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.category-pill:hover, .category-pill.active {
  border-color: var(--saffron);
  background: rgba(255,153,51,0.08);
  color: var(--saffron-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.category-pill .pill-icon { font-size: 1.2rem; }

/* ===== Book Grid ===== */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
  padding: 4px;
}

.book-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

/* ===== Book Card ===== */
.book-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow-hover);
  color: var(--text);
}

.book-cover {
  position: relative;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, #F5EDE3 0%, #EDE3D5 100%);
  overflow: hidden;
}

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

.book-cover .placeholder-cover {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  background: linear-gradient(135deg, var(--maroon) 0%, #5C0000 100%);
  color: white;
}

.placeholder-cover .cover-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.2;
}

.placeholder-cover .cover-author {
  font-size: 0.75rem;
  opacity: 0.8;
}

.placeholder-cover .cover-ornament {
  font-size: 1.5rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.book-cover .language-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--green);
  color: white;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
}

.book-cover .format-badges {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}

.format-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  backdrop-filter: blur(4px);
}

.format-badge.epub { background: rgba(128,0,0,0.85); color: white; }
.format-badge.audio { background: rgba(255,153,51,0.9); color: white; }

.book-info {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-info .book-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-info .book-author {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.book-info .book-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.book-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--gold);
}

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

.free-badge {
  background: var(--green);
  color: white;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ===== Horizontal Scroll (Featured) ===== */
.scroll-row {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 4px 4px 20px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.scroll-row::-webkit-scrollbar { display: none; }

.scroll-row .book-card {
  flex: 0 0 180px;
  scroll-snap-align: start;
}

/* ===== Featured Book (Large Card) ===== */
.featured-hero-card {
  background: linear-gradient(135deg, var(--card-bg) 0%, #FFF5E6 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  gap: 32px;
  box-shadow: 0 4px 16px var(--shadow);
  margin-bottom: 40px;
  border: 1px solid rgba(255,153,51,0.2);
}

.featured-hero-card .featured-cover {
  flex: 0 0 200px;
  aspect-ratio: 2/3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.featured-hero-card .featured-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.featured-hero-card .featured-info h2 {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.featured-hero-card .featured-info .subtitle {
  font-family: 'Noto Sans Devanagari', 'Noto Sans', sans-serif;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.featured-hero-card .featured-info p {
  color: var(--text-light);
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-hero-card .action-buttons {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: 'Noto Sans', sans-serif;
}

.btn-primary {
  background: var(--saffron);
  color: white;
}
.btn-primary:hover {
  background: var(--saffron-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,153,51,0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--maroon);
  border: 2px solid var(--maroon);
}
.btn-secondary:hover {
  background: var(--maroon);
  color: white;
}

.btn-green {
  background: var(--green);
  color: white;
}
.btn-green:hover {
  background: var(--green-dark);
  color: white;
}

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }
.btn-icon { font-size: 1.1rem; }

/* ===== Book Detail Page ===== */
.book-detail {
  padding: 40px 0;
}

.book-detail-header {
  display: flex;
  gap: 40px;
  margin-bottom: 40px;
}

.book-detail-cover {
  flex: 0 0 280px;
}

.book-detail-cover .cover-wrapper {
  aspect-ratio: 2/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.book-detail-info {
  flex: 1;
}

.book-detail-info h1 {
  font-size: 2.2rem;
  margin-bottom: 4px;
}

.book-detail-info .hindi-title {
  font-family: 'Noto Sans Devanagari', 'Noto Sans', sans-serif;
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.book-detail-info .author-line {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.book-detail-info .author-line a { font-weight: 600; }

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-meta .meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255,153,51,0.08);
  border: 1px solid rgba(255,153,51,0.2);
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.book-description {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 28px;
  font-size: 1.05rem;
}

.book-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== Browse / Filter ===== */
.browse-page { padding: 30px 0; }

.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px var(--shadow);
}

.filter-bar select, .filter-bar input {
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: 'Noto Sans', sans-serif;
  background: white;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.filter-bar select:focus, .filter-bar input:focus {
  border-color: var(--saffron);
}

.filter-bar input { flex: 1; min-width: 200px; }

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

/* ===== Audiobook Player ===== */
.listen-page {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--maroon) 0%, #3D0000 100%);
  color: white;
  padding-bottom: 100px;
}

.listen-hero {
  text-align: center;
  padding: 60px 20px 40px;
}

.listen-cover {
  width: 250px;
  height: 250px;
  margin: 0 auto 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}

.listen-title { font-size: 1.8rem; margin-bottom: 4px; color: white; }
.listen-author { opacity: 0.7; margin-bottom: 24px; }

.audio-progress {
  max-width: 500px;
  margin: 0 auto 12px;
  padding: 0 20px;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--saffron);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.progress-bar-container:hover .progress-bar-fill { background: var(--gold); }

.time-display {
  display: flex;
  justify-content: space-between;
  max-width: 500px;
  margin: 0 auto 24px;
  padding: 0 20px;
  font-size: 0.8rem;
  opacity: 0.6;
}

.audio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}

.audio-controls button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.audio-controls button:hover { transform: scale(1.1); }
.audio-controls .skip-btn { font-size: 1.3rem; opacity: 0.8; }
.audio-controls .skip-btn:hover { opacity: 1; }

.play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--saffron) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 20px rgba(255,153,51,0.4);
}

.play-btn:hover {
  background: var(--saffron-dark) !important;
  box-shadow: 0 6px 24px rgba(255,153,51,0.6);
}

.speed-control {
  text-align: center;
}

.speed-btn {
  background: rgba(255,255,255,0.15) !important;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
}

.speed-btn:hover { background: rgba(255,255,255,0.25) !important; }

/* ===== Library Page ===== */
.library-page { padding: 30px 0; }

.library-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 30px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: 0 2px 8px var(--shadow);
}

.library-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  font-family: 'Noto Sans', sans-serif;
}

.library-tab.active {
  background: var(--saffron);
  color: white;
}

.library-tab:hover:not(.active) {
  color: var(--text);
  background: rgba(255,153,51,0.08);
}

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

.empty-state .empty-icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { color: var(--text-light); margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }

/* ===== Profile Page ===== */
.profile-page { padding: 30px 0; }

.profile-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 4px 16px var(--shadow);
  text-align: center;
  margin-bottom: 30px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--saffron), var(--maroon));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 2rem;
  color: white;
}

.library-card-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 16px var(--shadow);
}

.library-card-visual {
  background: linear-gradient(135deg, var(--maroon) 0%, var(--saffron-dark) 100%);
  border-radius: var(--radius);
  padding: 24px;
  color: white;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.library-card-visual::after {
  content: '❋';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 6rem;
  opacity: 0.1;
}

.library-card-visual .card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.7;
  margin-bottom: 4px;
}

.library-card-visual .card-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.library-card-visual .card-number {
  font-size: 1.1rem;
  letter-spacing: 3px;
  font-family: monospace;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.stat-card {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.stat-card .stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--saffron-dark);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== Footer ===== */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 30px;
}

.footer h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 12px;
}

.footer p { font-size: 0.85rem; line-height: 1.7; }
.footer a { color: var(--saffron-light); }
.footer a:hover { color: var(--saffron); }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.footer-links a:hover { color: var(--saffron-light); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

/* ===== 404 Page ===== */
.not-found {
  text-align: center;
  padding: 80px 20px;
}

.not-found .error-code {
  font-family: 'Playfair Display', serif;
  font-size: 8rem;
  color: var(--saffron);
  opacity: 0.3;
  line-height: 1;
}

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

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  body { padding-bottom: calc(var(--bottom-nav-height) + 20px); }
  
  .bottom-nav { display: block; }
  .nav-links { display: none; }
  .lang-toggle { display: none; }
  
  .hero { padding: 40px 0 30px; }
  .hero h1 { font-size: 2rem; }
  .hero .hindi-title { font-size: 1.1rem; }
  .hero p { font-size: 1rem; }
  .hero-stats { gap: 24px; }
  .hero-stat .number { font-size: 1.2rem; }
  
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
  }
  
  .featured-hero-card {
    flex-direction: column;
    padding: 20px;
    text-align: center;
  }
  
  .featured-hero-card .featured-cover {
    flex: none;
    width: 160px;
    margin: 0 auto;
  }
  
  .featured-hero-card .action-buttons {
    justify-content: center;
  }
  
  .book-detail-header {
    flex-direction: column;
    gap: 24px;
  }
  
  .book-detail-cover { flex: none; max-width: 200px; margin: 0 auto; }
  .book-detail-info { text-align: center; }
  .book-actions { justify-content: center; }
  .detail-meta { justify-content: center; }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  
  .filter-bar { flex-direction: column; }
  .filter-bar input { min-width: auto; }
  
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card { padding: 12px 8px; }
  .stat-card .stat-number { font-size: 1.2rem; }
  
}

@media (max-width: 480px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .scroll-row .book-card { flex: 0 0 150px; }
  
  .nav-search { display: none; }
  
  .hero-search input { padding: 14px 50px 14px 20px; font-size: 0.95rem; }
  
  .listen-cover { width: 200px; height: 200px; }
  .listen-title { font-size: 1.4rem; }
}

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

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

/* ===== Auth Pages ===== */
.auth-page {
  min-height: calc(100vh - var(--nav-height) - var(--bottom-nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}

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

.auth-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.auth-header h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-light);
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.auth-form input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: all 0.2s;
  background: var(--warm-white);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px rgba(128, 0, 0, 0.1);
}

.error-message {
  background: #FFF0F0;
  border: 1px solid #FFCCCC;
  color: #CC0000;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.btn-full {
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: white;
  color: #333;
  border: 2px solid #ddd;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-google:hover {
  border-color: #4285F4;
  box-shadow: 0 2px 8px rgba(66,133,244,0.2);
}
.auth-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: #888;
  font-size: 0.875rem;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #ddd;
}
.auth-divider span {
  padding: 0 16px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.auth-footer a {
  font-weight: 600;
  color: var(--maroon);
}

.auth-benefits {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255,153,51,0.08) 0%, rgba(19,136,8,0.08) 100%);
  border-radius: var(--radius-sm);
}

.auth-benefits h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.auth-benefits ul {
  list-style: none;
}

.auth-benefits li {
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ===== Nav User Avatar ===== */
.nav-user {
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--saffron);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--maroon);
}

.nav-btn-login {
  background: rgba(255,255,255,0.2) !important;
  border: 1px solid rgba(255,255,255,0.3);
}

.bottom-nav .user-icon {
  width: 24px;
  height: 24px;
  background: var(--saffron);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--maroon);
}

/* ===== Library Page ===== */
.library-page {
  padding: 30px 0;
}

.page-header {
  text-align: center;
  margin-bottom: 30px;
}

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

.page-header p {
  color: var(--text-light);
}

.empty-library {
  text-align: center;
  padding: 60px 20px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px var(--shadow);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.empty-library h2 {
  margin-bottom: 12px;
}

.empty-library p {
  color: var(--text-light);
  margin-bottom: 24px;
}

.library-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 30px;
}

.library-stats .stat-card {
  background: var(--card-bg);
  padding: 20px 32px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 2px 8px var(--shadow);
}

.library-stats .stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--maroon);
}

.library-stats .stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
}

.section-heading {
  font-size: 1.3rem;
  margin: 30px 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.library-card .progress-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  display: flex;
  justify-content: center;
}

.progress-circle {
  position: relative;
  width: 44px;
  height: 44px;
}

.progress-circle svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.progress-bg {
  fill: none;
  stroke: rgba(255,255,255,0.3);
  stroke-width: 3;
}

.progress-fill {
  fill: none;
  stroke: var(--saffron);
  stroke-width: 3;
  stroke-linecap: round;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
}

.continue-badge {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--maroon);
  font-weight: 600;
}

.completed .completed-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ===== Profile Page ===== */
.profile-page {
  padding: 40px 0;
  max-width: 600px;
  margin: 0 auto;
}

.profile-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px var(--shadow);
  padding: 40px;
  text-align: center;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--saffron) 0%, var(--maroon) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  margin: 0 auto 16px;
}

.profile-card h1 {
  margin-bottom: 4px;
}

.profile-card .email {
  color: var(--text-light);
  margin-bottom: 24px;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.profile-stat {
  text-align: center;
}

.profile-stat .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--maroon);
}

.profile-stat .stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
}

.profile-actions {
  margin-top: 24px;
}

.action-card {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 2px solid var(--border);
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: all 0.2s;
}

.action-card:hover {
  border-color: var(--maroon);
  box-shadow: 0 4px 12px var(--shadow);
}

.action-icon {
  font-size: 1.5rem;
  margin-right: 16px;
}

.action-text {
  flex: 1;
  font-weight: 500;
  color: var(--text);
}

.action-arrow {
  color: var(--text-muted);
}

.profile-section {
  margin-top: 32px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 2px 8px var(--shadow);
}

.profile-section h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.preference-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preference-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preference-item label {
  color: var(--text-light);
}

.preference-item select {
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--warm-white);
  min-width: 150px;
}

/* ===== Book Detail Enhancements ===== */
.cover-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.reading-progress-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--saffron);
  color: var(--maroon);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn.in-library {
  background: var(--green) !important;
  color: white !important;
}


/* Responsive Auth/Profile */
@media (max-width: 768px) {
  .auth-card {
    padding: 30px 24px;
  }
  
  .library-stats {
    flex-wrap: wrap;
  }
  
  .library-stats .stat-card {
    padding: 16px 24px;
  }
  
  .profile-stats {
    gap: 24px;
  }
}

/* Lucide Icons */
[data-lucide] {
  width: 1em;
  height: 1em;
  stroke-width: 2;
  vertical-align: -0.125em;
  display: inline-block;
}

.inline-icon {
  width: 0.9em;
  height: 0.9em;
  color: #e11d48;
}

.btn [data-lucide],
.meta-tag [data-lucide] {
  margin-right: 0.35em;
}

.section-heading [data-lucide],
h1 [data-lucide],
h2 [data-lucide] {
  margin-right: 0.5em;
  opacity: 0.8;
}

.format-badge [data-lucide] {
  width: 14px;
  height: 14px;
}

.star [data-lucide] {
  color: #f59e0b;
  fill: #f59e0b;
}
