@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  color-scheme: light dark;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-strong: #f1f5f9;
  --surface-muted: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.06);
  --accent: #2563eb;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --accent-strong: #1d4ed8;
  --accent-light: rgba(37, 99, 235, 0.08);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 32px rgba(15, 23, 42, 0.06);
  --shadow-premium: 0 24px 50px -10px rgba(15, 23, 42, 0.08);
  --radius-lg: 1.25rem;
  --radius-md: 0.85rem;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  background: #090d16;
  color: #f3f4f6;
  
  --bg: #090d16;
  --surface: #111726;
  --surface-strong: #182032;
  --surface-muted: #222d44;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --muted: #9ca3af;
  --border: rgba(255, 255, 255, 0.05);
  --accent: #60a5fa;
  --accent-gradient: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  --accent-strong: #3b82f6;
  --accent-light: rgba(96, 165, 250, 0.12);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.4);
  --shadow-premium: 0 24px 50px -10px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button, input {
  font: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* Layout Container */
.page-shell__layout {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr auto;
}

/* Modern Sticky Header */
.hero-panel {
  position: relative;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: center;
  z-index: 10;
}

.hero-panel > div {
  max-width: 1200px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.hero-panel__info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.75rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 40%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.hero-copy {
  display: none; /* Hide tagline in main header on mobile for clean look */
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .hero-panel {
    padding: 2.5rem 2rem;
  }
  h1 {
    font-size: 2.25rem;
  }
  .hero-copy {
    display: block;
    margin-top: 0.5rem;
  }
}

/* Theme Toggle */
.theme-toggle {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.theme-toggle:hover {
  background: var(--surface-muted);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: translateY(1px);
}

/* Main Container */
.container {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

@media (min-width: 768px) {
  .container {
    padding: 2.5rem 0 4rem;
    width: min(1200px, calc(100% - 4rem));
  }
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.breadcrumb a {
  color: var(--accent);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Book Details Premium Card */
.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-premium);
  margin-bottom: 2rem;
  transition: var(--transition);
}

@media (min-width: 768px) {
  .book-card {
    padding: 2.5rem;
    margin-bottom: 3rem;
  }
}

.book-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 768px) {
  .book-hero {
    grid-template-columns: 260px 1fr;
    gap: 2.5rem;
  }
}

.book-cover {
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transition: var(--transition);
}

@media (min-width: 768px) {
  .book-cover {
    max-width: 100%;
    margin: 0;
  }
}

.book-meta {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.book-category {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-light);
  color: var(--accent);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.book-description {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .book-description {
    font-size: 1.05rem;
  }
}

.action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

@media (min-width: 480px) {
  .action-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .action-row {
    display: flex;
    gap: 1rem;
  }
}

/* Button UI */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
  border: 1px solid transparent;
  user-select: none;
}

.button:active {
  transform: scale(0.97);
}

.button-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--accent-light);
}

.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-light);
}

.button-secondary {
  background: var(--surface-strong);
  color: var(--text);
  border-color: var(--border);
}

.button-secondary:hover {
  background: var(--surface-muted);
  transform: translateY(-2px);
}

.book-stats {
  display: flex;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 0.5rem;
}

/* Social Actions Grid */
.extra-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.extra-actions h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .action-grid {
    display: flex;
    gap: 1rem;
  }
  .action-grid .button {
    min-width: 140px;
  }
}

/* Description / Extras Panel */
.book-description-panel {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.book-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 600px) {
  .book-details-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.book-details-grid div {
  background: var(--surface);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.recent-shell {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.recent-shell h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.recent-shell ul {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.recent-shell li a {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: var(--transition);
}

.recent-shell li a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Related Books Section */
.related-shell {
  margin-top: 3rem;
}

.related-shell h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

/* Modern Card Grid */
.cards-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

@media (min-width: 600px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
  }
}

/* Single Book Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

@media (min-width: 600px) {
  .card {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
  }
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-premium);
  border-color: var(--accent);
}

.card__image {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

@media (min-width: 600px) {
  .card__image {
    border-radius: 10px;
    margin-bottom: 1rem;
  }
}

.card__header {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card__title {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 600px) {
  .card__title {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
  }
}

.card__description {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 600px) {
  .card__description {
    font-size: 0.9rem;
    line-height: 1.5;
  }
}

.card__meta {
  display: none; /* Hide on small view to save space */
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

@media (min-width: 600px) {
  .card__meta {
    display: block;
  }
}

.card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 700;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  transition: var(--transition);
}

@media (min-width: 600px) {
  .card__link {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
  }
}

.card:hover .card__link {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 10px var(--accent-light);
}

/* Search UI */
.search-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .search-panel {
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
  }
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 3rem 0.9rem 1.1rem;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
}

@media (min-width: 768px) {
  .search-bar input {
    border-radius: 14px;
    padding: 1.1rem 3.5rem 1.1rem 1.5rem;
    font-size: 1.05rem;
  }
}

.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
}

.search-icon {
  position: absolute;
  right: 1.1rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
}

@media (min-width: 768px) {
  .search-icon {
    right: 1.5rem;
    font-size: 1.25rem;
  }
}

.search-meta {
  margin-top: 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* 404 Panel */
.notfound-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2rem 0;
}

.notfound-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-premium);
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.notfound-number {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent) 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

.notfound-panel h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.notfound-panel p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.notfound-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .notfound-actions {
    grid-template-columns: 1fr 1fr;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Search Placeholder */
.search-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  box-shadow: var(--shadow-sm);
}

.search-placeholder-icon {
  font-size: 3rem;
  margin-bottom: 0.25rem;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.search-placeholder h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}

.search-placeholder p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 340px;
  line-height: 1.5;
}


