/* =========================================================
   LibraConnect – Global Styles & Theme Variables
   ========================================================= */

/* ---------- CSS Variables (Theme) ---------- */

:root {
  /* New main palette (warm library theme) */
  --color-bg: #F6F2EB;          /* main background */
  --color-primary: #5B4A3E;     /* dark accent */
  --color-secondary: #EFE7DA;   /* soft secondary */

  /* Derived neutrals */
  --color-text: #5B4A3E;        /* main text */
  --color-text-muted: #8C7C6E;  /* muted text */
  --color-border: #E0D6C8;      /* light border */
  --color-surface: #FFFFFF;     /* white surfaces */

  /* States */
  --color-primary-soft: rgba(91, 74, 62, 0.08);
  --color-focus: rgba(91, 74, 62, 0.35);

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-xxl: 2rem;

  /* Spacing & layout */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --content-width: 1120px;

  /* Radius & shadows */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);

  /* Transitions */
  --transition-fast: 150ms ease-out;
  --transition-med: 220ms ease-out;
}

/* ---------- Reset / Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

/* Remove default padding / margin on common elements */
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

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

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

a:hover {
  text-decoration: none;
}

/* ---------- Layout helpers ---------- */

main {
  padding-block: var(--space-xl);
}

.section {
  padding-block: var(--space-xl);
}

.section + .section {
  border-top: 1px solid var(--color-border);
}

.section-header {
  margin-bottom: var(--space-lg);
  position: relative;   /* ensure header is above slider */
  z-index: 2;
}

.section-title {
  font-size: var(--fs-xxl);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-text);    /* fixed typo */
}

.section-subtitle {
  margin-top: var(--space-xs);
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
}

/* You are already using Bootstrap's .container,
   this just soft-tunes it without breaking Bootstrap. */

.container {
  max-width: var(--content-width);
}

/* ---------- Header & Navigation ---------- */
/* Uses existing HTML: header.header-bar, .nav-links, .right-nav, .head-title, .search, .user */

.header-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(246, 242, 235, 0.98); /* var(--color-bg) with slight transparency */
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.header-bar .container {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding-block: 0.7rem;
}

/* Site title */
.web-title .head-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
}

/* Right side icons (search / user) */
.right-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.right-nav svg {
  width: 26px;
  height: 26px;
  cursor: pointer;
  fill: none;
  stroke: var(--color-text-muted);
  transition: transform var(--transition-fast), stroke var(--transition-fast),
    opacity var(--transition-fast);
  opacity: 0.9;
}

.right-nav svg:hover {
  transform: translateY(-1px) scale(1.03);
  stroke: var(--color-primary);
  opacity: 1;
}

/* Main nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  font-size: var(--fs-sm);
}

.nav-link {
  position: relative;
  text-transform: capitalize;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  padding-block: 0.25rem;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 0%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-secondary)
  );
  transition: width var(--transition-med);
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active {
  color: var(--color-text);
}

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

/* Search box in menu.html */
#searchBox {
  margin-block: var(--space-md);
  border-radius: 999px;
  border: 1px solid var(--color-border);
  padding-inline: 1rem;
  padding-block: 0.55rem;
  font-size: var(--fs-sm);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
}

#searchBox:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus);
}

/* ---------- Footer ---------- */
/* Uses .main-footer from includes/footer.html */

.main-footer {
  margin-top: var(--space-xl);
  padding: var(--space-xl) var(--space-md);
  background: linear-gradient(
    145deg,
    rgba(246, 242, 235, 0.9),
    rgba(239, 231, 218, 0.85)
  );
  color: var(--color-text);
}

.main-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  justify-content: space-between;
  align-items: flex-start;
}

/* Map container keeps Bootstrap classes (rounded-4, shadow-sm, etc.) */
.main-footer .map-container {
  flex: 1 1 50%;
  min-width: 260px;
}

/* Contact / menu column */
.main-footer .footer-menu {
  flex: 1 1 220px;
}

.main-footer .widget-title {
  font-size: var(--fs-md);
  font-weight: 600;
}

.main-footer p {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.main-footer a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  color: var(--color-text);
}

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

/* Horizontal rule & team text */
.main-footer hr {
  width: 100%;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  margin-block: var(--space-md);
}

.main-footer small {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* ---------- Cards / Surfaces (generic) ---------- */

.surface {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  padding: var(--space-md);
}

/* If you use Bootstrap cards, this will lightly theme them */
.card {
  border-radius: var(--radius-md);
  border-color: var(--color-border);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.06);
  background: #F6F2EB;
}

.card-title {
  font-size: var(--fs-md);
  font-weight: 600;
}

.card-text {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

/* ---------- Buttons ---------- */

.btn-primary,
.btn-main {
  /* support existing .btn-primary (Bootstrap) & a custom .btn-main */
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  border-radius: 999px;
  padding-inline: 1.25rem;
  padding-block: 0.55rem;
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background var(--transition-med), transform var(--transition-fast),
    box-shadow var(--transition-fast), color var(--transition-fast);
}

.btn-primary:hover,
.btn-main:hover {
  background: #4A3B31; /* darker variant of primary */
  border-color: #4A3B31;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.btn-outline-main {
  border-radius: 999px;
  border: 1px solid var(--color-primary);
  background: transparent;
  color: var(--color-text);
  padding-inline: 1.1rem;
  padding-block: 0.5rem;
  font-size: var(--fs-sm);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: background var(--transition-med), color var(--transition-med),
    box-shadow var(--transition-fast), transform var(--transition-fast);
}

.btn-outline-main:hover {
  background: var(--color-primary-soft);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* ---------- Forms / Inputs (global) ---------- */

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.98);
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast), background var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus);
  background: #ffffff;
}

/* ---------- Utilities ---------- */

.text-muted-soft {
  color: var(--color-text-muted);
}

.text-center {
  text-align: center;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-sm {
  gap: var(--space-sm);
}
.gap-md {
  gap: var(--space-md);
}
.gap-lg {
  gap: var(--space-lg);
}

.mt-sm {
  margin-top: var(--space-sm);
}
.mt-md {
  margin-top: var(--space-md);
}
.mt-lg {
  margin-top: var(--space-lg);
}

.rounded-pill {
  border-radius: 999px;
}

/* Responsive tweaks */

@media (max-width: 768px) {
  .header-bar .container {
    flex-wrap: wrap;
    row-gap: var(--space-sm);
  }

  .nav-links {
    width: 100%;
    justify-content: center;
  }

  .right-nav {
    order: -1;
  }

  .main-footer {
    flex-direction: column;
    text-align: center;
  }
  .footer-bottom {
    width: 100%;
    text-align: center;
    margin-top: var(--space-md);
  }

  .footer-bottom small {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    letter-spacing: 0.03em;
    text-align: center;
  }
}

/* =========================================================
   HOME / INDEX PAGE
   ========================================================= */

.index-page {
  padding-top: 3rem;
}

/* ---------- Hero ---------- */

.hero-section {
  /* single-color background based on page bg */
  background: var(--color-bg);
  padding-block: 4.5rem 6rem;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  justify-content: center;
  text-align: center;
}

.hero-text {
  max-width: 640px;
}

.hero-eyebrow {
  font-size: var(--fs-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.hero-title {
  font-size: clamp(2.3rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-md);
}

.hero-subtitle {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  max-width: 520px;
  margin-inline: auto;
  margin-bottom: var(--space-lg);
}

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

.hero-cta {
  padding-inline: 1.8rem;
  padding-block: 0.7rem;
}

.hero-secondary-btn {
  border: none;
  background: var(--color-secondary);
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.hero-secondary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
  background: #EADFCC;
}

.hero-play-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-bg);
  font-size: 0.8rem;
}

/* ---------- Featured Slider ---------- */

.featured-section {
  margin-top: 2rem;           /* was -4.5rem; now safe so header is visible */
  padding-bottom: 4.5rem;
  position: relative;
}

.featured-swiper {
  padding-block: 2rem 3rem;
  position: relative;
  z-index: 1;
}

.featured-swiper .swiper-wrapper {
  align-items: center;
}

/* Size of each slide (auto so coverflow can work) */
.featured-swiper .swiper-slide {
  width: 220px;
  max-width: 260px;
  transition: transform var(--transition-med), box-shadow var(--transition-med);
}

/* Card inside the slide */
.book-cards {
  background: #F6F2EB;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  padding: 0.75rem 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 100%;
  margin-left: 10px;
  margin-right: 10px;
}
.book-card:hover{
   box-shadow:0 0 0 3px var(--color-focus);;
}

/* Image at top */
.book-cards-cover {
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 220px;
  display: flex;
  align-items: stretch;
}

.book-cards-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-med);
}

.book-cards:hover .book-cards-cover img {
  transform: scale(1.04);
}

.book-title {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.book-author {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* Read-more description */
.card-description {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  max-height: 60px; /* collapsed */
  overflow: hidden;
  transition: max-height var(--transition-med);
}

.card-description.expanded {
  max-height: 400px; /* expanded */
}

/* Read-more button */
.read-toggle {
  border: none;
  background: transparent;
  padding: 0;
  margin-top: 0.2rem;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  cursor: pointer;
}

/* Swiper pagination (dots) */
.featured-swiper .swiper-pagination-bullet {
  background: rgba(91, 74, 62, 0.35);
  opacity: 1;
}

.featured-swiper .swiper-pagination-bullet-active {
  background: var(--color-primary);
}

/* Responsive tweaks */

@media (max-width: 768px) {
  .hero-section {
    padding-block: 3rem 5rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .featured-section {
    margin-top: 1rem;   /* softer pull-up on mobile */
  }
}

/* --- Footer bottom line centering --- */
.footer-bottom {
  width: 100%;
  text-align: center;
  margin-top: var(--space-md);
}

.footer-bottom small {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}
/* =========================================================
   CATALOG PAGE LAYOUT
   ========================================================= */

   /*recomended*/


.catalog-page {
  padding: 2.5rem 0 3rem;
  background-color: #F6F2EB;  ;
}

/* outer white shell */
.catalog-shell {
  background: var(--color-surface);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
  padding: 1.5rem 1.75rem 2rem;
}

/* top search bar + user chip */
.catalog-top {
  border-radius: 12px;
  background: var(--color-bg);
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--color-border);
}

.catalog-search {
  background: #fff;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  padding: 0.7rem 1.1rem;
  font-size: 0.9rem;
}

.catalog-search:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus);
  border-color: var(--color-primary);
}
.card-body{
  background-color:#F6F2EB ;
  border: none;
 
}


.card-img-top{
  height:100% ;
  width: 100%;
  padding: 5px;
  
}

/*======================make all books the same size======================*/
.catalog-bookCover{
 height: 250px;
 

}
.book-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* space out image and text */
  height: 400px; /* fixed height */
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  background-color: #fff;
  padding: 10px;  
}


.book-card img {
  width: 100%;
  /* height: 200px; same for all */
  /* object-fit: cover; */
  border-radius: 8px;
  margin-bottom: 10px;
  object-fit:cover;
}

.book-card .card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(100% - 200px); /* remaining space after image */
  text-align: center;
}

.book-card h5, 
.book-card p {
  margin: 5px 0;
}

/*============================================*/


/* section headings */
.catalog-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.catalog-see-all {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: none;
}

/* Recommended strip (horizontal scroll) */
.recommended-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.75rem 0 0.25rem;
}

.recommended-strip::-webkit-scrollbar {
  height: 6px;
}
.recommended-strip::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 999px;
}

/* common book cards */
.book-card {
  min-width: 130px;
  max-width: 150px;

  cursor: pointer;
}

.book-card-inner {
  border-radius: 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 0.65rem;
  height: 100%;
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out,
    border-color 0.18s ease-out, background 0.18s ease-out;
}

.book-card-inner:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: var(--color-primary);
  background: #fff;
}

.book-cover {
  border-radius: 10px;
  overflow: hidden;
  height: 160px;
  margin-bottom: 0.55rem;
  background: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.book-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.1rem;
}

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

/* category pills */
.genre-btn {
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  cursor: pointer;
  margin: 0 0.25rem 0.5rem 0;
  transition: background 0.15s ease-out, color 0.15s ease-out,
    border-color 0.15s ease-out;
}

.genre-btn:hover {
  border-color: var(--color-border);
  background: var(--color-secondary);
  color: var(--color-text);
}

.genre-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* grid books (under categories) */
.catalog-grid-card .book-card-inner {
  padding: 0.6rem;
}

.catalog-grid-card .book-cover {
  height: 130px;
}

/* right detail panel */
#slidePanel {
  position: fixed;   /* overlay on top of content */
  top: 0;
  right: -100%;      /* start hidden off-screen */
  width: 20%;
  height: 100%;
  background-color: #5B4A3E;
  color: #fff;
  box-shadow: -2px 0 5px rgba(0,0,0,0.2);
  transition: right 0.3s ease;
  z-index: 1000;     /* above everything */
}

#slidePanel.open {
  right: 0;          /* slide in */
}
.inner-slide{
  margin-left: 10px;
}
.panel-blurb{
  width:50px;
  text-wrap: auto;
}
.close-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
}

.panel-img {
  width: 250px;
  border-radius: 14px;
  background: #fff;
  padding: 0.75rem;
  object-fit: contain;
  margin-bottom: 1rem;
  align-items: center;
}
.panel-img-container{
  align-items: center;
  background-color: #2f7a47;
}

#panelTitle {
  font-size: 1.05rem;
  font-weight: 700;
}

#panelAuthor,
#panelGenre {
  font-size: 0.8rem;
  opacity: 0.9;
}

#panelIntro {
  font-size: 0.78rem;
  line-height: 1.5;
  margin-top: 0.6rem;
}

/* dark overlay when panel slides in (optional) */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 999;
}

#overlay.show {
  opacity: 1;
  visibility: visible;
}
/* responsive */
@media (max-width: 992px) {
  .catalog-shell {
    padding: 1.25rem 1.1rem 1.75rem;
  }
  .slide-panel {
    /* margin-top: 1.5rem; */
  }
}
/* =========================================================
   BORROW PAGE - FULL THEME + FIXED BOOK COVERS
   ========================================================= */
.borrow-page {
  padding: 3rem 0;
}

/* outer shell similar to catalog-shell */
.borrow-shell {
  background: var(--color-surface);
  border-radius: 18px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  padding: 1.75rem 1.75rem 2rem;
}
.borrow-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.3rem;
}

.borrow-section-sub {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

/* Horizontal scrolling container */
.borrow-strip {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 1.2rem;
  padding-bottom: 0.5rem;
  margin-top: 1rem;
}

.borrow-strip::-webkit-scrollbar {
  height: 6px;
}
.borrow-strip::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 999px;
}

/* Each book card in the borrow list */
.borrow-card {
  min-width: 170px;
  max-width: 180px;
  cursor: pointer;
}

/* Card styling (same as catalog) */
.borrow-card-inner {
  background: var(--color-bg);
  border-radius: 16px;
  padding: 0.8rem;
  border: 1px solid var(--color-border);
  transition: 0.18s ease-in-out;
}

.borrow-card-inner:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: var(--color-primary);
  background: #fff;
}

/* FIXED book cover size (no distortion) */
.borrow-card .book-cover {
  width: 100%;
  height: 170px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.borrow-card .book-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;  /* <<< FIXES distortion */
  padding: 4px;
}

/* Title / author text */
.borrow-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 0.5rem;
}

.borrow-card-author {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
}

/* Checkbox row */
.borrow-select {
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.borrow-select label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* Borrow button */
#borrow-btn {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
}

#borrow-btn:hover {
  opacity: 0.9;
}

/* Success / warning messages */
#selection-msg {
  border-radius: 12px;
}

/* Horizontal strips */
.borrow-recommended-strip
{
  display: flex;
  flex-wrap: nowrap;
  gap: 1.2rem;
  overflow-x: auto;
  padding: 0.8rem 0 0.5rem;
}

.borrow-recommended-strip::-webkit-scrollbar
{
  height: 7px;
}

.borrow-recommended-strip::-webkit-scrollbar-thumb
 {
  background: var(--color-border);
  border-radius: 999px;
}

/* =========================================================
   HISTORY PAGE – Borrowing History
   ========================================================= */

.history-page {
  padding: 3rem 0;
}

/* outer shell similar to catalog/borrow */
.history-shell {
  background: var(--color-surface);
  border-radius: 18px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  padding: 1.75rem 1.75rem 2rem;
  margin-top: 2rem;
}

.history-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-text);
}

.history-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 0.35rem;
}

/* table wrapper card */
.table-wrapper {
  margin-top: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  overflow: hidden;
}

/* history table */
#history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#history-table thead {
  background: var(--color-secondary);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}

#history-table th,
#history-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

#history-table tbody tr:hover {
  background: var(--color-primary-soft);
}

/* book cell: cover + title */
.book-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.book-cell .book-cover {
  width: 42px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-secondary);
}

.book-cell span {
  font-weight: 500;
  color: var(--color-text);
}

/* status chips (scoped so we don't break Bootstrap badges elsewhere) */
.history-shell .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.18rem 0.8rem;
  font-size: 0.75rem;
  border: 1px solid transparent;
}

/* Returned */
.history-shell .badge.returned {
  background: rgba(52, 168, 83, 0.12);
  color: #2f7a47;
  border-color: rgba(52, 168, 83, 0.4);
}

/* Overdue */
.history-shell .badge.overdue {
  background: rgba(220, 53, 69, 0.12);
  color: #b02a37;
  border-color: rgba(220, 53, 69, 0.4);
}

/* Borrowed */
.history-shell .badge.borrowed {
  background: rgba(255, 193, 7, 0.16);
  color: #8a6a08;
  border-color: rgba(255, 193, 7, 0.5);
}

/* details button */
.details-btn {
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.76rem;
  padding: 0.35rem 0.9rem;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s ease-out,
              border-color 0.15s ease-out,
              color 0.15s ease-out,
              transform 0.1s ease-out;
}

.details-btn:hover {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

/* expanded details row */
.details-row td {
  background: #f2ebe0;
  font-size: 0.85rem;
  color: var(--color-text);
}

/* responsive */
@media (max-width: 768px) {
  #history-table th,
  #history-table td {
    padding: 0.7rem 0.6rem;
  }

  .book-cell span {
    font-size: 0.85rem;
  }

  .history-shell {
    padding: 1.3rem 1.1rem 1.6rem;
  }
}


