/* ===============================
   ROOT VARIABLES
=================================*/
:root {
  --primary: #6366f1;
  --gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
  --bg: #f3f4f6;
  --card: rgba(255, 255, 255, 0.7);
  --text: #111827;
  --border: rgba(0,0,0,0.06);
}

body.dark {
  --bg: #0f172a;
  --card: rgba(30, 41, 59, 0.85);
  --text: #f1f5f9;
  --border: rgba(255,255,255,0.06);
}

/* ===============================
   GLOBAL
=================================*/
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: 0.3s ease;
}

/* ===============================
   CONTAINER
=================================*/
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===============================
   HEADER STYLES
=================================*/
.header {
  background: var(--card);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: 0.3s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: 0.3s ease;
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
}

.logo:hover {
  transform: translateY(-2px);
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
  transition: 0.3s ease;
}

.logo:hover .logo-icon {
  transform: rotate(-5deg) scale(1.1);
}

.logo-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  gap: 32px;
  margin-left: auto;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  position: relative;
  transition: 0.3s ease;
  opacity: 0.8;
  white-space: nowrap;
}

.nav-dark-btn {
  margin-left: 12px;
  padding: 8px;
  width: 40px;
  height: 40px;
}

.nav-link:hover {
  opacity: 1;
  color: var(--primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.dark-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: rgba(99, 102, 241, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s ease;
  color: var(--primary);
  position: relative;
}

.dark-btn:hover {
  background: var(--primary);
  color: white;
  transform: rotate(20deg);
}

.sun-icon,
.moon-icon {
  width: 20px;
  height: 20px;
  position: absolute;
  transition: 0.3s ease;
}

.sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.moon-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.8);
}

body.dark .sun-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.8);
}

body.dark .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Mobile header */
@media (max-width: 768px) {
  .nav {
    display: none !important;
  }

  .header-flex {
    padding: 14px 0;
    gap: 12px;
  }

  .logo-text {
    font-size: 16px;
  }

  .mobile-menu-btn {
    display: flex !important;
    margin-left: auto;
  }
}

@media (max-width: 480px) {
  .logo-text {
    font-size: 14px;
  }

  .mobile-menu-btn {
    width: 40px;
    height: 40px;
  }

  .mobile-menu-btn span {
    width: 18px;
    height: 2px;
  }

  .dark-btn {
    width: 40px;
    height: 40px;
  }
}

.mobile-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: rgba(99, 102, 241, 0.1);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--primary);
  transition: 0.3s ease;
}

.mobile-menu-btn:hover {
  background: var(--primary);
  color: white;
}

.mobile-menu-btn span {
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* Mobile Menu */
.mobile-nav {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  z-index: 101;
  flex-direction: column;
  gap: 0;
  padding: 0;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  animation: slideDown 0.3s ease;
}

.mobile-nav.active {
  display: flex;
}

.mobile-nav a {
  padding: 14px 20px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: 0.3s ease;
  font-weight: 500;
}

.mobile-nav a:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
  color: var(--primary);
  padding-left: 24px;
}

.mobile-nav a.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
  color: var(--primary);
  font-weight: 600;
  border-left: 4px solid var(--primary);
  padding-left: 16px;
}

/* ===============================
   FOOTER STYLES
=================================*/
.footer {
  background: var(--card);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 60px 0 30px;
  color: var(--text);
  transition: 0.3s ease;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-description {
  font-size: 14px;
  opacity: 0.8;
  line-height: 1.6;
  margin: 0;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s ease;
  font-size: 16px;
}

.social-link:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-4px);
}

.footer-heading {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  opacity: 0.8;
  transition: 0.3s ease;
  display: inline-block;
}

.footer-links a:hover {
  opacity: 1;
  color: var(--primary);
  transform: translateX(4px);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-bottom p {
  margin: 0;
  font-size: 14px;
  opacity: 0.8;
}

.footer-credit {
  font-style: italic;
  color: var(--primary);
  font-size: 13px;
}

/* Mobile footer */
@media (max-width: 768px) {
  .footer {
    padding: 40px 0 20px;
    margin-top: 40px;
  }

  .footer-content {
    gap: 30px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-bottom p {
    margin: 0;
  }
}

/* ===============================
   HEADER CONTROLS
=================================*/
.top-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px;
  justify-content: center;
}

.top-controls input,
.top-controls select,
.top-controls button {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  font-size: 14px;
  min-width: 130px;
}

body.dark .top-controls input,
body.dark .top-controls select {
  background: #1e293b;
  color: white;
}

/* Mobile stack */
@media (max-width: 600px) {
  .top-controls {
    flex-direction: column;
  }

  .top-controls input,
  .top-controls select,
  .top-controls button {
    width: 100%;
  }
}

/* ===============================
   BOOK GRID
=================================*/
#booksContainer {
  display: grid;
  gap: 24px;
  padding: 25px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

@media (max-width: 768px) {
  #booksContainer {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px;
  }
}

@media (max-width: 480px) {
  #booksContainer {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px;
  }
}

/* ===============================
   BOOK CARD
=================================*/
.book-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 18px;
  text-align: center;
  border: 1px solid var(--border);
  transition: 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.book-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.book-card img {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 12px;
}

.book-card h4 {
  margin: 8px 0;
  font-size: 15px;
}

.book-card small {
  opacity: 0.7;
  font-size: 12px;
}

/* Mobile responsive book cards */
@media (max-width: 768px) {
  .book-card {
    padding: 14px;
    border-radius: 14px;
  }

  .book-card h4 {
    font-size: 13px;
    margin: 6px 0;
  }

  .book-card small {
    font-size: 11px;
  }

  .book-card img {
    border-radius: 10px;
    margin-bottom: 10px;
  }
}

@media (max-width: 480px) {
  .book-card {
    padding: 12px;
    border-radius: 12px;
  }

  .book-card h4 {
    font-size: 14px;
    margin: 6px 0;
    line-height: 1.3;
  }

  .book-card small {
    font-size: 11px;
  }

  .book-card img {
    border-radius: 8px;
    margin-bottom: 8px;
  }
}

.card-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.card-buttons button,
.card-buttons a {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: var(--gradient);
  color: white;
  font-size: 13px;
  transition: 0.3s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-buttons button:hover,
.card-buttons a:hover {
  transform: scale(1.05);
}

/* Mobile responsive buttons */
@media (max-width: 768px) {
  .card-buttons {
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
  }

  .card-buttons button,
  .card-buttons a {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .card-buttons button:active,
  .card-buttons a:active {
    transform: scale(0.98);
  }
}

@media (max-width: 480px) {
  .card-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .card-buttons button {
    padding: 12px 10px;
    font-size: 13px;
    min-height: 44px;
  }
}

/* ===============================
   PAGINATION
=================================*/
/* ===============================
   PROFESSIONAL PAGINATION
=================================*/
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 30px 20px;
}

.pagination button {
  min-width: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: white;
  border: 1px solid rgba(0,0,0,0.1);
  transition: 0.3s;
}

body.dark .pagination button {
  background: #1e293b;
  color: white;
  border: 1px solid rgba(255,255,255,0.1);
}

.pagination button:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

.pagination button.active {
  background: var(--gradient);
  color: white;
  font-weight: 600;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .dots {
  padding: 0 6px;
  font-weight: bold;
  opacity: 0.6;
}


/* ===============================
   MODAL BASE
=================================*/
.modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
}

/* ===============================
   MODAL CONTENT
=================================*/
.modal-content {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 22px;
  background: var(--card);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border);
  animation: fadeUp 0.4s ease;
  z-index: 2;
}

/* Smooth modal animation */
@keyframes fadeUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===============================
   MODAL HERO
=================================*/
.modal-hero {
  position: relative;
  min-height: 220px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(20px);
  transform: scale(1.2);
}

.hero-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  color: white;
}

/* Mobile hero stacking */
@media (max-width: 600px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .modal-cover {
    width: 110px;
  }
}

.modal-cover {
  width: 130px;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.hero-info h2 {
  margin-bottom: 6px;
}

.hero-info p {
  opacity: 0.9;
  margin-bottom: 12px;
}

/* ===============================
   DOWNLOAD BUTTON
=================================*/
.download-btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  background: #ff9800;
  color: white;
  transition: 0.3s;
}

.download-btn:hover {
  background: #e68900;
  transform: scale(1.05);
}

/* ===============================
   CHAPTER GRID
=================================*/
.chapters-wrapper {
  padding: 22px;
}

.chapters-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.chapter-card {
  display: block;
  padding: 12px;
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  background: rgba(0,0,0,0.05);
  color: var(--text);
  font-size: 14px;
  transition: 0.3s;
}

.chapter-card:hover {
  background: var(--gradient);
  color: white;
  transform: translateY(-4px);
}

/* ===============================
   CLOSE BUTTON
=================================*/
.close-btn {
  position: absolute;
  top: 15px;
  right: 18px;
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
  color: white;
  z-index: 5;
}

/* ===============================
   SCROLLBAR STYLING
=================================*/
.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

/* ===============================
   HERO SECTION
=================================*/
.hero {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--border);
  animation: slideDown 0.6s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1 {
  font-size: 48px;
  margin: 0 0 16px 0;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  line-height: 1.2;
}

.hero p {
  font-size: 18px;
  margin: 0 0 40px 0;
  opacity: 0.8;
  max-width: 600px;
}

.search-area {
  display: grid;
  grid-template-columns: 1fr 180px 180px;
  gap: 12px;
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.search-area input,
.search-area select {
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  transition: 0.3s ease;
  backdrop-filter: blur(10px);
}

.search-area input:focus,
.search-area select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Search Toggle Button (Mobile) */
.search-toggle {
  display: none;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--gradient);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s ease;
  margin-top: 20px;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.search-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.search-toggle.active {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
}

.toggle-icon {
  transition: transform 0.3s ease;
  display: inline-block;
}

.search-toggle.active .toggle-icon {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .search-toggle {
    display: flex;
  }

  .search-area {
    grid-template-columns: 1fr;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    margin-top: 0;
    gap: 10px;
  }

  .search-area.active {
    max-height: 500px;
    opacity: 1;
    margin-top: 12px;
  }

  .search-area input,
  .search-area select {
    padding: 12px 14px;
    font-size: 14px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero p {
    font-size: 16px;
  }
}

/* ===============================
   BOOKS CONTAINER
=================================*/
main {
  padding: 60px 0;
}

#booksContainer {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 768px) {
  #booksContainer {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
  }
}

/* ===============================
   BOOK CARD ENHANCED
=================================*/
.book-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient);
  opacity: 0;
  transition: 0.3s ease;
  z-index: 0;
}

.book-card:hover::before {
  left: 0;
  opacity: 0.05;
}

.book-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
}

.book-card > * {
  position: relative;
  z-index: 1;
}

.book-card img {
  width: 100%;
  aspect-ratio: 65/93;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 14px;
  transition: 0.3s ease;
}

.book-card:hover img {
  transform: scale(1.05);
}

.book-card h4 {
  margin: 12px 0 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.book-card small {
  opacity: 0.7;
  font-size: 13px;
  margin-bottom: 12px;
}

.card-buttons {
  display: flex;
  gap: 8px;
  margin-top: auto;
  flex-direction: column;
}

.card-buttons button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: var(--gradient);
  color: white;
  font-size: 13px;
  font-weight: 600;
  transition: 0.3s ease;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.card-buttons button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.card-buttons button:active {
  transform: scale(0.98);
}

/* ===============================
   STATS SECTION
=================================*/
.stats-section {
  background: linear-gradient(135deg, var(--gradient));
  padding: 80px 0;
  margin: 60px 0;
  border-radius: 24px;
  margin-left: 20px;
  margin-right: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  align-items: stretch;
}

.stat-card {
  background: rgb(24 24 86);
  backdrop-filter: blur(10px);
  padding: 30px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  text-align: center;
  color: #ffffff;
  transition: 0.3s ease;
  animation: slideUp 0.6s ease forwards;
  opacity: 0;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.stat-card:hover {
  transform: translateY(-8px);
  background: rgb(24, 86, 60);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.stat-number {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #ffffff;
}

.stat-label {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #ffffff;
}

.stat-desc {
  font-size: 14px;
  opacity: 0.95;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
}

@media (max-width: 768px) {
  .stats-section {
    padding: 50px 20px;
    margin: 40px 0;
    border-radius: 16px;
    margin-left: 0;
    margin-right: 0;
  }

  .stat-number {
    font-size: 32px;
  }
}

/* ===============================
   FEATURES SECTION
=================================*/
.features-section {
  padding: 80px 0;
  margin: 60px 0;
}

.section-title {
  font-size: 42px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 60px 0;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.feature-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  padding: 40px 30px;
  border-radius: 16px;
  border: 1px solid var(--border);
  text-align: center;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: scaleIn 0.6s ease forwards;
  opacity: 0;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

.feature-card:hover {
  transform: translateY(-12px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 20px;
  display: inline-block;
}

.feature-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px 0;
}

.feature-card p {
  margin: 0;
  opacity: 0.8;
  font-size: 15px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .section-title {
    font-size: 32px;
    margin-bottom: 40px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* ===============================
   TESTIMONIALS SECTION
=================================*/
.testimonials-section {
  padding: 80px 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  margin: 60px -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.testimonial-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  padding: 30px;
  border-radius: 16px;
  border: 1px solid var(--border);
  transition: 0.3s ease;
  animation: testimonialIn 0.6s ease forwards;
  opacity: 0;
}

@keyframes testimonialIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.testimonial-card:nth-child(1) { animation-delay: 0.1s; }
.testimonial-card:nth-child(2) { animation-delay: 0.2s; }
.testimonial-card:nth-child(3) { animation-delay: 0.3s; }

.testimonial-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(99, 102, 241, 0.1);
}

.stars {
  color: #fbbf24;
  font-size: 16px;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.testimonial-card p {
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 20px 0;
  font-style: italic;
  opacity: 0.9;
}

.testimonial-author {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.testimonial-author strong {
  font-weight: 600;
  color: var(--primary);
}

.testimonial-author small {
  opacity: 0.7;
  font-size: 13px;
}

@media (max-width: 768px) {
  .testimonials-section {
    padding: 60px 0;
    margin: 40px -20px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }
}

/* ===============================
   CTA SECTION
=================================*/
.cta-section {
  padding: 80px 0;
  background: var(--gradient);
  border-radius: 24px;
  margin: 60px 0;
  text-align: center;
  color: white;
}

.cta-content h2 {
  font-size: 42px;
  font-weight: 800;
  margin: 0 0 16px 0;
}

.cta-content p {
  font-size: 18px;
  margin: 0 0 30px 0;
  opacity: 0.95;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-button {
  padding: 14px 40px;
  border: none;
  background: white;
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.3s ease;
}

.cta-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .cta-section {
    padding: 50px 20px;
    border-radius: 16px;
    margin: 40px 0;
  }

  .cta-content h2 {
    font-size: 32px;
  }

  .cta-content p {
    font-size: 16px;
  }
}

/* ===============================
   NEWSLETTER SECTION
=================================*/
.newsletter-section {
  padding: 80px 0;
}

.newsletter-content {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 50px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.newsletter-content h3 {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 12px 0;
}

.newsletter-content p {
  font-size: 16px;
  opacity: 0.8;
  margin: 0 0 30px 0;
}

.newsletter-form {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.newsletter-form input {
  flex: 1;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  transition: 0.3s ease;
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.newsletter-form button {
  padding: 12px 30px;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s ease;
}

.newsletter-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.newsletter-content small {
  opacity: 0.7;
  font-size: 13px;
}

@media (max-width: 768px) {
  .newsletter-section {
    padding: 60px 0;
  }

  .newsletter-content {
    padding: 40px 20px;
  }

  .newsletter-content h3 {
    font-size: 24px;
  }

  .newsletter-form {
    flex-direction: column;
  }
}

/* ===============================
   PAGINATION ENHANCED
=================================*/
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 40px 20px;
  margin: 40px 0;
}

.pagination button {
  min-width: 40px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s ease;
}

.pagination button:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
}

.pagination button.active {
  background: var(--gradient);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 6px 12px rgba(99, 102, 241, 0.3);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .dots {
  padding: 0 8px;
  font-weight: bold;
  opacity: 0.6;
}

/* ===============================
   SCROLL ANIMATIONS
=================================*/
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Utility animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
  50% { box-shadow: 0 0 30px rgba(99, 102, 241, 0.5); }
}

/* Loading state */
.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ===============================
   RESPONSIVE ADJUSTMENTS
=================================*/
@media (max-width: 1024px) {
  .hero h1 {
    font-size: 40px;
  }

  .section-title {
    font-size: 36px;
  }

  .cta-content h2 {
    font-size: 36px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 40px 0 30px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero p {
    font-size: 15px;
  }

  .search-toggle {
    margin-top: 16px;
    padding: 11px 14px;
    font-size: 13px;
  }

  .search-area {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .search-area input,
  .search-area select {
    padding: 11px 12px;
    font-size: 13px;
  }

  #booksContainer {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .feature-card {
    padding: 24px 16px;
  }

  .feature-icon {
    font-size: 36px;
  }

  .newsletter-content {
    padding: 30px 16px;
  }
}

/* ===============================
   PAGE STYLES
=================================*/
.page-hero {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
  padding: 60px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-size: 42px;
  font-weight: 800;
  margin: 0 0 12px 0;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-hero p {
  font-size: 16px;
  margin: 0;
  opacity: 0.8;
}

.page-content {
  padding: 60px 0;
}

/* Breadcrumb Navigation */
.breadcrumb {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  font-size: 14px;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  transition: 0.3s ease;
}

.breadcrumb a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.breadcrumb {
  opacity: 0.8;
}

/* ===============================
   ABOUT PAGE STYLES
=================================*/
.about-section {
  margin-bottom: 50px;
}

.about-section h2 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 20px 0;
  color: var(--text);
}

.about-section p {
  font-size: 16px;
  line-height: 1.8;
  opacity: 0.9;
  margin: 0 0 15px 0;
}

.about-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.about-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  line-height: 1.6;
}

.about-list li:last-child {
  border-bottom: none;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.about-card {
  background: var(--card);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-align: center;
  transition: 0.3s ease;
}

.about-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.1);
}

.about-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: var(--primary);
}

.about-card p {
  margin: 0;
  opacity: 0.8;
}

.impact-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.impact-stat {
  background:rgb(24 24 86);
  color: white;
  padding: 30px 20px;
  border-radius: 12px;
  text-align: center;
}

.impact-stat strong {
  display: block;
  font-size: 32px;
  margin-bottom: 8px;
}

.impact-stat p {
  margin: 0;
  opacity: 0.9;
}

/* ===============================
   FAQ PAGE STYLES
=================================*/
.faq-section {
  margin-bottom: 50px;
}

.faq-section h2 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 30px 0;
}

.faq-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: 0.3s ease;
  margin: 20px 0;
}

.faq-question {
  padding: 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.3s ease;
  background: var(--card);
}

.faq-question:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
}

.faq-question h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  flex: 1;
}

.faq-toggle {
  font-size: 24px;
  color: var(--primary);
  font-weight: bold;
  margin-left: 20px;
}

.faq-answer {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: 0.3s ease;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, transparent 100%);
}

.faq-item.open .faq-answer {
  padding: 20px;
  max-height: 1000px;
}

.faq-answer p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.9;
}

/* ===============================
   CONTACT PAGE STYLES
=================================*/
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  margin-top: 40px;
}

.contact-info h2,
.contact-form h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 30px 0;
}

.info-item {
  margin-bottom: 35px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.info-item:last-child {
  border-bottom: none;
}

.info-item h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--primary);
}

.info-item p {
  margin: 0 0 8px 0;
  font-size: 15px;
}

.info-item small {
  opacity: 0.7;
  font-size: 13px;
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.social-link-large {
  padding: 10px 16px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: 0.3s ease;
  display: inline-block;
}

.social-link-large:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 15px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
  resize: vertical;
}

.submit-btn {
  width: 100%;
  padding: 14px 20px;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s ease;
  margin-bottom: 12px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.form-group small {
  display: block;
  margin-top: 8px;
  opacity: 0.7;
  font-size: 13px;
}

.form-group small a {
  color: var(--primary);
  text-decoration: none;
}

.form-group small a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .page-hero h1 {
    font-size: 32px;
  }
}

/* ===============================
   BLOG PAGE STYLES
=================================*/
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.blog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-12px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
}

.blog-image {
  height: 200px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  border-bottom: 1px solid var(--border);
}

.blog-meta {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  gap: 12px;
}

.blog-date {
  opacity: 0.7;
}

.blog-category {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
}

.blog-card h2 {
  font-size: 20px;
  font-weight: 700;
  padding: 0 24px;
  margin-top: 12px;
  line-height: 1.4;
  flex: 1;
}

.blog-card p {
  padding: 0 24px;
  margin-top: 12px;
  opacity: 0.8;
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
}

.read-more {
  padding: 0 24px 24px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s ease;
  display: inline-block;
}

.read-more:hover {
  transform: translateX(4px);
}

/* ===============================
   LEGAL PAGE STYLES
=================================*/
.legal-content {
  max-width: 900px;
  margin: 0 auto;
}

.legal-header h1 {
  font-size: 42px;
  font-weight: 800;
  margin: 0 0 12px 0;
}

.last-updated {
  opacity: 0.7;
  font-style: italic;
  margin: 0;
}

.legal-section {
  margin-bottom: 40px;
}

.legal-section h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: var(--primary);
}

.legal-section p {
  margin: 0 0 12px 0;
  font-size: 15px;
  line-height: 1.8;
  opacity: 0.9;
}

.legal-section p:last-of-type {
  margin-bottom: 0;
}

.legal-list {
  list-style-position: inside;
  padding: 0;
  margin: 16px 0;
}

.legal-list li {
  margin-bottom: 12px;
  line-height: 1.6;
  font-size: 15px;
  opacity: 0.9;
}

/* ===============================
   ACTIVE NAV LINK
=================================*/
.nav-link.active {
  color: var(--primary);
  font-weight: 700;
}

.nav-link.active::after {
  width: 100%;
  background: var(--primary);
}

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .legal-section h2 {
    font-size: 20px;
  }
}

/* ===============================
   GOOGLE ADS STYLING
=================================*/
.ad-container {
  margin: 30px 0;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
  border: 1px dashed var(--border);
  border-radius: 12px;
  font-size: 12px;
  opacity: 0.7;
}

.ad-sidebar {
  position: sticky;
  top: 100px;
  margin: 0 0 30px 30px;
}

/* Responsive ads */
@media (max-width: 1024px) {
  .ad-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .ad-container {
    min-height: 300px;
    margin: 20px 0;
  }

  .ad-sidebar {
    margin: 0;
    position: static;
    top: auto;
  }
}

/* Official NCERT Disclaimer */
.official-disclaimer {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, transparent 100%);
  border: 2px solid #22c55e;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 30px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.official-disclaimer::before {
  content: "✓";
  color: #22c55e;
  font-weight: bold;
  font-size: 20px;
  flex-shrink: 0;
}

.official-disclaimer p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.6;
}

.official-disclaimer strong {
  color: #22c55e;
}

/* Ad label styling */
.ad-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-weight: 600;
}

/* Google Ads responsive container */
.adsbygoogle {
  display: block;
  margin: 20px 0;
}

@media (max-width: 480px) {
  .ad-container {
    min-height: 250px;
  }
}






