:root {
  --primary-color: #1e3d59;
  --secondary-color: #ff6e40;
  --accent-color: #17b978;
  --bg-color: #f5f7fa;
  --text-color: #333;
  --card-bg: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--secondary-color);
}

main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  flex: 1;
}

.hero {
  background: linear-gradient(rgba(30, 61, 89, 0.8), rgba(30, 61, 89, 0.8)), url('https://images.unsplash.com/photo-1457369804613-52c61a468e7d?auto=format&fit=crop&w=1200&q=80');
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
  padding: 4rem 1rem;
  border-radius: 12px;
  margin-bottom: 2.5rem;
}

.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; margin-bottom: 1.5rem; color: #e0e0e0; }

.search-box {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
}

.search-box input {
  flex: 1;
  padding: 0.8rem 1rem;
  border-radius: 25px;
  border: none;
  outline: none;
  font-size: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  background-color: var(--secondary-color);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

.btn:hover { background-color: #e05627; }
.btn-read { background-color: var(--accent-color); }
.btn-read:hover { background-color: #139c65; }

.section-title {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--secondary-color);
  padding-left: 0.8rem;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 2rem;
}

.book-card {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s, box-shadow 0.3s;
}

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

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

.book-info {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.book-title {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  color: var(--primary-color);
}

.book-author {
  color: #666;
  font-size: 0.88rem;
  margin-bottom: 0.8rem;
}

.book-desc {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.4;
  margin-bottom: 1.2rem;
}

/* Modal Reader */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  background: var(--primary-color);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  line-height: 1.8;
  font-size: 1.05rem;
  color: #2c3e50;
  background: #fafafa;
}

.close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 1.5rem;
  margin-top: 3rem;
}

@media (max-width: 768px) {
  .nav-container { flex-direction: column; gap: 1rem; }
}
