:root {
  /* Color Palette - Deep Library Aesthetic */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --accent-primary: #f59e0b; /* Amber */
  --accent-secondary: #38bdf8; /* Sky Blue */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --card-bg: rgba(30, 41, 59, 0.7);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 48px;
  --space-2xl: 80px;

  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 4rem);
}

/* Navigation */
.nav-header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.logo-container:hover {
  transform: scale(1.02);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--bg-primary);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  position: relative;
  overflow: hidden;
}

.logo-icon::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { left: -100%; }
  20% { left: 100%; }
  100% { left: 100%; }
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-link:hover {
  color: var(--accent-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Hero Section */
.hero {
  padding: var(--space-2xl) 0;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-xl);
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  margin-bottom: var(--space-md);
}

.hero-content p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  max-width: 540px;
}

.hero-visual {
  position: relative;
  height: 500px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #0f172a 100%);
  border-radius: 24px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-visual::before {
  content: "";
  position: absolute;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
  top: -25%;
  left: -25%;
  animation: pulse 8s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); opacity: 0.5; }
  to { transform: scale(1.2); opacity: 0.8; }
}

/* Components */
.btn {
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.2);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Sections */
section {
  margin-top: var(--space-2xl);
}

.section-header {
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: var(--space-xs);
}

.section-header p {
  color: var(--text-secondary);
}

/* Book Grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.book-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: var(--space-md);
  transition: all 0.3s ease;
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-secondary);
  background: var(--bg-secondary);
}

.book-cover {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 8px;
  margin-bottom: var(--space-md);
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.book-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.book-author {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-new { background: var(--accent-secondary); color: var(--bg-primary); }

.badge-success { background: #4ade80; color: var(--bg-primary); }

/* Layout Helpers */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; gap: var(--space-md); }
.flex-column { display: flex; flex-direction: column; }
.text-center { text-align: center; }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mt-xl { margin-top: var(--space-xl); }
.text-secondary { color: var(--text-secondary); }
.accent-text { color: var(--accent-primary); }
.sky-text { color: var(--accent-secondary); }

.avatar-stack { display: flex; -webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%); }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--bg-primary); background: #444; }
.avatar-overlap { margin-left: -12px; }

.hero-visual-container { position: relative; width: 280px; height: 400px; transform: rotate(-5deg); box-shadow: 20px 20px 60px rgba(0,0,0,0.5); }
.hero-visual-secondary { position: absolute; right: 40px; bottom: 60px; width: 200px; height: 280px; transform: rotate(5deg); z-index: 2; box-shadow: 20px 20px 60px rgba(0,0,0,0.5); }

.streak-card { background: var(--bg-secondary); padding: 12px 24px; border-radius: 12px; border: 1px solid var(--border-color); display: flex; align-items: center; gap: var(--space-md); }
.streak-icon { width: 40px; height: 40px; background: rgba(245, 158, 11, 0.1); color: var(--accent-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.tab-nav { display: flex; gap: var(--space-md); margin-bottom: var(--space-xl); border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.tab-link { font-weight: 600; color: var(--text-secondary); padding-bottom: 8px; }
.tab-link.active { color: var(--accent-primary); border-bottom: 2px solid var(--accent-primary); }

.progress-bar-container { position: absolute; bottom: 0; left: 0; width: 100%; height: 4px; background: rgba(255,255,255,0.2); }
.progress-bar { height: 100%; background: var(--accent-secondary); }

.add-card { border: 2px dashed var(--border-color); display: flex; flex-direction: column; align-items: center; justify-content: center; background: transparent; }
.add-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-sm); }

/* Placeholder classes */
.placeholder-image {
  background: linear-gradient(45deg, #1e293b, #334155);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.placeholder-image::after {
  content: attr(data-label);
  color: rgba(255,255,255,0.2);
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
  padding: 10px;
}

/* App Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.feature-card {
  padding: var(--space-lg);
  border-radius: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-secondary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
}

/* Footer */
footer {
  margin-top: var(--space-2xl);
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border-color);
  background: #0b1121;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-xl);
}

.footer-brand p {
  margin-top: var(--space-md);
  color: var(--text-secondary);
  max-width: 300px;
}

.footer-column h4 {
  margin-bottom: var(--space-lg);
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--accent-primary);
}
