/* Theme variables */
:root {
  /* Light Theme Colors */
  --bg-primary: #F9E4D4; /* Soft Ivory Quartz */
  --bg-secondary: #F9E4D4; /* Clean white */
  --text-primary: #2C2C2C; /* Charcoal Gray */
  --text-secondary: #6c6f76;
  --accent: #70193D; /* Deep Persian Plum */
  --border-color: #E6C8B9; /* Subtle peachy border tone */
  --shadow: rgba(112, 25, 61, 0.1); /* Deep Persian Plum with low opacity */
  
  /* Element specific colors */
  --card-bg: var(--bg-secondary);
  --navbar-bg: var(--bg-primary);
  --footer-bg: var(--bg-secondary);
}

/* Dark Theme Colors */
[data-theme="dark"] {
  --bg-primary: #2A1A2E; /* Dark plum background */
  --bg-secondary: #3A2A3E; /* Darker plum card */
  --text-primary: #F0E6D4; /* Light ivory text */
  --text-secondary: #C8B8A8; /* Muted light */
  --accent: #70193D; /* Deep Persian Plum */
  --border-color: #1f2937;
  --shadow: rgba(0, 0, 0, 0.5);
  
  /* Element specific colors */
  --card-bg: var(--bg-secondary);
  --navbar-bg: var(--bg-primary);
  --footer-bg: var(--bg-secondary);
}

/* Global Styles */
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  transition: background-color 0.3s, color 0.3s;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

/* Improved Container Spacing */
.container {
  max-width: 1400px;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (min-width: 576px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 768px) {
  .container {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

@media (min-width: 992px) {
  .container {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

/* Navbar styles */
.navbar {
  background: var(--navbar-bg);
  box-shadow: 0 2px 10px var(--shadow);
  padding: 0;
  border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  font-size: 1.4em;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.brand {
  font-weight: 700;
  color: var(--accent);
}

.small-muted {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.navbar-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 30px;
  align-items: center;
}

.navbar-nav .nav-link {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

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

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

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

/* Enhanced Button Styles */
.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: white;
  border-radius: 8px;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background-color: #5a1431;
  border-color: #5a1431;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #5a1431);
  border: none;
  color: white;
  border-radius: 8px;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #5a1431, #3d0f23);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-outline-primary {
  border: 2px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 8px;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-outline-primary:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-success {
  background: linear-gradient(135deg, #28a745, #20c997);
  border: none;
  color: white;
  border-radius: 8px;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-success:hover {
  background: linear-gradient(135deg, #218838, #1aa085);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Book Cards Container */
.book-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Book Card Styles */
.book-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 20px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.book-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px var(--shadow);
}

.book-cover {
  width: 100%;
  height: 0;
  padding-bottom: 140%; /* 5:7 aspect ratio (approx. 300x420) */
  object-fit: cover;
  display: block;
  background-color: #f5f5f5;
  position: relative;
}

.book-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-info {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.book-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  line-height: 1.35;
}

.book-author {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.book-button {
  background-color: var(--accent);
  color: white;
  border: none;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  width: fit-content;
  margin-top: auto;
  font-size: 0.95rem;
}

.book-button:hover {
  background-color: #5a1330;
}



/* Enhanced Badges */
.book-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
}

.book-badge.free-badge {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.book-badge.premium-badge {
  background: #28a745;
}

.badge-text {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
}

.price-display {
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.3);
  padding: 0.125rem 0.25rem;
  border-radius: 2px;
  margin-top: 0.125rem;
  line-height: 1;
}

/* Category and Rating Tags */
.book-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.book-tag {
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.book-tag.price-tag {
  background: #28a745;
  color: white;
}



/* Enhanced CTAs */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-cta i {
  font-size: 1.1em;
}

/* List view for books */
#library.list-view .book-card {
  display: flex;
  flex-direction: row;
}

#library.list-view .book-card .cover {
  width: 150px;
  height: auto;
  aspect-ratio: 2/3;
}

#library.list-view .book-card .card-body {
  flex: 1;
}

/* Enhanced Footer */
footer {
  background: var(--footer-bg);
  border-top: 2px solid var(--border-color);
  margin-top: 4rem;
  padding: 3rem 0 2rem;
}

footer .container {
  max-width: 1400px;
}

footer h5 {
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 1rem;
}

footer p, footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

footer .social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

footer .social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

footer .social-links a:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

footer .social-links a i {
  color: var(--text-primary);
  font-size: 1.1rem;
}

footer .social-links a:hover i {
  color: white;
}

/* Enhanced Form Elements */
.form-control {
  background-color: var(--card-bg);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(112, 25, 61, 0.15);
  outline: none;
}

.form-control:hover {
  border-color: var(--accent);
}

.form-select {
  background-color: var(--card-bg);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(112, 25, 61, 0.15);
  outline: none;
}

.form-select:hover {
  border-color: var(--accent);
}

/* Enhanced Badges */
.badge {
  border-radius: 20px;
  font-weight: 600;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge.text-bg-warning {
  background: linear-gradient(135deg, #ffc107, #ffb300) !important;
  color: #000 !important;
  border: 1px solid #e0a800;
}

.badge.text-bg-success {
  background: linear-gradient(135deg, #28a745, #20c997) !important;
  color: #fff !important;
  border: 1px solid #1e7e34;
}

/* ========================================
   ENHANCED RESPONSIVE DESIGN FOR BOOK CARDS
   ======================================== */

/* Extra small devices (phones, 280px and up) */
@media (max-width: 319px) {
  .book-cards-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 0.5rem;
  }

  .book-card {
    border-radius: 12px;
  }

  .book-cover {
    padding-bottom: 130%; /* Slightly shorter for very small screens */
  }

  .book-info {
    padding: 1rem 0.75rem;
  }

  .book-title {
    font-size: 1.1rem;
    margin-bottom: 0.375rem;
  }

  .book-author {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .book-button {
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
  }

  body {
    padding: 1rem 0.5rem;
  }
}

/* Small phones (320px and up) */
@media (min-width: 320px) and (max-width: 359px) {
  .book-cards-container {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 0 0.75rem;
  }

  .book-title {
    font-size: 1.15rem;
  }

  body {
    padding: 1.25rem 0.75rem;
  }
}

/* Medium phones (360px and up) */
@media (min-width: 360px) and (max-width: 479px) {
  .book-cards-container {
    grid-template-columns: 1fr;
    gap: 1.4rem;
    padding: 0 1rem;
  }

  .book-title {
    font-size: 1.2rem;
  }

  .book-info {
    padding: 1.125rem;
  }

  body {
    padding: 1.5rem 1rem;
  }
}

/* Large phones / Small tablets (480px and up) */
@media (min-width: 480px) and (max-width: 639px) {
  .book-cards-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 0 1.25rem;
  }

  .book-title {
    font-size: 1.2rem;
  }

  .book-info {
    padding: 1.125rem;
  }

  body {
    padding: 1.75rem 1.25rem;
  }
}

/* Medium tablets (640px and up) */
@media (min-width: 640px) and (max-width: 767px) {
  .book-cards-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.6rem;
    padding: 0 1.5rem;
  }

  .book-title {
    font-size: 1.25rem;
  }

  .book-info {
    padding: 1.25rem;
  }

  body {
    padding: 2rem 1.5rem;
  }
}

/* Small desktops / Large tablets (768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
  .book-cards-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.75rem;
    padding: 0 2rem;
  }

  .book-title {
    font-size: 1.25rem;
  }

  body {
    padding: 2.25rem 2rem;
  }
}

/* Medium desktops (992px and up) */
@media (min-width: 992px) and (max-width: 1199px) {
  .book-cards-container {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.75rem;
    padding: 0 2.5rem;
  }

  .book-title {
    font-size: 1.25rem;
  }

  body {
    padding: 2.5rem 2.5rem;
  }
}

/* Large desktops (1200px and up) */
@media (min-width: 1200px) and (max-width: 1399px) {
  .book-cards-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 0 3rem;
  }

  body {
    padding: 2.75rem 3rem;
  }
}

/* Extra large desktops (1400px and up) */
@media (min-width: 1400px) {
  .book-cards-container {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.25rem;
    padding: 0 3.5rem;
  }

  .book-title {
    font-size: 1.3rem;
  }

  body {
    padding: 3rem 3.5rem;
  }
}

/* Ultra-wide screens (1600px and up) */
@media (min-width: 1600px) {
  .book-cards-container {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1800px;
    margin: 0 auto;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .book-card:hover {
    transform: none; /* Disable hover transform on touch devices */
  }

  .book-button {
    min-height: 44px; /* Ensure touch targets are at least 44px */
    padding: 0.75rem 1.25rem;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .book-card {
    box-shadow: 0 8px 24px var(--shadow);
  }

  .book-card:hover {
    box-shadow: 0 16px 40px var(--shadow);
  }
}

/* Portrait orientation adjustments */
@media (orientation: portrait) and (max-width: 767px) {
  .book-cards-container {
    gap: 1.25rem;
  }

  .book-cover {
    padding-bottom: 135%; /* Slightly adjust aspect ratio for portrait */
  }
}

/* Landscape orientation adjustments for phones */
@media (orientation: landscape) and (max-height: 500px) {
  .book-cards-container {
    gap: 1rem;
  }

  .book-info {
    padding: 0.875rem;
  }

  .book-title {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
  }

  .book-author {
    font-size: 0.85rem;
    margin-bottom: 0.875rem;
  }

  .book-button {
    padding: 0.5rem 0.875rem;
    font-size: 0.9rem;
  }
}

/* Page-specific responsive improvements */
@media (max-width: 767px) {
  /* Books page */
  .books.php main {
    padding: 0;
  }

  /* Summaries page */
  .summaries.php main {
    padding: 0;
  }

  /* Index page */
  .index.php main {
    padding: 0;
  }

  /* Hide sort label on very small screens */
  .small-muted.d-none.d-sm-inline {
    display: none !important;
  }

  /* Stack form elements vertically on mobile */
  .d-flex.flex-column.flex-sm-row {
    flex-direction: column;
  }

  .align-items-stretch.align-items-sm-center {
    align-items: stretch;
  }

  /* Make search input full width on mobile */
  .form-control.flex-grow-1 {
    flex-grow: 1;
    min-width: auto;
  }

  /* Adjust section padding */
  .p-2.p-sm-3 {
    padding: 0.5rem 0.75rem;
  }

  /* Adjust heading sizes */
  .h5.h4-sm {
    font-size: 1.1rem;
  }

  .h6.h5-sm {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  /* Reduce gaps and padding further */
  .book-cards-container {
    gap: 1rem;
  }

  .gap-2.gap-sm-3 {
    gap: 0.75rem;
  }

  /* Smaller section padding */
  .p-2.p-sm-3 {
    padding: 0.5rem;
  }

  /* Stack all controls vertically */
  .d-flex.flex-column.flex-sm-row {
    flex-direction: column;
  }

  /* Full width buttons */
  .btn {
    width: 100%;
  }
}

/* Dashboard Styles */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--bg-primary) 0%, #F0E6D4 100%);
  border-radius: 16px;
  padding: 3rem 2rem;
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow);
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 30%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(112, 25, 61, 0.05) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #5a1431);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 2rem;
  box-shadow: 0 4px 12px var(--shadow);
  flex-shrink: 0;
}

.hero-text h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.hero-text p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Action Cards */
.action-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.action-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
  box-shadow: 0 4px 20px var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
}

.action-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px var(--shadow);
  border-color: var(--accent);
}

.action-card i {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.action-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.action-card .btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.action-card .btn:hover {
  background: #5a1431;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow);
}

/* Stats Section */
.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 4px 20px var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #5a1431);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-content h3 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.stat-content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Books Section */
.books-section {
  margin-bottom: 4rem;
}

.books-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.books-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.books-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.books-controls .form-select,
.books-controls .form-control {
  min-width: 200px;
}

/* Books Grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
}

.book-card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
}

.book-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px var(--shadow);
  border-color: var(--accent);
}

.book-cover {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.book-info {
  padding: 1.5rem;
}

.book-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.book-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.book-card .btn {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--accent);
  color: white;
  padding: 0.75rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
}

.book-card .btn:hover {
  background: #5a1431;
  transform: translateY(-2px);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 4px 20px var(--shadow);
  border: 1px solid var(--border-color);
}

.empty-state i {
  font-size: 4rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 1200px) {
  .container {
    max-width: 100%;
  }

  .dashboard-container {
    padding: 0 1rem;
  }

  .hero-section {
    padding: 2.5rem 1.5rem;
  }

  .hero-text h1 {
    font-size: 2rem;
  }

  .action-cards {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .stats-section {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .navbar-brand {
    font-size: 1.2em;
  }

  .navbar-nav {
    gap: 15px;
  }

  .book-card, .book-card-cilmiye {
    border-radius: 12px;
  }

  .book-card .cover, .book-card-cilmiye .book-cover-image {
    height: 180px;
  }

  .book-card .card-body, .book-card-cilmiye .book-card-content {
    padding: 1.25rem;
  }

  .book-card h5, .book-card-cilmiye .book-title {
    font-size: 1rem;
  }

  .book-card .small-muted, .book-card-cilmiye .book-author,
  .book-card-cilmiye .book-release-date {
    font-size: 0.85rem;
  }

  .book-card .btn, .book-card-cilmiye .book-action-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
  }

  .book-detail-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .book-cover-section {
    order: -1;
  }

  .book-info-section h1 {
    font-size: 1.8rem;
  }

  .book-meta {
    padding: 1rem;
  }

  .book-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .btn-cta {
    width: 100%;
    justify-content: center;
  }

  #library.list-view .book-card .cover {
    width: 100px;
    height: auto;
  }

  .dashboard-container {
    padding: 0 0.75rem;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .hero-section {
    padding: 2rem 1rem;
  }

  .hero-text h1 {
    font-size: 1.8rem;
  }

  .hero-text p {
    font-size: 1rem;
  }

  .avatar {
    width: 70px;
    height: 70px;
    font-size: 1.5rem;
  }

  .action-card {
    padding: 2rem 1.5rem;
  }

  .action-card i {
    font-size: 2.5rem;
  }

  .action-card h3 {
    font-size: 1.25rem;
  }

  .stat-card {
    padding: 1.5rem;
    gap: 1rem;
  }

  .stat-icon {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }

  .stat-content h3 {
    font-size: 1.5rem;
  }

  .books-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .books-controls {
    width: 100%;
    justify-content: space-between;
  }

  .books-controls .form-select,
  .books-controls .form-control {
    min-width: auto;
    flex: 1;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }

  .book-cover {
    height: 250px;
  }

  .empty-state {
    padding: 3rem 1.5rem;
  }

  .empty-state i {
    font-size: 3rem;
  }

  .empty-state h3 {
    font-size: 1.25rem;
  }
}

@media (max-width: 576px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .navbar-toggler {
    padding: 0.5rem;
  }

  .book-card, .book-card-cilmiye {
    border-radius: 10px;
  }

  .book-card .cover, .book-card-cilmiye .book-cover-image {
    height: 160px;
  }

  .book-card .card-body, .book-card-cilmiye .book-card-content {
    padding: 1rem;
  }

  .book-card h5, .book-card-cilmiye .book-title {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
  }

  .book-card .small-muted, .book-card-cilmiye .book-author,
  .book-card-cilmiye .book-release-date {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
  }

  .book-card .btn, .book-card-cilmiye .book-action-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .book-detail-page {
    padding: 0 0.75rem;
  }

  .book-info-section h1 {
    font-size: 1.6rem;
  }

  .book-meta {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .book-meta-item {
    font-size: 0.85rem;
  }

  .book-tags {
    gap: 0.375rem;
  }

  .book-tag {
    padding: 0.375rem 0.75rem;
    font-size: 0.7rem;
  }

  .description-content {
    font-size: 1rem;
  }

  #library.list-view .book-card {
    flex-direction: column;
  }

  #library.list-view .book-card .cover {
    width: 100%;
    height: 180px;
  }

  .dashboard-container {
    padding: 0 0.5rem;
  }

  .hero-section {
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
  }

  .hero-text h1 {
    font-size: 1.5rem;
  }

  .action-card {
    padding: 1.5rem 1rem;
  }

  .stat-card {
    padding: 1.25rem;
  }

  .books-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .book-cover {
    height: 200px;
  }

  .empty-state {
    padding: 2rem 1rem;
  }
}

@media (max-width: 480px) {
  .navbar-brand {
    font-size: 1.1em;
    padding: 12px 15px;
  }

  .book-card, .book-card-cilmiye {
    margin-bottom: 1rem;
  }

  .book-card .cover, .book-card-cilmiye .book-cover-image {
    height: 140px;
  }

  .book-detail-page {
    margin: 1rem auto;
  }

  .book-info-section h1 {
    font-size: 1.4rem;
  }

  .dashboard-container {
    padding: 0 0.5rem;
  }

  .hero-section {
    padding: 1.25rem 0.75rem;
  }

  .hero-text h1 {
    font-size: 1.4rem;
  }

  .hero-text p {
    font-size: 0.95rem;
  }

  .avatar {
    width: 60px;
    height: 60px;
    font-size: 1.25rem;
  }

  .action-cards {
    gap: 1rem;
  }

  .stats-section {
    gap: 1rem;
  }

  .books-grid {
    gap: 0.75rem;
  }
}
