/* General Settings */
body {
  font-family: "Inter", sans-serif;
  margin: 0;
  color: #1e1b4b;
  line-height: 1.6;
  background-color: #ffffff;
}

/* Navigation */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: #4f46e5;
}

.nav-links a {
  margin-left: 20px;
  text-decoration: none;
  color: #4b5563;
  font-weight: 500;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #1e1b4b;
  text-align: center;
  padding: 5px; /* equal padding on all sides */
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* left-align components */
}

.hero .hashtags-container {
  margin: 10px 0;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  transition: opacity 0.5s ease-in-out;
}

.hero .hashtags-set {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

.hero .hashtag {
  flex: 1 1 80px;
  text-align: center;
}
.hero .hashtag {
  color: white;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid #9ca3af; /* grey border */
  font-weight: 500;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin: 1px 3px;
  transition: all 0.3s ease;
}

/* color variations for hashtags */
.hero .hashtag:nth-child(1) {
  background: #4f46e5;
}
.hero .hashtag:nth-child(2) {
  background: #e11d48;
}
.hero .hashtag:nth-child(3) {
  background: #0ea5e9;
}
.hero .hashtag:nth-child(4) {
  background: #f59e0b;
}
.hero .hashtag:nth-child(5) {
  background: #14b8a6;
}
.hero .hashtag:nth-child(6) {
  background: #8b5cf6;
}
.hero .hashtag:nth-child(7) {
  background: #10b981;
}
.hero .hashtag:nth-child(8) {
  background: #ec4899;
}
.hero .hashtag:nth-child(9) {
  background: #9333ea;
}
.hero .hashtag:nth-child(10) {
  background: #3b82f6;
}
.hero .hashtag:nth-child(11) {
  background: #f97316;
}
.hero .hashtag:nth-child(12) {
  background: #22c55e;
}
.hero .hashtag:nth-child(13) {
  background: #a78bfa;
}
.hero .hashtag:nth-child(14) {
  background: #06b6d4;
}
.hero .hashtag:nth-child(15) {
  background: #f43f5e;
}
/* more colors will cycle after 15 */

.hero .hashtag:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

/* reduce h1 top margin in hero */
.hero h1 {
  margin-top: 0;
  padding-top: 0;
}

.highlight {
  color: #fbbf24;
}

.hashtags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.btn {
  display: inline-block;
  background: white;
  color: #4f46e5;
  padding: 12px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  margin-top: 20px;
}

/* Layout Grid */
.container {
  padding: 80px 5%;
}
.bg-light {
  background-color: #f9fafb;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  align-items: start;
}

/* Cards */
.card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.card-content {
  padding: 20px;
  flex: 1;
  text-align: center;
}

/* Book summary specific tweaks */
.card-content h3 {
  margin-top: 0;
  font-size: 0.9rem;
  color: #1e1b4b;
  margin-bottom: 3px;
}
.card-content ul {
  margin: 10px 0 0 20px;
  padding: 0;
  list-style-type: disc;
}

.card-content p {
  margin: 0 0 5px;
  color: #374151;
}

.card-content .author {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0;
  margin-bottom: 1px;
}

.card-content .published-year {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0;
  margin-bottom: 1px;
}

.card-content .year small {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-top: 0;
}

/* layout tweaks for book cards: cover left, details right, description below */
#books .card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 10px;
  padding: 8px;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

#books .book-cover {
  grid-column: 1;
  grid-row: 1;
  width: 120px;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 100%);
  padding: 8px;
  box-sizing: border-box;
  display: block;
}

#books .card-content {
  grid-column: 2;
  grid-row: 1;
  text-align: left;
  width: 100%;
  padding: 0;
  overflow: visible;
}

#books .description {
  grid-column: 1 / span 2;
  grid-row: 2;
  text-align: left;
  font-size: 0.75rem;
  font-weight: bold;
  line-height: 1.3;
  margin-bottom: 0;
  max-width: none;
  pointer-events: auto;
}

/* responsive: keep vertical on small screens */
@media (max-width: 600px) {
  #books .card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 8px;
  }
  #books .book-cover {
    grid-column: 1;
    grid-row: 1;
    max-width: 100%;
  }
  #books .card-content {
    grid-column: 1;
    grid-row: 2;
  }
  #books .description {
    grid-column: 1;
    grid-row: 3;
  }
}

/* metadata inside book cards */
.book-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
  font-size: 0.75rem;
}
.rating {
  color: #fbbf24;
  font-weight: 600;
}
.badge.category {
  background: #e0e7ff;
  color: #4338ca;
}
.badge.finance {
  background: #dcfce7;
  color: #166534;
}
.badge.personal-development {
  background: #dbeafe;
  color: #1e40af;
}
.badge.focus {
  background: #fde68a;
  color: #92400e;
}
.badge.philosophy {
  background: #f3f4f6;
  color: #111827;
}
.badge.people-skills {
  background: #fee2e2;
  color: #991b1b;
}
.badge.motivation {
  background: #fef3c7;
  color: #92400e;
}
.badge.productivity {
  background: #e0f2fe;
  color: #0369a1;
}
.badge.spiritual {
  background: #e9d5ff;
  color: #6b21a8;
}
.badge.sales {
  background: #fce7f3;
  color: #831843;
}
.badge.marketing {
  background: #f0fdf4;
  color: #15803d;
}

.card-content .author {
  font-size: 0.95rem;
  color: #6b7280;
  margin-top: 0;
  margin-bottom: 0.2rem;
}

.card-content .published-year {
  font-size: 0.9rem;
  color: #6b7280;
  margin-top: 0.3rem;
  margin-bottom: 0.5rem;
}

.card-content .year small {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 0;
}

.badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  font-weight: bold;
}

.money {
  background: #dcfce7;
  color: #166534;
}
.personal {
  background: #dbeafe;
  color: #1e40af;
}

.read-more {
  display: inline-block;
  margin-top: 8px;
  color: #4f46e5;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  z-index: 10;
  position: relative;
}

.read-more:hover {
  text-decoration: underline;
}

.summary-container {
  padding: 80px 5%;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.7;
  background: #ffffff;
}

.summary-container h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #4f46e5;
  border-bottom: 3px solid #4f46e5;
  padding-bottom: 6px;
}

.summary-container .published-year {
  font-size: 0.95rem;
  margin-top: 0.3rem;
  margin-bottom: 0.8rem;
  color: #6b7280;
}

.summary-container .author {
  font-size: 0.95rem;
  margin-top: 0;
  margin-bottom: 0.2rem;
  color: #6b7280;
  font-style: italic;
}

.summary-container .year {
  font-size: 0.85rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: #9ca3af;
}

.summary-container h2 {
  margin-top: 2rem;
  font-size: 1.5rem;
  color: #1e1b4b;
  padding-left: 8px;
  border-left: 4px solid #4f46e5;
  background: #f9fafb;
  display: inline-block;
}

/* callout boxes for inline highlights */
.summary-container .callout {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  border-left: 4px solid #4f46e5;
  background: #eef2ff;
  display: flex;
  align-items: flex-start;
}
.summary-container .callout-bullet {
  margin-right: 8px;
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.summary-container .callout--yellow {
  border-color: #f59e0b;
  background: #fffbeb;
}

.summary-container ul,
.summary-container ol {
  margin-left: 20px;
}

.summary-container li {
  margin-bottom: 8px;
}

/* highlight-list specific styling */
.highlight-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 16px 0;
}
.highlight-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
}
.highlight-list li:before {
  content: "–";
  position: absolute;
  left: 0;
  top: 0;
  color: #4f46e5;
  font-weight: bold;
}

.summary-container ul {
  margin-left: 20px;
}

.summary-container .btn {
  margin-top: 30px;
}

footer {
  text-align: center;
  padding: 40px;
  background: #111827;
  color: #9ca3af;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}
.modal[aria-hidden="false"] {
  display: block;
  pointer-events: auto;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
}
.modal-dialog {
  position: relative;
  max-width: 680px;
  margin: 40px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.4);
  overflow: auto;
  max-height: calc(100vh - 80px);
}
.modal-body {
  padding: 24px 28px;
  color: #111827;
}
.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}
.modal-body h4 {
  margin-top: 16px;
}

.callout {
  padding: 12px 14px;
  border-radius: 8px;
  margin: 12px 0;
}
.callout--yellow {
  background: #fff7ed;
  border-left: 4px solid #f59e0b;
}
.callout--info {
  background: #eef2ff;
  border-left: 4px solid #6366f1;
}

.key-takeaways {
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  list-style: disc;
  margin-left: 20px;
}
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
}

/* Custom modal for book summaries */
#modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
}

#modal-title {
  margin-top: 0;
  color: #4f46e5;
  font-size: 1.5rem;
}

#modal-author,
#modal-year,
#modal-rating {
  margin: 5px 0;
  color: #6b7280;
  font-size: 0.9rem;
}

#modal-description {
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 1rem;
}

@media (max-width: 640px) {
  .modal-dialog {
    margin: 20px;
    max-width: calc(100% - 40px);
  }
}
