:root {
  /* Colors */
  --bg-body: #f7f9fc;
  --bg-card: #ffffff;
  --text-primary: #1a202c;
  --text-secondary: #718096;
  --primary-accent: #3b82f6;
  --primary-hover: #2563eb;
  --border-color: #e2e8f0;
  
  /* Status Colors */
  --status-available-bg: #def7ec;
  --status-available-text: #03543f;
  --status-out-bg: #fde8e8;
  --status-out-text: #9b1c1c;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Layout */
  --container-width: 1200px;
  --header-height: 70px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

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

/* Layout */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  width: 100%;
}

/* Header */
.header {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

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

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

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

/* Hero Section */
.hero {
  padding: 60px 0 40px;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto var(--spacing-xl);
}

/* Search Bar */
.search-container {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 16px 24px;
  border-radius: 100px;
  border: 1px solid var(--border-color);
  background: white;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Book Card */
.book-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  overflow: hidden;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

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

.book-image-container {
  aspect-ratio: 2/3;
  width: 100%;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-image-placeholder {
  width: 100%;
  height: 100%;
  background-color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 2rem;
}

.card-content {
  padding: var(--spacing-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.book-source {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.book-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-title a {
  transition: color 0.2s;
}

.book-title a:hover {
  color: var(--primary-accent);
}

.book-author {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-color);
}

.book-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.status-badge {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.status-available {
  background-color: var(--status-available-bg);
  color: var(--status-available-text);
}

.status-out {
  background-color: var(--status-out-bg);
  color: var(--status-out-text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-block {
  width: 100%;
}

.card-action {
  margin-top: var(--spacing-md);
}

/* Footer */
.footer {
  background: white;
  border-top: 1px solid var(--border-color);
  padding: 40px 0;
  margin-top: auto;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Utilities */
.hidden { display: none; }

/* Helpers */
.text-center { text-align: center; }

.logo-icon {
  width: 24px; 
  height: 24px; 
  background: var(--primary-accent); 
  border-radius: 4px;
}

.btn-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Placeholder Variants */
.ph-blue { background-color: #eff6ff; color: #2563eb; }
.ph-red { background-color: #fff1f2; color: #e11d48; }
.ph-green { background-color: #ecfdf5; color: #059669; }
.ph-yellow { background-color: #fffbeb; color: #d97706; }
.ph-slate { background-color: #f1f5f9; color: #64748b; }
.ph-gray { background-color: #fafafa; color: #525252; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--spacing-md);
  }
  
  /* Make cards simpler on mobile */
  .book-title {
    font-size: 1rem;
  }
  
  .card-content {
    padding: var(--spacing-sm);
  }
}
