/* assets/css/style.css */

/* ────────────────────────────────────────────────────────────────────────────
   Reset & Base
────────────────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  color: #333;
  background: #FAFBFF;
  padding-bottom: 60px; /* allow for bottom nav */
}

a {
  color: #0b6169;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
}

/* ────────────────────────────────────────────────────────────────────────────
   Navbar
────────────────────────────────────────────────────────────────────────────── */
.navbar {
  background: #E7E7E7;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  flex-wrap: wrap;
}

.navbar img {
  max-height: 70px;
}

.nav-toggle {
  display: none;
  font-size: 1.4rem;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  transition: background 0.2s;
  color: #5f5f5f;
}

.nav-links a:hover {
  background: rgba(0, 0, 0, 0.05);
}

@media (max-width: 600px) {
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 0.5rem;
  }
  .nav-links.active {
    display: flex;
  }
}

/* ────────────────────────────────────────────────────────────────────────────
   Generic Page Container
────────────────────────────────────────────────────────────────────────────── */
.page {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 16px;
  font-family: system-ui;
}

/* ────────────────────────────────────────────────────────────────────────────
   Footer
────────────────────────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1rem 0;
  background: #f0f0f0;
  color: #555;
  position: relative;
  bottom: 0;
  width: 100%;
}

/* ────────────────────────────────────────────────────────────────────────────
   Search Page
────────────────────────────────────────────────────────────────────────────── */
.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.search-item {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.search-item img {
  max-width: 100px;
  margin-bottom: 0.5rem;
}

.search-item form {
  margin-top: auto;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-form label {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
}

.search-form input {
  padding: 0.5rem;
  font-size: 0.9rem;
}

.pagination {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.pagination a {
  background: #0b6169;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  text-decoration: none;
}

.pagination span {
  padding: 0.4rem 0.8rem;
}

/* ────────────────────────────────────────────────────────────────────────────
   My Library & Book Cards
────────────────────────────────────────────────────────────────────────────── */
.library-container {
  max-width: 1200px;
  margin: auto;
  padding: 2rem 1rem;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.book-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
  overflow: hidden;
}

.book-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.book-image {
  padding: 1rem;
  display: flex;
  justify-content: center;
}

.book-image img {
  max-width: 120px;
  border-radius: 6px;
}

.book-card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.book-card-content h3 {
  font-size: 1.1rem;
  color: #222;
}

.book-card-content p {
  font-size: 0.9rem;
  color: #555;
}

.progress-section {
  margin-top: 0.5rem;
}

.pages-input {
  width: 60px;
  padding: 0.3rem;
  font-size: 0.85rem;
  margin-left: 0.3rem;
}

.save-progress-btn {
  background: #0b6169;
  color: #fff;
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  margin-left: 0.4rem;
}

.save-progress-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.progress-container {
  margin-top: 0.5rem;
  height: 20px;
  background: #eee;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: #4caf50;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
  transition: width 0.3s ease;
}

.empty-msg {
  display: inline;
  text-align: center;
}

/* ────────────────────────────────────────────────────────────────────────────
   Star Rating
────────────────────────────────────────────────────────────────────────────── */
.star-rating {
  display: inline-block;
  cursor: pointer;
}

.star {
  font-size: 1.4rem;
  color: #ccc;
  transition: color 0.2s;
}

.star.hovered,
.star.filled {
  color: #f5b301;
}

/* ────────────────────────────────────────────────────────────────────────────
   Popups & Modals
────────────────────────────────────────────────────────────────────────────── */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.popup form {
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
}

.popup label {
  display: block;
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: #333;
}

.popup input,
.popup select,
.popup button {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.3rem;
  font-size: 0.9rem;
}

.popup button {
  background: #0b6169;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 1rem;
}

/* Confetti canvas */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 999;
}

/* ────────────────────────────────────────────────────────────────────────────
   Dashboard
────────────────────────────────────────────────────────────────────────────── */
.buddy-header {
  text-align: center;
  padding: 1rem 0;
}

.buddy-header .greeting {
  font-size: 1.5rem;
}

.buddy-header .username {
  color: #0b6169;
}

.stats-container {
  display: flex;
  justify-content: space-around;
  margin-top: 1rem;
}

.stats-card {
 
  background-color:#b87334ff;
  border-radius: 8px;
  padding: 1rem;
  width: 30%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.stats-card i {
  color: #0b6169;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.tabs {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.tab {
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.tab.active {
  border-color: #0b6169;
  color: #0b6169;
}

.carousel-container {
  padding: 1rem 0;
}

.carousel {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
}

/* Small book cards in dashboard carousel */
.carousel .book-card {
  flex: 0 0 auto;
  width: 120px;
  text-align: center;
}

.carousel .book-card img {
  width: 100%;
  border-radius: 4px;
}

.progress-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -25px auto 0;
  background: #ccc;
  font-size: 0.8rem;
}

/* ────────────────────────────────────────────────────────────────────────────
   Recommendations
────────────────────────────────────────────────────────────────────────────── */
.recommendations {
  margin: 2rem 1rem;
}

.rec-carousel {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
}

.rec-card {
  flex: 0 0 auto;
  width: 100px;
  text-align: center;
}

.rec-card img {
  width: 100%;
  border-radius: 4px;
}

/* ────────────────────────────────────────────────────────────────────────────
   Bottom Navigation (mobile)
────────────────────────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #fff;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0;
  z-index: 500;
}

.bottom-nav .nav-item {
  color: #555;
  font-size: 1.4rem;
}

/* ────────────────────────────────────────────────────────────────────────────
   Feed
────────────────────────────────────────────────────────────────────────────── */
.feed-item {
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.feed-item strong {
  color: #0b6169;
}

.feed-item form {
  display: inline;
}

.feed-item ul {
  margin-top: 0.5rem;
  padding-left: 1rem;
}

.feed-item li {
  list-style: disc;
}

/* ────────────────────────────────────────────────────────────────────────────
   Notifications
────────────────────────────────────────────────────────────────────────────── */
.page ul {
  list-style: none;
  padding: 0;
}

.page li {
  padding: 0.75rem;
  border-bottom: 1px solid #eee;
}

.page li.unread {
  background: #eef;
}

/* ────────────────────────────────────────────────────────────────────────────
   Profile
────────────────────────────────────────────────────────────────────────────── */
.page form {
  margin-bottom: 1.5rem;
}

.page input,
.page button {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.3rem;
  font-size: 0.9rem;
}

.page button {
  background: #0b6169;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* ────────────────────────────────────────────────────────────────────────────
   Challenges
────────────────────────────────────────────────────────────────────────────── */
.challenge-card {
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  margin-bottom: 1rem;
}

.challenge-card h3 {
  margin-bottom: 0.5rem;
}




.dashboard-container {
  padding: 1rem;
  max-width: 1200px;
  margin: auto;
}

.dashboard-header h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-align: center;
  color: #3b3b3b;
}

.stats-container {
  display: flex;
  justify-content: space-around;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.stats-card {
  background: #ececec;
  border-radius: 12px;
  padding: 1rem;
  flex: 1;
  min-width: 120px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.dashboard-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tab-btn {
  background: #eee;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
}

.tab-btn.active {
  background: #0b6169;
  color: white;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.dashboard-card {
  background: #fff;
  border-radius: 10px;
  padding: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s;
}

.dashboard-card:hover {
  transform: translateY(-2px);
}

.dashboard-card img {
  width: 100px;
  height: auto;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.dashboard-card h3 {
  font-size: 0.95rem;
  text-align: center;
  margin: 0.3rem 0;
}

.dashboard-card .authors {
  font-size: 0.8rem;
  color: #666;
  text-align: center;
}

.progress {
  margin-top: 0.5rem;
  text-align: center;
}

.progress-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #0b6169;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  margin: auto;
}

.pages-input {
  width: 60px;
  margin-top: 0.3rem;
}

.card-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

.card-actions button {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border: none;
  border-radius: 6px;
  background: #eee;
  cursor: pointer;
}

.card-actions button:hover {
  background: #ddd;
}




.book-details-container {
  max-width: 800px;
  margin: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.book-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.book-card img {
  width: 140px;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.book-card h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.book-card .authors {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1rem;
}

.description-card {
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.rating-card,
.actions-card {
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.star-rating .star {
  font-size: 1.5rem;
  cursor: pointer;
  color: #ccc;
}

.star-rating .star.filled {
  color: #f5b301;
}

.actions-card button {
  background: #0b6169;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}

.actions-card button:hover {
  background: #005fa3;
}


.card-header3 {
  
  justify-content: left;
}

.finished-msg {
  text-align: center;
  font-size: 1rem;
  color: #4caf50;
  margin-top: 0.5rem;
}


.dashboard-card {
display: flex;
      overflow-x: auto;
      gap: 12px;
      padding-bottom: 12px;
      margin-bottom: 24px;
      height: 200px;
}