/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
}

body {
  background: #f7f7f9;
  color: #333;
  line-height: 1.6;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #4a47a3;
  padding: 1rem 2rem;
  color: white;
}

.navbar .logo {
  font-size: 1.4rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  text-decoration: none;
  color: white;
  transition: 0.3s;
}

.nav-links a:hover {
  color: #ffd700;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #4a47a3, #5a55ca);
  color: white;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: #ffd700;
  color: #333;
  font-weight: bold;
  text-decoration: none;
  border-radius: 5px;
  transition: 0.3s;
}

.btn:hover {
  background: #ffc107;
}

.btn.small {
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
}

/* Featured Books */
.featured {
  padding: 3rem 2rem;
  text-align: center;
}

.featured h2 {
  margin-bottom: 2rem;
  font-size: 2rem;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.book-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  padding: 1rem;
}

.book-card img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.book-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

/* Footer */
footer {
  background: #4a47a3;
  color: white;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
}
footer a {
  color: #ffd700;
  text-decoration: none;
}
/* Library Page */
.library {
  padding: 3rem 2rem;
  text-align: center;
}

.category-filter {
  margin: 1.5rem 0;
}

.filter-btn {
  padding: 0.6rem 1rem;
  margin: 0.3rem;
  border: none;
  border-radius: 5px;
  background: #eee;
  cursor: pointer;
  transition: 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
  background: #4a47a3;
  color: white;
}

/* Rating */
.rating {
  font-size: 0.9rem;
  margin: 0.5rem 0;
  color: #ff9800;
}

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  position: relative;
}

.close-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 1.5rem;
  cursor: pointer;
}
/* Contact Page */
.contact {
  padding: 3rem 2rem;
  text-align: center;
}

.contact h2 {
  margin-bottom: 1rem;
  font-size: 2rem;
  color: #4a47a3;
}

.contact p {
  margin-bottom: 2rem;
}

.contact-form {
  max-width: 600px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.contact-form button {
  align-self: flex-start;
}
/* Privacy Policy Page */
.policy {
  padding: 3rem 2rem;
  max-width: 900px;
  margin: auto;
}

.policy h2 {
  color: #4a47a3;
  margin-bottom: 1rem;
}

.policy h3 {
  margin-top: 1.5rem;
  color: #333;
}

.policy p, .policy ul {
  margin: 0.8rem 0;
  line-height: 1.6;
}
/* Terms of Service Page */
.terms {
  padding: 3rem 2rem;
  max-width: 900px;
  margin: auto;
}

.terms h2 {
  color: #4a47a3;
  margin-bottom: 1rem;
}

.terms h3 {
  margin-top: 1.5rem;
  color: #333;
}

.terms p, .terms ul {
  margin: 0.8rem 0;
  line-height: 1.6;
}
.featured.book-card {
  width: 200px;           /* set card width */
  text-align: center;     /* center text */
  margin: 10px;           /* spacing between cards */
  display: inline-block;  /* display cards side by side */
  vertical-align: top;
}

.book-card img {
  width: 100%;            /* image fits card width */
  height: auto;          /* set uniform height */
  object-fit: contain;      /* crop if necessary, keeps aspect ratio */
  border-radius: 8px;     /* optional rounded corners */
}

.category-filter .filter-btn.active {
  outline: 2px solid #2b6cb0;
  transform: translateY(-1px);
  font-weight: 600;
}
#searchResults {
  margin-top: 8px;
  font-weight: 600;
  color: #b00020;
}
