/* Global Reset & Fonts */
body {
  font-family: 'Inter', sans-serif;
  background-color: #f7f1e5;
  margin: 0;
  padding: 0;
  color: #333;
  overflow-x: hidden;
}

/* Header Styling */
header {
  background: #c2a98a;
  color: white;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

/* Navigation Container */
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}

/* Left Section: Menu */
.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-btn {
  font-size: 1.4rem;
  background: none;
  border: 2px solid white;
  border-radius: 50%;
  padding: 0.3rem 0.6rem;
  color: white;
  cursor: pointer;
}

/* Center Section: Logo + Search + Sort */
.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex: 1;
  min-width: 300px;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: #fff;
  color: #2c3e50;
  padding: 0.2rem 0.8rem;
  border-radius: 2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.search-input {
  padding: 0.6rem 1rem;
  width: 320px;
  border: 1px solid #aaa;
  border-radius: 2rem;
  font-size: 1rem;
  background-color: #fff;
  color: #333;
}

.sort-select {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  background: #e3d4bf;
  border: none;
  font-weight: 500;
  cursor: pointer;
  color: #2c3e50;
}

/* Right Section: Auth Links */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
  margin-right: 3.5rem; /* moved further left by increasing margin */
}

.nav-right a {
  padding: 0.5rem 1rem;
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 2rem;
  color: white;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.nav-right a:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

/* Sidebar Styling */
.sidebar {
  position: fixed;
  top: 0;
  left: -250px;
  width: 250px;
  height: 100%;
  background-color: #4b3621;
  color: white;
  padding: 1.5rem 1rem;
  transition: left 0.3s ease;
  z-index: 2000;
}

.sidebar.active {
  left: 0 !important;
}

.sidebar h2 {
  margin-top: 0;
  font-size: 1.4rem;
}

.sidebar a {
  display: block;
  color: white;
  text-decoration: none;
  margin: 1.2rem 0;
  font-weight: 500;
}

/* Book Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  padding: 20px 30px;
}

.book-card {
  background: #ecf0f1;
  border-radius: 1rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.book-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.book-image-wrapper {
  height: 240px;
  overflow: hidden;
  border-bottom: 1px solid #bdc3c7;
}

.book-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-info {
  padding: 1rem;
  text-align: center;
}

.book-title {
  margin: 0.5rem 0 0.2rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
}

.book-info p {
  margin: 0.3rem 0;
  font-size: 0.9rem;
  color: #7f8c8d;
}

.category {
  font-style: italic;
  color: #3498db;
}

.read-btn {
  margin-top: 0.8rem;
  padding: 0.5rem 1.2rem;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s ease;
}

.read-btn:hover {
  background: #2980b9;
}

/* Tooltip */
.book-intro-tooltip {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 0.8rem 1rem;
  border-radius: 0.8rem;
  font-size: 0.85rem;
  line-height: 1.4;
  width: 250px;
  max-width: 90%;
  z-index: 10;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.book-card:hover .book-intro-tooltip {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    align-items: center;
  }

  .nav-center {
    justify-content: center;
  }

  .nav-right {
    justify-content: center;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    margin: 0;
    padding: 0 1rem;
  }

  .nav-right a {
    flex: 1;
    margin: 0.5rem;
    max-width: 120px;
    text-align: center;
  }

  .search-input {
    width: 100%;
    max-width: 300px;
  }
}
