/* ==========================================================================
   Library Layout - Main Structure
   ========================================================================== */

:root {
  --primary-color: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --accent-color: #f97316;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --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);
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 1rem;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* Container Layout */
.library-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.library-content {
  grid-column: 1;
}

.library-sidebar {
  grid-column: 2;
}

/* Main Container for Standalone Layout */
.library-main-container {
  padding: 40px 0;
  background-color: var(--bg-light);
  min-height: calc(100vh - 180px);
  position: relative;
  overflow: hidden;
}

.library-main-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.03) 0%, rgba(30, 64, 175, 0.01) 50%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

/* ==========================================================================
   Header Styles
   ========================================================================== */

/* Main Header (Standalone Layout) */
.library-header-main {
  background-color: var(--bg-white);
  box-shadow: var(--shadow-md);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(30, 64, 175, 0.1);
}

.header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header-title h1 {
  font-size: 1.8rem;
  margin: 0;
  color: var(--primary-color);
  font-weight: 700;
  letter-spacing: -0.5px;
  position: relative;
}

.header-title h1::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  border-radius: 2px;
  transition: width var(--transition-normal);
}

.header-title:hover h1::after {
  width: 80%;
}

.header-nav {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-normal);
  position: relative;
  padding: 5px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-light);
  transition: width var(--transition-normal);
}

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

.nav-link:hover::after {
  width: 100%;
}

/* Logo Styles */
.logo img {
  height: 50px;
  width: auto;
  transition: transform var(--transition-normal);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.logo img:hover {
  transform: scale(1.05) rotate(2deg);
}

/* Secondary Header (Inside Content) */
.library-header {
  grid-column: 1 / -1;
  margin-bottom: 40px;
  text-align: center;
  padding: 30px;
  background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-light) 100%);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(30, 64, 175, 0.05);
}

.library-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%233b82f6' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
  opacity: 0.5;
  z-index: 0;
}

.library-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: var(--primary-dark);
  position: relative;
  z-index: 1;
  font-weight: 800;
  letter-spacing: -1px;
}

.library-header .subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 25px;
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Search and Filter Components
   ========================================================================== */

/* Search Container */
.search-container {
  display: flex;
  max-width: 600px;
  margin: 0 auto 20px;
  position: relative;
  z-index: 1;
}

.search-container input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid rgba(30, 64, 175, 0.2);
  border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
  font-size: 1rem;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.search-container input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-container button {
  padding: 14px 22px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.search-container button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.search-container button:active {
  transform: translateY(0);
}

/* Filter controls */
.filter-controls {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

/* Search box */
.search-box {
  position: relative;
  min-width: 300px;
  margin-right: 15px;
}

.search-box input {
  width: 100%;
  padding: 12px 45px 12px 40px;
  border: 1px solid rgba(26, 89, 40, 0.2);
  border-radius: 30px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  background-color: white;
}

.search-box input:focus {
  outline: none;
  border-color: #1a5928;
  box-shadow: 0 0 0 3px rgba(26, 89, 40, 0.15);
  width: 110%;
}

.search-box .search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #1a5928;
  opacity: 0.7;
}

.search-box .search-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: #1a5928;
  border: none;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 50%;
}

.search-box .search-btn:hover {
  background-color: #124d1e;
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Clear search button */
.search-box .clear-btn {
  position: absolute;
  right: 45px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.9rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 50%;
  z-index: 2;
}

.search-box .clear-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1a5928;
}

/* Category filter */
.category-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-filter span {
  color: #64748b;
  font-weight: 500;
}

.category-filter select {
  padding: 10px 30px 10px 15px;
  border: 1px solid rgba(26, 89, 40, 0.2);
  border-radius: 30px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  cursor: pointer;
  min-width: 200px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%231a5928' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 12px) center;
  background-size: 12px;
  background-color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  color: #1e293b;
}

.category-filter select:focus {
  outline: none;
  border-color: #1a5928;
  box-shadow: 0 0 0 3px rgba(26, 89, 40, 0.15);
}

/* ==========================================================================
   Book Grid and Cards
   ========================================================================== */

/* Book Collection */
.book-collection {
  padding: 60px 0;
  background-color: white;
  position: relative;
}

.book-collection::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231a5928' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.collection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-controls {
  display: flex;
  gap: 15px;
}

/* Book Grid Layout */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-gap: 30px;
  position: relative;
}

/* Book Card Styles - Enhanced */
.book-card {
  background-color: var(--bg-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
  border-color: rgba(26, 89, 40, 0.15);
}

/* Book Cover */
.book-cover {
  height: 300px;
  overflow: hidden;
  position: relative;
  background-color: #f5f5f5;
}

.book-cover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,0.2) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.book-card:hover .book-cover::after {
  opacity: 1;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.book-card:hover .book-cover img {
  transform: scale(1.08);
}

.no-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
  text-align: center;
  font-weight: bold;
  color: var(--text-light);
}

/* Book ribbon for new books */
.book-ribbon {
  position: absolute;
  top: 15px;
  right: -30px;
  background: #1a5928;
  color: white;
  padding: 5px 30px;
  transform: rotate(45deg);
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  z-index: 2;
}

/* Book Information */
.book-info {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: white;
  border-radius: 0 0 16px 16px;
}

.book-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #1e293b;
  line-height: 1.4;
  font-weight: 700;
  transition: color 0.3s ease;
}

.book-card:hover .book-title {
  color: #1a5928;
}

.book-author {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 16px;
  font-style: italic;
}

.book-category {
  display: inline-block;
  padding: 6px 12px;
  background-color: rgba(26, 89, 40, 0.08);
  border-radius: 20px;
  font-size: 0.8rem;
  color: #1a5928;
  margin-bottom: 20px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.book-card:hover .book-category {
  background-color: rgba(26, 89, 40, 0.15);
}

/* Book Action Buttons */
.book-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  font-weight: 600;
  flex: 1;
  min-width: 100px;
  border: none;
}

.btn-primary {
  background-color: #1a5928;
  color: white;
}

.btn-primary:hover {
  background-color: #124d1e;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(26, 89, 40, 0.3);
}

.btn-secondary {
  background-color: #10b981;
  color: white;
}

.btn-secondary:hover {
  background-color: #059669;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.btn-tertiary {
  background-color: #8b5cf6;
  color: white;
}

.btn-tertiary:hover {
  background-color: #7c3aed;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

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

/* Bookmark button */
.bookmark-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f8f9fa;
  color: #64748b;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: absolute;
  top: -20px;
  right: 20px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bookmark-btn:hover {
  background: #e2e8f0;
  transform: scale(1.1);
}

.bookmark-btn.active {
  background: #1a5928;
  color: white;
  border-color: #1a5928;
}

/* Fade in animation for book cards */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease forwards;
  opacity: 0;
}

/* Staggered animation delay */
.book-card:nth-child(1) { animation-delay: 0.1s; }
.book-card:nth-child(2) { animation-delay: 0.2s; }
.book-card:nth-child(3) { animation-delay: 0.3s; }
.book-card:nth-child(4) { animation-delay: 0.4s; }
.book-card:nth-child(5) { animation-delay: 0.5s; }
.book-card:nth-child(6) { animation-delay: 0.6s; }
.book-card:nth-child(7) { animation-delay: 0.7s; }
.book-card:nth-child(8) { animation-delay: 0.8s; }

/* No Results Message */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
  background-color: rgba(248, 250, 252, 0.8);
  border-radius: 16px;
  margin-top: 40px;
  border: 1px dashed rgba(26, 89, 40, 0.2);
  animation: fadeIn 0.6s ease forwards;
}

.no-results h3 {
  font-size: 1.5rem;
  color: #1a5928;
  margin-bottom: 15px;
}

.no-results p {
  font-size: 1.1rem;
  margin-bottom: 0;
}

/* Loading effect for images */
.book-cover img.loading {
  filter: blur(10px);
}

.book-cover img.loaded {
  filter: blur(0);
  transition: filter 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-gap: 20px;
  }
  
  .book-cover {
    height: 250px;
  }
  
  .book-info {
    padding: 20px;
  }
}

@media (max-width: 576px) {
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    grid-gap: 15px;
  }
  
  .book-cover {
    height: 220px;
  }
  
  .book-title {
    font-size: 1.1rem;
  }
  
  .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
}

/* ==========================================================================
   Sidebar Components
   ========================================================================== */

.sidebar-section {
  background-color: var(--bg-white);
  border-radius: var(--border-radius-lg);
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(30, 64, 175, 0.05);
  transition: all var(--transition-normal);
}

.sidebar-section:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(30, 64, 175, 0.1);
}

.sidebar-section h3 {
  font-size: 1.25rem;
  margin-bottom: 18px;
  color: var(--primary-dark);
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(30, 64, 175, 0.1);
  font-weight: 600;
  position: relative;
}

.sidebar-section h3::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  border-radius: 2px;
}

/* List Styles */
.recent-books, .resources-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-books li, .resources-list li {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(30, 64, 175, 0.05);
}

.recent-books li:last-child, .resources-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.recent-books a, .resources-list a {
  text-decoration: none;
  color: var(--text-dark);
  transition: all var(--transition-normal);
  display: block;
  padding: 5px 0;
  font-weight: 500;
}

.recent-books a:hover, .resources-list a:hover {
  color: var(--primary-color);
  transform: translateX(5px);
}

/* Category Tags */
.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-tag {
  display: inline-block;
  padding: 6px 12px;
  background-color: rgba(59, 130, 246, 0.1);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--primary-color);
  text-decoration: none;
  transition: all var(--transition-normal);
  font-weight: 500;
}

.category-tag:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */

.library-footer {
  background-color: var(--primary-dark);
  color: #fff;
  padding: 40px 0 30px;
  position: relative;
  overflow: hidden;
}

.library-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-light), var(--accent-color));
}

.footer-content {
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.footer-logo {
  margin-bottom: 25px;
}

.footer-logo img {
  height: 60px;
  width: auto;
  filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: transform var(--transition-normal);
}

.footer-logo img:hover {
  transform: scale(1.05);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 25px;
}

.footer-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all var(--transition-normal);
  font-weight: 500;
  position: relative;
  padding: 5px 0;
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: width var(--transition-normal);
}

.footer-link:hover {
  color: #ffffff;
}

.footer-link:hover::after {
  width: 100%;
}

.footer-copyright {
  font-size: 0.95rem;
  opacity: 0.7;
  margin-top: 20px;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Large screens adjustment */
@media (max-width: 900px) {
  .library-container {
    grid-template-columns: 1fr;
  }
  
  .library-sidebar {
    grid-column: 1;
  }
}

/* Medium screens adjustment */
@media (max-width: 768px) {
  .header-wrapper {
    flex-direction: column;
    gap: 15px;
  }
  
  .header-nav {
    margin-top: 10px;
  }
  
  .library-header {
    padding: 25px 20px;
  }
  
  .library-header h1 {
    font-size: 2rem;
  }
  
  .sidebar-section {
    padding: 20px;
  }
  
  .footer-links {
    flex-wrap: wrap;
    gap: 20px 30px;
  }
}

/* Small screens adjustment */
@media (max-width: 600px) {
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    grid-gap: 20px;
  }
  
  .search-container {
    flex-direction: column;
  }
  
  .search-container input {
    border-radius: var(--border-radius-md);
    margin-bottom: 10px;
  }
  
  .search-container button {
    border-radius: var(--border-radius-md);
  }
  
  .book-cover {
    height: 220px;
  }
  
  .book-info {
    padding: 15px;
  }
  
  .book-title {
    font-size: 1rem;
  }
}

/* Extra small screens adjustment */
@media (max-width: 576px) {
  .library-header-main {
    padding: 10px 0;
  }
  
  .logo img {
    height: 40px;
  }
  
  .header-title h1 {
    font-size: 1.5rem;
  }
  
  .library-header h1 {
    font-size: 1.8rem;
  }
  
  .library-header .subtitle {
    font-size: 1rem;
  }
  
  .category-filter select {
    min-width: 150px;
  }
}

/* Add to your library.css file */

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #1a5928 0%, #2e8a3d 100%);
  padding: 60px 0 80px;
  position: relative;
  color: white;
}

.hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z' fill='%23ffffff'%3E%3C/path%3E%3C/svg%3E");
  background-size: cover;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.text-accent {
  color: #ffc107;
}

.hero-subtitle {
  font-size: 1.3rem;
  opacity: 0.9;
  margin-bottom: 30px;
}

/* Category Cards */
.category-section {
  padding: 60px 0;
  background-color: #f8f9fa;
}

.section-title {
  font-size: 2rem;
  color: #1a5928;
  margin-bottom: 30px;
  position: relative;
  display: inline-block;
}

.section-title:after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: #1a5928;
  border-radius: 3px;
}

.category-card {
  background-color: white;
  border-radius: 10px;
  padding: 25px 20px;
  height: 100%;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
  border: 1px solid rgba(0,0,0,0.05);
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  border-color: rgba(26, 89, 40, 0.2);
}

.category-icon {
  font-size: 2.5rem;
  color: #1a5928;
  margin-bottom: 20px;
}

.category-card h3 {
  font-size: 1.3rem;
  color: #333;
  margin-bottom: 10px;
}

.category-card p {
  font-size: 0.9rem;
  color: #666;
}

/* Book Collection */
.book-collection {
  padding: 60px 0;
  background-color: white;
}

.collection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-controls {
  display: flex;
  gap: 15px;
}

/* Recently Added Section */
.recently-added {
  padding: 60px 0;
  background-color: #f8f9fa;
}

.recent-books-slider {
  display: flex;
  overflow-x: auto;
  gap: 20px;
  padding: 10px 0 30px;
}

.recent-book-item {
  min-width: 180px;
  text-align: center;
}

.recent-book-cover {
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  margin-bottom: 10px;
}

.recent-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-book-item h4 {
  font-size: 0.95rem;
  color: #333;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .hero-title {
      font-size: 2.5rem;
  }
  
  .hero-subtitle {
      font-size: 1.1rem;
  }
  
  .collection-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 15px;
  }
}

/* Category Carousel Styles */
.category-carousel-section {
  padding: 40px 0;
  background-color: #f8f9fa;
}

.category-carousel {
  position: relative;
  padding: 20px 50px;
  margin-bottom: 40px;
}

.carousel-container {
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.category-slide {
  flex: 0 0 auto;
  width: 300px;
  padding: 0 15px;
}

.category-card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.card-image {
  position: relative;
  height: 160px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.category-card:hover .card-image img {
  transform: scale(1.1);
}

.category-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.6));
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-icon {
  font-size: 2.5rem;
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.category-card h3 {
  font-size: 1.2rem;
  padding: 15px 15px 10px;
  margin: 0;
  color: #1a5928;
  font-weight: 600;
}

.category-links {
  list-style: none;
  padding: 0 15px;
  margin: 0 0 10px;
  flex-grow: 1;
}

.category-links li {
  margin-bottom: 8px;
}

.category-links a {
  text-decoration: none;
  color: #555;
  font-size: 0.9rem;
  display: block;
  padding: 5px 0;
  transition: all 0.2s ease;
}

.category-links a:hover {
  color: #1a5928;
  transform: translateX(5px);
}

.explore-more {
  display: block;
  text-align: center;
  padding: 10px 15px;
  background-color: #f8f9fa;
  color: #1a5928;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  margin-top: auto;
}

.explore-more:hover {
  background-color: #1a5928;
  color: white;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
}

.carousel-control:hover {
  background-color: #1a5928;
  color: white;
}

.prev-btn {
  left: 5px;
}

.next-btn {
  right: 5px;
}

@media (max-width: 768px) {
  .category-slide {
      width: 250px;
  }
  
  .carousel-control {
      width: 35px;
      height: 35px;
  }
}

@media (max-width: 576px) {
  .category-slide {
      width: 220px;
  }
  
  .category-carousel {
      padding: 20px 40px;
  }
  
  .card-image {
      height: 140px;
  }
  
  .category-card h3 {
      font-size: 1.1rem;
  }
}

/* Results counter */
.results-counter {
  margin-bottom: 20px;
  color: #64748b;
  font-size: 0.95rem;
  background-color: rgba(26, 89, 40, 0.05);
  padding: 8px 15px;
  border-radius: 8px;
  display: inline-block;
}

.results-counter #resultsCounter {
  font-weight: 600;
  color: #1a5928;
}

.search-term-display {
  font-style: italic;
}

.search-term-display strong {
  color: #1a5928;
  font-style: normal;
}

/* Highlight for search matches */
.highlight {
  background-color: rgba(26, 89, 40, 0.15);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
  color: #1a5928;
}

/* Special highlight for cards with strong matches */
.highlight-match {
  border: 2px solid #1a5928 !important;
  box-shadow: 0 15px 30px rgba(26, 89, 40, 0.2) !important;
}

.highlight-match .book-info {
  background-color: rgba(26, 89, 40, 0.03);
}

/* Search Results Styling */
.section-title.search-mode {
  color: #1a5928;
  position: relative;
  padding-bottom: 10px;
}

.section-title.search-mode::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 3px;
  background-color: #1a5928;
  border-radius: 3px;
  transform: none;
}

.search-query {
  color: #1a5928;
  font-weight: 700;
  position: relative;
  padding: 0 5px;
}

.search-query::before {
  content: '"';
}

.search-query::after {
  content: '"';
}

/* Back to All Books button */
.back-to-all-btn {
  background-color: #1a5928;
  color: white;
  border: none;
  border-radius: 30px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-to-all-btn:hover {
  background-color: #124d1e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-all-btn i {
  font-size: 0.8rem;
}

/* Search Results Container */
.book-collection.search-active {
  background-color: #f8f9fa;
  padding-top: 40px;
}

.book-collection.search-active::before {
  opacity: 0.5;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231a5928' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Search animation */
@keyframes searchPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 89, 40, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(26, 89, 40, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(26, 89, 40, 0);
  }
}

.highlight-match {
  animation: searchPulse 2s infinite;
}

/* Enhance the existing search box in the hero section */
.search-container .input-group {
  position: relative;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.search-container .input-group:focus-within {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.search-container .form-control {
  padding: 15px 20px;
  border: none;
  font-size: 1rem;
  border-radius: 30px 0 0 30px;
}

.search-container .btn-primary {
  background-color: #1a5928;
  border: none;
  padding: 12px 25px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.search-container .btn-primary:hover {
  background-color: #124d1e;
}

/* Add clear button to the search input */
.search-container {
  position: relative;
}

#clearSearchHero {
  position: absolute;
  right: 90px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.9rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

#clearSearchHero:hover {
  color: #1a5928;
}

/* Section Header */
.section-header {
  padding: 60px 0;
  background-color: #f8f9fa;
  position: relative;
}

.section-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff' fill-opacity='1' d='M0,128L60,138.7C120,149,240,171,360,165.3C480,160,600,128,720,128C840,128,960,160,1080,170.7C1200,181,1320,171,1380,165.3L1440,160L1440,320L1380,320C1320,320,1200,320,1080,320C960,320,840,320,720,320C600,320,480,320,360,320C240,320,120,320,60,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.section-header .display-4 {
  color: #1a5928;
  margin-bottom: 20px;
}

.section-header .divider {
  width: 80px;
  height: 4px;
  background-color: #1a5928;
  margin-bottom: 20px;
}

.section-header .lead {
  max-width: 700px;
  margin: 0 auto;
}

/* Article Collection */
.article-collection {
  background-color: #f8f9fa;
}

/* Related Resources */
.related-resources .card {
  height: 100%;
  transition: all 0.3s ease;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.related-resources .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.related-resources .card-title {
  color: #1a5928;
  font-size: 1.25rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.related-resources .list-unstyled li {
  margin-bottom: 10px;
}

.related-resources .list-unstyled a {
  color: #1e293b;
  text-decoration: none;
  transition: all 0.2s ease;
  display: block;
  padding: 5px 0;
}

.related-resources .list-unstyled a:hover {
  color: #1a5928;
  transform: translateX(5px);
}