/* ==================== BOOK DETAIL CONTAINER ==================== */
.book-detail-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* ==================== BOOK DETAIL LAYOUT ==================== */
.book-detail-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* ==================== SIDEBAR ==================== */
.book-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Book Cover */
.book-cover-large {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-bottom: 20px;
}

.book-cover-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-placeholder-large {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

/* Sidebar Sections */
.sidebar-section {
  margin-bottom: 0;
  padding: 15px 0;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar-section:first-of-type {
  padding-top: 0;
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: #2d3748;
  margin-bottom: 10px;
}

/* Form Controls */
.form-control {
  width: 100%;
  padding: 10px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.95rem;
  background: white;
  cursor: pointer;
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
}

/* Star Rating */
.star-rating {
  display: flex;
  gap: 4px;
  justify-content: center;
  user-select: none;
  margin-bottom: 8px;
}

.star-container {
  position: relative;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.star-svg {
  width: 100%;
  height: 100%;
}

.rating-display {
  text-align: center;
  font-size: 0.9rem;
  color: #4a5568;
  margin: 8px 0 4px 0;
}

/* Progress Bar in Sidebar */
.progress-bar-sidebar {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-sidebar .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.3s ease;
}

.progress-info-sidebar {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.progress-percent {
  font-weight: 600;
  color: #667eea;
}

.progress-pages {
  color: #718096;
}

.status-message {
  font-size: 0.9rem;
  color: #4a5568;
  margin: 10px 0;
}

/* Checkbox Labels */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.checkbox-label:hover {
  background: #f7fafc;
  border-radius: 4px;
  padding-left: 4px;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.shelves-list-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.format-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Links */
.link-secondary {
  display: inline-block;
  font-size: 0.85rem;
  color: #667eea;
  text-decoration: none;
  margin-top: 8px;
}

.link-secondary:hover {
  text-decoration: underline;
}

.back-link {
  display: inline-block;
  color: #667eea;
  text-decoration: none;
  margin-bottom: 20px;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

/* Text Styles */
.text-muted {
  color: #a0aec0;
  font-size: 0.85rem;
}

.text-small {
  font-size: 0.75rem;
  margin-top: 4px;
}

/* ==================== MAIN CONTENT ==================== */
.book-detail-main {
  min-width: 0;
}

/* Book Header */
.book-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #eee;
}

.book-header h1 {
  font-size: 2.5rem;
  margin: 0 0 10px 0;
  color: #2d3748;
  line-height: 1.2;
}

.book-author-large {
  font-size: 1.3rem;
  color: #718096;
  margin: 5px 0;
  font-weight: 400;
}

.book-series-large {
  font-size: 1.1rem;
  color: #667eea;
  font-style: italic;
  margin: 5px 0;
  font-weight: 500;
}

.series-link {
  color: #667eea;
  text-decoration: none;
}

.series-link:hover {
  text-decoration: underline;
}

/* Community Rating */
.community-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 15px;
  background: #f7fafc;
  border-radius: 8px;
}

.rating-stars {
  font-size: 1.3rem;
}

.rating-number {
  font-size: 1.2rem;
  font-weight: 700;
  color: #2d3748;
}

.rating-count {
  font-size: 0.9rem;
  color: #718096;
}

/* Book Description */
.book-description {
  margin: 20px 0 30px 0;
  line-height: 1.6;
  color: #4a5568;
}

.book-description h3 {
  font-size: 1.2rem;
  color: #2d3748;
  margin-bottom: 15px;
}

.book-description p {
  margin-bottom: 15px;
}

/* Genre Tags */
.book-genre-section {
  margin: 25px 0;
}

.book-genre-section h4 {
  font-size: 1rem;
  color: #2d3748;
  margin-bottom: 10px;
}

.genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genre-tag {
  padding: 6px 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Publication Info */
.book-publication-info {
  margin: 25px 0;
  padding: 20px;
  background: #f9fafb;
  border-radius: 8px;
}

.book-publication-info h4 {
  font-size: 1rem;
  color: #2d3748;
  margin-bottom: 15px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.info-item {
  display: flex;
  gap: 8px;
}

.info-label {
  font-weight: 600;
  color: #4a5568;
}

.info-value {
  color: #718096;
}

/* Reviews Section */
.reviews-section {
  margin: 30px 0;
  padding: 25px;
  background: #f9fafb;
  border-radius: 12px;
}

.reviews-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.reviews-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #2d3748;
}

.review-sort {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
}

.review-placeholder {
  padding: 40px 20px;
  text-align: center;
  background: white;
  border-radius: 8px;
  border: 2px dashed #e2e8f0;
  margin-bottom: 20px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 968px) {
  .book-detail-layout {
    grid-template-columns: 1fr;
  }
  
  .book-detail-sidebar {
    max-width: 400px;
    margin: 0 auto;
  }
  
  .book-cover-large {
    max-width: 300px;
    margin: 0 auto 20px auto;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .reviews-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Add Book Page */
.add-book-container {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  max-width: 800px;
  margin: 0 auto;
}

.add-book-container h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

.search-section, .create-section {
  margin-bottom: 30px;
}

.search-section h3, .create-section h3 {
  margin-bottom: 15px;
  color: #667eea;
}

.search-box {
  display: flex;
  gap: 10px;
}

.search-box input {
  flex: 1;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
}

.search-box button {
  padding: 12px 24px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.search-results {
  margin-top: 20px;
}

.book-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 10px;
}

.book-info strong {
  color: #333;
  font-size: 1.1em;
}

.btn-small {
  padding: 8px 16px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-small:hover {
  background: #5568d3;
}

.create-section form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-row {
  display: flex;
  gap: 15px;
}

.form-row > div {
  display: flex;
  flex-direction: column;
}

.form-row input {
  flex: 1;
}

.create-section input,
.create-section select {
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
}

.checkbox-group {
  display: flex;
  gap: 20px;
  padding: 10px 0;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.no-results {
  text-align: center;
  color: #999;
  padding: 20px;
  font-style: italic;
}
/* Tabs */
.search-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #ddd;
}

.tab-btn {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: #666;
  transition: all 0.3s;
}

.tab-btn:hover {
  color: #667eea;
}

.tab-btn.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Genre formatting */
.metadata-row {
  display: flex;
  align-items: flex-start !important; /* Override the space-between */
  gap: 10px;
  margin: 10px 0;
}

.metadata-row strong {
  flex-shrink: 0; /* Prevents the label from shrinking */
}

.genre-list {
  flex: 1;
  color: #4a5568;
  line-height: 1.4;
  text-wrap: wrap;
}

/* Optional: Style the bullet points */
.genre-list {
  color: #667eea; /* Match your theme color */
}

/* Search Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.result-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s;
}

.result-card:hover {
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

.result-cover {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.result-cover-placeholder {
  width: 100%;
  height: 260px;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.result-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-info h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #2d3748;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-author {
  margin: 0;
  font-size: 0.85rem;
  color: #667eea;
  font-weight: 500;
}

.result-series,
.result-year {
  margin: 0;
  font-size: 0.8rem;
  color: #718096;
}

.result-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.result-actions .btn-secondary {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  font-size: 0.85rem;
  background: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.3s;
}

.result-actions .btn-secondary:hover {
  background: #5568d3;
}

/* Responsive */
@media (max-width: 768px) {
  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }
  
  .result-cover,
  .result-cover-placeholder {
    height: 200px;
  }
}