body {
  background: #f7fafc;
  color: #222;
  margin: 0;
  font-family: 'Poppins', 'Segoe UI', 'Roboto', Arial, sans-serif;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
}

.navbar {
  background: #fff;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: space-between; /* Space between logo and nav items */
  padding: 1.2rem 2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border-radius: 0 0 16px 16px;
  margin-bottom: 2rem;
}

.logo {
  margin-right: auto; /* Push logo to the left */
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  align-items: center; /* Align items vertically */
}

.theme-toggle {
  margin-left: 1rem; /* Add space between nav-links and toggle button */
}

.nav-links a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  transition: color 0.2s, background 0.2s;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
}

.nav-links a:hover {
  background: #e3eafc;
  color: #4a90e2;
}

.theme-toggle {
  background: #e3eafc;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #4a90e2;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  box-shadow: 0 1px 4px rgba(74,144,226,0.08);
  transition: background 0.2s, color 0.2s;
}

main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  color: #4a90e2;
  letter-spacing: 1px;
  text-shadow: none;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem; /* 4. More spacing between cards */
}

/* 5. Add a soft gradient background and 3. smooth transition */
.book-card {
  background: linear-gradient(135deg, #fff 60%, #f0f4fa 100%);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-radius: 20px;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  text-align: center;
  transition: box-shadow 0.3s, border 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #e3eafc;
  min-height: 380px;
}

/* 1. Card hover effect */
.book-card:hover, .book-card:focus-within {
  box-shadow: 0 8px 32px rgba(74,144,226,0.18);
  border: 1px solid #4a90e2;
  transform: translateY(-4px) scale(1.03);
}

.book-card img {
  width: 260px;
  height: 360px;
  object-fit: cover;
  margin-bottom: 1.2rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(74,144,226,0.08);
  border: 1px solid #e3eafc;
  background: #fff;
}

/* --- Add dark mode styles below --- */
body.dark {
  background: #181a1b;
  color: #f5f7fa;
}

body.dark .navbar {
  background: #23272a;
  color: #f5f7fa;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

body.dark .logo {
  color: #90caf9;
}

body.dark .nav-links a {
  color: #f5f7fa;
}

body.dark .nav-links a:hover {
  background: #23272a;
  color: #90caf9;
}

body.dark .theme-toggle {
  background: #23272a;
  color: #90caf9;
  box-shadow: 0 1px 4px rgba(144,202,249,0.08);
}

body.dark .section-title {
  color: #90caf9;
}

body.dark .book-card {
  background: #23272a;
  color: #f5f7fa;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  border: 1px solid #333a40;
}

body.dark .book-card:hover {
  box-shadow: 0 6px 24px rgba(144,202,249,0.10);
  border: 1px solid #90caf9;
}

body.dark .book-card img {
  background: #181a1b;
  border: 1px solid #333a40;
}

body.dark .book-card h3 {
  color: #90caf9;
}

body.dark .download-btn {
  background: #90caf9;
  color: #23272a;
  box-shadow: 0 1px 4px rgba(144,202,249,0.10);
}

body.dark .download-btn:hover {
  background: #42a5f5;
  color: #fff;
}

.book-card h3 {
  margin: 0.8rem 0 1.2rem 0;
  font-size: 1.25rem;
  color: #4a90e2;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.download-btn {
  display: inline-block;
  background: linear-gradient(90deg, #4a90e2 0%, #357ab8 100%);
  color: #fff;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(74,144,226,0.12); /* 6. More prominent button */
  transition: background 0.2s, color 0.2s, transform 0.2s;
  margin-top: auto;
  outline: none;
}

/* 7. Focus style for accessibility */
.download-btn:focus {
  box-shadow: 0 0 0 3px #b3d4fc;
}

.download-btn:hover {
  background: #357ab8;
  color: #fff;
  transform: translateY(-2px) scale(1.03);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.2rem;
    border-radius: 0 0 10px 10px;
  }
  .logo {
    font-size: 1.3rem;
  }
  .section-title {
    font-size: 1.4rem;
  }
  .book-card {
    padding: 1.2rem 0.7rem 0.7rem 0.7rem;
    min-height: 300px;
  }
  .book-card img {
    width: 100px;
    height: 140px;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 0.6rem 0.3rem;
    border-radius: 0 0 6px 6px;
  }
  .nav-links {
    gap: 0.7rem;
  }
  .section-title {
    font-size: 1.1rem;
  }
  .book-grid {
    gap: 0.8rem;
  }
  .book-card {
    padding: 0.7rem 0.3rem 0.3rem 0.3rem;
    min-height: 200px;
  }
  .book-card img {
    width: 70px;
    height: 100%; /* Make the image take the full width of the card */
    height: auto; /* Maintain aspect ratio */
    max-height: 300px; /* Set a maximum height for the image */
    object-fit: cover; /* Ensure the image covers the area */
  }
}

/* Responsive adjustments for tablets */
@media (max-width: 900px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr); /* Two images per row */
  }
  .book-card img {
    width: 100%; /* Make the image take the full width of the card */
    height: auto; /* Maintain aspect ratio */
    max-height: 200px; /* Reduce maximum height for tablet screens */
    object-fit: cover; /* Ensure the image covers the area */
  }
}

/* Responsive adjustments for mobile */
@media (max-width: 600px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr); /* Two images per row */
  }
  .book-card img {
    width: 100%; /* Make the image take the full width of the card */
    height: auto; /* Maintain aspect ratio */
    max-height: 180px; /* Reduce maximum height for mobile screens */
    object-fit: cover; /* Ensure the image covers the area */
  }}
