/* home.css - includes navbar styles to match other pages */

/* ===== Colors & base ===== */
:root {
  --primary: #08205b;
  --accent: #edf0f5;
  --bg: #edf0f5;
  --card: #faf5ef;
  --muted: #3450ad;
  --text: #08205c;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Courier New", monospace;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* ===== Navbar (matching other pages) ===== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--primary);
  padding: 10px 20px;
  border-radius: 12px;
  margin: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.navbar .brand {
  font-size: 27px;
  font-weight: bold;
  color: var(--bg);
  text-decoration: none;
  font-family: "Times New Roman", serif;
}

.menu-toggle {
  display: none; /* shown on small screens via media query */
  font-size: 22px;
  color: var(--bg);
  cursor: pointer;
}

.navbar .nav-links {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.navbar .nav-links a {
  color: var(--bg);
  text-decoration: none;
  font-size: 16px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.25s ease, color 0.25s ease;
  font-family: "Times New Roman", serif;
}

.navbar .nav-links a.active {
  background-color: var(--bg);
  color: var(--primary);
}

/* ===== Page header (hero) ===== */
.header {
  text-align: center;
  padding: 22px 18px;
  margin: 0 16px;
  background: linear-gradient(
    150deg,
    rgba(221, 148, 183, 0.05),
    rgba(154, 127, 180, 0.03)
  );
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.header h1 {
  margin: 0;
  color: var(--primary);
  font-family: "Times New Roman", serif;
  font-size: 24px;
  letter-spacing: 0.6px;
}

.library-btn {
  background: var(--bg);
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.25s ease;
}
.library-btn:hover {
  background: var(--primary);
  color: var(--bg);
}

/* ===== Layout ===== */
.container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 22px;
  margin: 0 16px 28px;
}

/* ===== Cards ===== */
.card {
  background: var(--card);
  border: 2px solid var(--muted);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.card h2 {
  margin: 0 0 8px 0;
  color: var(--primary);
  font-family: "Times New Roman", serif;
}

/* Books thumbnails */
.books {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding-top: 6px;
}

.books img {
  width: 80px;
  height: auto;
  border-radius: 8px;
  border: 2px solid var(--primary);
  transition: transform 0.18s ease;
}

.books img:hover {
  transform: scale(1.08);
}

/* ===== Progress ===== */
.progress-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

progress {
  width: 100%;
  height: 14px;
  border-radius: 8px;
  appearance: none;
  overflow: hidden;
}

progress::-webkit-progress-bar {
  background: #f9f6ff;
  border-radius: 8px;
}
progress::-webkit-progress-value {
  background: var(--primary);
  border-radius: 8px;
}

/* Quote card */
.quote-card {
  text-align: center;
  font-style: italic;
}

/* Footer */
footer {
  text-align: center;
  padding: 14px;
  margin-top: 18px;
  background: linear-gradient(
    0deg,
    rgba(221, 148, 183, 0.05),
    rgba(221, 148, 183, 0.02)
  );
  color: var(--text);
  border-top: 3px solid var(--muted);
  border-radius: 0 0 12px 12px;
  margin: 0 16px 28px;
}

/* ===== Small tweaks for readability ===== */
#currentReading {
  display: grid;
  font-size: 15px;
  color: #4b2f52;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 15px;
  justify-items: center;
  align-items: start;
}

.left-col .card {
  width: 100%;
}
.book-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fefefe;
  border-radius: 12px;
  box-shadow: 0 2-x 6px rgba(0, 0, 0, 0.1);
  width: 160px;
  transition: transform 0.2s ease, box-shadow 0.2 ease;
  text-align: center;
}
.book-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px tgba(0, 0, 0, 0.15);
}
.book-item img.small-cover {
  width: 110px;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}
.book-item strong {
  font-size: 0.95rem;
  color: #333;
  margin-top: 4px;
  margin-bottom: 2px;
}

.book-item em {
  font-size: 0.85rem;
  color: #777;
}

#quote {
  color: #5e3e66;
}

.book-item {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.book-item:active {
  transform: scale(0.97);
}

.about {
  background: var(--card);
  border: 2px solid var(--muted);
  border-radius: 16px;
  margin: 0 16px 32px;
  padding: 32px 20px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.8);
}

.about h2 {
  font-family: "Times New Roman", Times, serif;
  font-size: 1.7rem;
  color: var(--primary);
  margin-bottom: 12px;
  position: relative;
}
.about h2::after {
  content: "+";
  color: #a98dc6;
  font-size: 1.2rem;
}

.about p {
  max-width: 700px;
  margin: 0 auto 12px;
  line-height: 1.6;
  font-size: 1rem;
  color: #4b2f52;
}

.about p strong {
  color: var(--primary);
}

/* ====AI Helper Section ====*/
.ai-helper {
  background: var(--card);
  border: 2px solid var(--muted);
  border-radius: 16px;
  margin: 0 16px 32px;
  padding: 32px 20px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.ai-helper h2 {
  font-family: "Courier New";
  font-size: 1.7rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.ai-helper p {
  color: #4b3f52;
  max-width: 700px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

.ai-chat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
#userQuestion {
  width: 100%;
  max-width: 600px;
  height: 90px;
  border: 2px solid var(--muted);
  border-radius: 12px;
  padding: 12px;
  font-family: "Courier New";
  resize: none;
  background: #fff;
  color: var(--text);
}

#askAI {
  background: var(--primary);
  color: var(--bg);
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

#askAI:hover {
  background: var(--muted);
}

.ai-response {
  margin-top: 20px;
  background: #fff;
  border: 2px dashed var(--muted);
  border-radius: 12px;
  padding: 16px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1rem;
  color: #333;
  min-height: 60px;
}

/* ===== Responsive: mobile ===== */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 14px;
  }
  .books img {
    width: 68px;
  }

  /* Navbar mobile behavior */
  .menu-toggle {
    display: block;
  }
  .navbar {
    padding: 12px;
  }
  .nav-links {
    display: none; /* hidden by default on mobile; can be toggled with JS */
    width: 100%;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
  }
  .nav-links a {
    padding: 8px 10px;
    width: 100%;
    text-align: left;
  }

  /* Show nav-links when nav has class .open (use small JS to toggle) */
  .navbar.open .nav-links {
    display: flex;
  }
  #currentyReading {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .about {
    padding: 24px 16px;
  }
}
.about h2 {
  font-size: 1.4rem;
}
.about p {
  font-size: 0.95rem;
}

/* ===== Desktop polish ===== */
@media (min-width: 769px) {
  .header {
    margin-top: 6px;
  }
  footer {
    margin-bottom: 18px;
  }
  #currentlyReading {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
