/* -------------------------------------------------
   Global Reset & Typography
-------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(120deg, #f4f6f9, #edf1f5);
  color: #333;
}

/* -------------------------------------------------
   Navigation
-------------------------------------------------- */
header {
  background: #1e1e2f;
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

header nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
}

header nav ul li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  color: #fff;
  text-decoration: none;
  background: #3e3e50;
  border-radius: 6px;
  transition: background 0.3s;
}

header nav ul li a:hover {
  background: #007bff;
}

/* -------------------------------------------------
   “Welcome” Hero  (welcome.html)
-------------------------------------------------- */
.hero {
  padding: 100px 20px 40px;
  text-align: center;
  color: #fff;
  background: linear-gradient(-45deg, #6a0dad, #8a2be2, #7b68ee, #6a0dad);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 10px;
  animation: fadeInUp 1s;
}

.hero p {
  font-size: 20px;
  margin-bottom: 25px;
  animation: fadeInUp 1.2s;
}

/* -------------------------------------------------
   Auto-scroll Book Covers (welcome.html)
-------------------------------------------------- */
.ad-container {
  overflow: hidden;
  padding: 40px 0;
  background: #fff;
  border-block: 2px solid #eee;
}

.ad-content {
  display: flex;
  gap: 30px;
  padding-inline: 20px;
  width: max-content;
  animation: scrollBooks 25s linear infinite;
}

.ad-card {
  flex: 0 0 auto;
  width: 200px;
  height: 300px;
  border-radius: 12px;
  overflow: hidden;
  background: #fefefe;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .1);
  transition: transform .3s;
}

.ad-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-card:hover {
  transform: scale(1.05);
}

/* -------------------------------------------------
   Home Page Hero (home.html)
-------------------------------------------------- */
.home-hero {
  padding: 100px 20px 70px;
  text-align: center;
  background: url("../images/hero-bg.jpg") center/cover no-repeat;
  backdrop-filter: brightness(.6);
  color: #fff;
}

.home-hero h1 {
  font-size: 42px;
  margin-bottom: 8px;
}

.home-hero p {
  font-size: 18px;
  margin-bottom: 35px;
}

/* Search bar */
.search-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  max-width: 640px;
  margin-inline: auto;
}

.search-bar input,
.search-bar select {
  padding: 12px 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  flex: 1 1 auto;
  font-size: 15px;
}

.search-bar select {
  flex: 1 1 180px;
  max-width: 180px;
  padding: 12px 20px;
  border: none;
  outline: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111;
  background-color: #fff;
  border-radius: 0 50px 50px 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg fill='%23666' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: background-color 0.3s, color 0.3s;
}

.search-bar select:hover,
.search-bar select:focus {
  background-color: #f1f1f1;
  color: #000;
  cursor: pointer;
}

.search-bar button {
  padding: 12px 24px;
  border: none;
  background: #ffffff;
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background .3s;
}

.search-bar button:hover {
  background: #422cff;
}

/* -------------------------------------------------
   Section Heading
-------------------------------------------------- */
.section-title {
  text-align: center;
  font-size: 32px;
  color: #1e1e2f;
  margin: 60px auto 30px;
}

/* -------------------------------------------------
   Book Cards (Updated for full image zoom)
-------------------------------------------------- */
.book-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  padding-bottom: 60px;
}

.book-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition: 0.3s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  width: 240px;
}

.book-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
}

.book-card .img-container {
  width: 100%;
  height: 270px;
  overflow: hidden;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  padding: 0; /* ✅ Removed padding */
}

.book-card img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* ✅ Fully fills image area */
  display: block;
}

.book-body {
  padding: 18px 16px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-body h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 10px;
}

.book-body p {
  font-size: 0.87rem;
  color: #555;
  line-height: 1.4;
  margin-bottom: 12px;
  min-height: 48px;
}

.book-body a {
  margin-top: 14px;
  display: inline-block;
  background-color: #553CDF;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 8px;
  text-align: center;
  transition: background 0.3s ease, transform 0.2s ease;
}

.book-body a:hover {
  background-color: #3d2bbd;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(85, 60, 223, 0.3);
}

/* -------------------------------------------------
   Generic Info / CTA Sections
-------------------------------------------------- */
.info-section,
.cta-section {
  max-width: 900px;
  margin: 60px auto;
  padding-inline: 20px;
  text-align: center;
}

.cta-section {
  margin-top: 40px;
}

/* -------------------------------------------------
   Footer
-------------------------------------------------- */
footer {
  background: #1e1e2f;
  color: #fff;
  padding: 30px 20px;
  text-align: center;
}

footer nav {
  margin-bottom: 12px;
}

footer nav a {
  margin: 0 10px;
  color: #bbb;
  text-decoration: none;
}

footer nav a:hover {
  color: #fff;
}

/* -------------------------------------------------
   Keyframes
-------------------------------------------------- */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes scrollBooks {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -------------------------------------------------
   Responsive
-------------------------------------------------- */
@media (max-width: 768px) {
  .hero h1,
  .home-hero h1 {
    font-size: 32px;
  }

  .search-bar {
    flex-direction: column;
  }

  .search-bar input,
  .search-bar select,
  .search-bar button {
    width: 100%;
  }

  .book-card {
    width: 90%;
  }

  .ad-card {
    width: 140px;
    height: 210px;
  }

  header nav ul {
    flex-direction: column;
    align-items: center;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .white-box {
    padding: 20px 15px;
  }

  .button {
    width: 90%;
    display: block;
    margin: 10px auto;
  }
}
