/* ==========================================================================
   BAGMATI E-LIBRARY - MODERN EXECUTIVE DESIGN SYSTEM
   ========================================================================== */

:root {
  --primary: #1e3a8a;
  --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%);
  --secondary: #0d9488;
  --accent: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --dark: #0f172a;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -1px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 16px 28px -4px rgba(15, 23, 42, 0.1), 0 8px 14px -4px rgba(15, 23, 42, 0.05);
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  font-family: var(--font-body);
  color: var(--slate-700);
  background-color: #f8fafc;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden !important;
  max-width: 100% !important;
  position: relative;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--dark);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: #2563eb;
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #1d4ed8;
  text-decoration: none;
}

/* ==========================================================================
   TOP INFORMATION BAR
   ========================================================================== */

.header-top-bar {
  background-color: #0f172a;
  color: #94a3b8;
  font-size: 0.84rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-top-bar a.top-bar-link {
  color: #cbd5e1;
  font-weight: 500;
  transition: var(--transition);
}

.header-top-bar a.top-bar-link:hover {
  color: #ffffff;
}

.badge-primary-light {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  font-weight: 600;
  padding: 0.35em 0.85em;
  font-size: 0.78rem;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ==========================================================================
   MAIN NAVIGATION BAR
   ========================================================================== */

.main-navbar {
  background: #ffffff !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid var(--slate-200);
  padding: 0.8rem 0 !important;
  transition: var(--transition);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-img {
  max-height: 48px;
  width: auto;
  border-radius: var(--radius-sm);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.brand-name {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.brand-tagline {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-500);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Nav items */
.navbar-nav .nav-item {
  margin: 0 0.15rem;
}

.navbar-nav .nav-link {
  color: var(--slate-700) !important;
  font-weight: 600;
  font-size: 0.82rem !important;
  padding: 0.42rem 0.72rem !important;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
  white-space: nowrap !important;
}

.navbar-nav .nav-link i.nav-icon {
  font-size: 0.92rem;
  color: var(--slate-500);
  transition: var(--transition);
}

.navbar-nav .nav-link:hover {
  color: var(--primary) !important;
  background-color: var(--slate-100);
}

.navbar-nav .nav-link:hover i.nav-icon {
  color: var(--primary);
  transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
  color: var(--primary) !important;
  background-color: rgba(37, 99, 235, 0.08);
}

.navbar-nav .nav-link.active i.nav-icon {
  color: var(--primary);
}

/* Modern Dropdown */
.modern-dropdown-menu {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 0.75rem;
  min-width: 250px;
  margin-top: 0.6rem;
  animation: dropdownSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-grid {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modern-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--slate-700);
  font-weight: 500;
  font-size: 0.82rem !important;
  transition: var(--transition);
  white-space: nowrap;
}

.dropdown-item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  transition: var(--transition);
}

.modern-dropdown-item:hover {
  background-color: var(--slate-50);
  color: var(--primary);
}

.modern-dropdown-item:hover .dropdown-item-icon {
  background: var(--primary);
  color: #ffffff;
}

/* Navbar Right Group & Actions */
.navbar-right-group {
  display: flex;
  align-items: center;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
}

.navbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* Auth Buttons */
.navbar-actions .btn-login {
  color: var(--slate-700);
  border: 1px solid var(--slate-300);
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.81rem !important;
  padding: 0.36rem 0.85rem !important;
  background: #ffffff;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  gap: 0.35rem;
  line-height: 1.4;
  transition: var(--transition);
}

.navbar-actions .btn-login:hover {
  background: var(--slate-100);
  color: var(--primary);
  border-color: var(--primary);
}

.navbar-actions .btn-register {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.81rem !important;
  padding: 0.36rem 0.95rem !important;
  box-shadow: 0 1px 3px rgba(30, 58, 138, 0.15);
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  gap: 0.35rem;
  line-height: 1.4;
  transition: var(--transition);
}

.navbar-actions .btn-register:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

.btn-user-profile {
  background: var(--slate-100);
  color: var(--slate-800);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.custom-toggler {
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  color: var(--dark);
  font-size: 1.2rem;
}

/* ==========================================================================
   HERO SEARCH SECTION
   ========================================================================== */

/* ==========================================================================
   HERO SEARCH SECTION - CLASSIC LIBRARY IMAGE & OVERLAY
   ========================================================================== */

.hero-search-section {
  background-color: #0f172a;
  background-image: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(30, 58, 138, 0.80) 55%, rgba(15, 23, 42, 0.90) 100%), 
                    url('/website/assets/images/hero-library-bg.jpg');
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  padding: 4.25rem 1rem 3.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}

.hero-search-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 30%, rgba(37, 99, 235, 0.22) 0%, transparent 75%);
  pointer-events: none;
}

.hero-search-container {
  max-width: 880px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.14);
  color: #bfdbfe;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 1rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
}

.hero-search-title {
  font-size: 2.35rem;
  font-weight: 800;
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.6rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hero-search-desc {
  font-size: 1.05rem;
  color: #e2e8f0 !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  margin-bottom: 2rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* Modern Search Form with High-End Contrast */
.hero-search-form {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
  padding: 0.4rem 0.45rem;
  transition: var(--transition);
}

.hero-search-form:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 20px 48px -4px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(59, 130, 246, 0.4);
}

.search-type-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding-left: 1rem;
  border-right: 1.5px solid var(--slate-200);
  min-width: 140px;
}

.select-icon {
  color: var(--primary);
  font-size: 0.85rem;
  margin-right: 0.4rem;
}

.hero-category-select {
  border: none !important;
  background-color: transparent !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: var(--primary) !important;
  cursor: pointer;
  padding-right: 1.5rem !important;
  box-shadow: none !important;
}

.search-input-field-wrap {
  flex-grow: 1;
  display: flex;
  align-items: center;
  padding: 0 0.8rem;
}

.input-search-icon {
  color: var(--slate-400);
  font-size: 1rem;
  margin-right: 0.6rem;
}

.hero-search-input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 0.98rem !important;
  padding: 0.5rem 0 !important;
  color: var(--slate-900) !important;
  font-weight: 500;
}

.hero-search-input::placeholder {
  color: var(--slate-400);
}

.btn-hero-search {
  background: var(--primary) !important;
  color: #ffffff !important;
  border: 1px solid var(--primary) !important;
  border-radius: 6px !important;
  padding: 0.7rem 1.65rem !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  box-shadow: 0 3px 10px rgba(30, 58, 138, 0.35);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-hero-search:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(30, 58, 138, 0.45);
}

/* Quick Filter Badges */
.hero-quick-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.quick-filter-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #cbd5e1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.badge-quick-filter {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  padding: 0.32rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  transition: var(--transition);
  text-decoration: none;
}

.badge-quick-filter:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

/* ==========================================================================
   HOMEPAGE CONTENT SECTIONS
   ========================================================================== */

.index-content, .feature-content, .educational {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

.first-item, .feature-item, .reference-item, .educational-item {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
  transition: var(--transition);
}

.first-item:hover, .feature-item:hover, .educational-item:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.25);
}

/* Categories Sidebar */
.catag {
  border-left: 4px solid var(--primary);
}

.catag h5 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--dark);
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--slate-100);
}

.catag ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.catag ul li {
  margin-bottom: 0.35rem;
}

.catag ul li a {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--slate-700);
  font-weight: 500;
  font-size: 0.92rem;
  transition: var(--transition);
}

.catag ul li a i {
  color: var(--primary);
  width: 22px;
  text-align: center;
  margin-right: 0.5rem;
  transition: var(--transition);
}

.catag ul li a:hover {
  background: var(--slate-100);
  color: var(--primary);
  transform: translateX(4px);
}

/* Section Headings */
h4 span, .feature-content h4 span {
  position: relative;
  display: inline-block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 1.5rem;
}

h4 span::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 45px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary-gradient);
}

/* Resource Item Books */
.reference-item a img, .feature-book img {
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  transition: var(--transition);
  object-fit: contain;
}

.reference-item a:hover img, .feature-book:hover img {
  transform: none !important;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
}

.feature-book {
  margin-bottom: 1.5rem;
}

.book-type {
  position: relative;
  text-align: center;
}

.hover-type {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  z-index: 2;
}

/* Most Viewed Spotlight */
.feature-left {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  text-align: center;
}

.feature-left h5 {
  color: var(--primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.feature-left h6 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 1rem;
}

.feature-left img {
  max-height: 260px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

/* Overall Statistics Counter Section */
.details {
  background: var(--primary-gradient);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  margin: 3.5rem auto;
  box-shadow: var(--shadow-xl);
  color: #ffffff;
}

.details .detail h3 {
  color: #ffffff;
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  letter-spacing: -0.03em;
}

.details .detail p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.details-item {
  position: relative;
}

.details-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   BOOK FILTER & LISTING PAGE
   ========================================================================== */

.sorting {
  background: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
}

.sorting select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-300);
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  color: var(--slate-700);
}

.filters {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
  height: fit-content;
}

.filters h1.filter {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--slate-100);
}

.filters .card {
  border: none;
  margin-bottom: 1rem;
}

.filters .card-header {
  background: var(--slate-50);
  border-radius: var(--radius-sm) !important;
  padding: 0.6rem 0.8rem;
  font-weight: 600;
  border: 1px solid var(--slate-200);
}

.results h1.result {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 1.25rem;
}

.results .count_book {
  color: var(--primary);
  font-weight: 800;
}

/* Book Grid Cards */
.cards.gbk {
  margin-bottom: 1.75rem;
}

.book {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.book:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37, 99, 235, 0.25);
}

.book .left {
  text-align: center;
  margin-bottom: 0.75rem;
}

.book .left img {
  border-radius: var(--radius-sm);
  max-height: 180px;
  object-fit: contain;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.book:hover .left img {
  transform: scale(1.03);
}

.book .left a {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--dark);
  line-height: 1.3;
}

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

.book .right {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  font-size: 0.85rem;
}

.book .right p {
  margin-bottom: 0.4rem;
  color: var(--slate-600);
}

.book .right p i {
  color: var(--primary);
  margin-right: 0.25rem;
}

.book .right h6 {
  font-size: 0.8rem;
  color: var(--slate-400);
  margin-bottom: 0.5rem;
}

.book .right .btn-primary {
  margin-top: auto;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin: 2rem 0;
}

.pagination .page-item .page-link {
  border-radius: var(--radius-sm);
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  transition: var(--transition);
}

.pagination .page-item.active .page-link {
  background: var(--primary-gradient);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.pagination .page-item .page-link:hover {
  background: var(--slate-100);
  color: var(--primary);
}

/* ==========================================================================
   USER AUTH & SIGNIN
   ========================================================================== */

.signin-form {
  padding: 3rem 1rem;
  max-width: 950px;
}

.login-details {
  background: var(--primary-gradient);
  color: #ffffff;
  padding: 2.5rem;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  box-shadow: var(--shadow-lg);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-details h5 {
  color: #ffffff;
  font-size: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.login-details p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.5rem;
}

.login-details p span {
  font-weight: 700;
  color: #ffffff;
}

.login-logo img {
  max-width: 140px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}

.signin {
  background: #ffffff;
  padding: 2.5rem;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--slate-200);
  border-left: none;
}

.login-form h3 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 1.5rem;
}

.login-form .form-group {
  margin-bottom: 1.25rem;
}

.login-form label {
  font-weight: 600;
  color: var(--slate-700);
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.login-form .form-control {
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-300);
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  transition: var(--transition);
}

.login-form .form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.login-form .submit-btn {
  background: var(--primary-gradient) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: var(--radius-full);
  padding: 0.6rem 1.8rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.login-form .submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

/* ==========================================================================
   BOOK DETAIL & AUTHOR PAGES
   ========================================================================== */

.container-breadcrum {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  background: #ffffff;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
}

.container-breadcrum a {
  color: var(--slate-600);
  font-weight: 500;
}

.container-breadcrum a.active, .container-breadcrum a:hover {
  color: var(--primary);
  font-weight: 700;
}

.book-detail {
  padding: 2rem 0;
}

.detail-right {
  background: #ffffff;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-md);
}

.detail-right h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.writer-detail {
  background: var(--slate-50);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--slate-200);
}

.writer-photo img {
  border-radius: var(--radius-full);
  border: 3px solid #3b82f6;
  box-shadow: var(--shadow-sm);
  object-fit: cover;
  width: 70px;
  height: 70px;
}

.writer-desc h5 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.detail-desc {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--slate-100);
  align-items: center;
}

.detail-desc h5 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate-500);
  margin: 0;
}

.detail-desc p {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark);
  margin: 0;
}

/* ==========================================================================
   FOOTER SECTION
   ========================================================================== */

footer {
  background: var(--dark);
  color: var(--slate-400);
  padding-top: 3.5rem;
  margin-top: 4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-item h3 {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 1.2rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-item h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 25px;
  height: 2px;
  background: #3b82f6;
}

.footer-item ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-item ul li {
  margin-bottom: 0.6rem;
}

.footer-item ul li a {
  color: var(--slate-400);
  font-size: 0.92rem;
  line-height: 1.6;
  transition: var(--transition);
}

.footer-item ul li a:hover {
  color: #ffffff;
  padding-left: 4px;
}

.footer-item .fa {
  transition: var(--transition);
}

.footer-item a:hover .fa {
  transform: scale(1.2);
}

.footer-info {
  background: #090e17;
  padding: 1.5rem 2rem;
  margin-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
}

.footer-info p {
  margin: 0;
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */

.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  padding: 0.55rem 1.2rem;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary-gradient) !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.badge {
  padding: 0.4em 0.8em;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   RESPONSIVENESS
   ========================================================================== */

@media (max-width: 991px) {
  .hero-search-form {
    flex-direction: column;
    border-radius: var(--radius-lg);
    padding: 0.75rem;
  }
  .search-type-select-wrap {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--slate-200);
    padding: 0 0 0.5rem;
    margin-bottom: 0.5rem;
  }
  .search-input-field-wrap {
    width: 100%;
    padding: 0.25rem 0;
  }
  .btn-hero-search {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }
  .details-item {
    margin-bottom: 1.5rem;
  }
  .details-item::after {
    display: none !important;
  }
  .login-details {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .signin {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-left: 1px solid var(--slate-200);
    border-top: none;
  }
  .main-navbar {
    padding: 0.45rem 0 !important;
  }
  .main-navbar > .container-xl {
    flex-wrap: wrap !important;
  }
  .main-navbar .navbar-brand {
    order: 1;
    margin-right: 0.5rem !important;
  }
  .main-navbar .navbar-right-group {
    order: 2;
    margin-left: auto;
  }
  .main-navbar .navbar-collapse {
    order: 3;
    flex-basis: 100%;
    background: #ffffff;
    padding: 0.75rem 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--slate-200);
  }
  .navbar-actions {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    width: auto !important;
  }
  .navbar-actions .btn-login {
    font-size: 0.82rem !important;
    padding: 0.35rem 0.75rem !important;
  }
  .navbar-actions .btn-register {
    font-size: 0.82rem !important;
    padding: 0.35rem 0.85rem !important;
  }
}

@media (max-width: 575px) {
  .brand-logo-img {
    max-height: 40px !important;
  }
  .navbar-actions .btn-login,
  .navbar-actions .btn-register {
    font-size: 0.75rem !important;
    padding: 0.28rem 0.55rem !important;
  }
  .navbar-actions .btn-login i,
  .navbar-actions .btn-register i {
    font-size: 0.75rem;
    margin-right: 0.2rem !important;
  }
}

@media (max-width: 767px) {
  .hero-search-title {
    font-size: 1.6rem;
  }
  .navbar-nav {
    padding: 1rem 0;
  }
  .details .detail h3 {
    font-size: 1.8rem;
  }
  .footer-item {
    margin-bottom: 2rem;
  }
}

/* Listview specific layout for search results */
.listview {
  margin-bottom: 1.5rem;
}

.listview .book {
  flex-direction: row !important;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem;
}

.listview .book .left {
  flex-shrink: 0;
  width: 130px;
  text-align: center;
  margin-bottom: 0;
}

.listview .book .left img {
  max-height: 160px;
  width: auto;
}

.listview .book .right {
  flex-grow: 1;
}

@media (max-width: 767px) {
  .listview .book {
    flex-direction: column !important;
    text-align: center;
  }
}

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */
.container-breadcrum {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.5rem 1.1rem;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  color: var(--slate-600);
  box-shadow: var(--shadow-sm);
}
.container-breadcrum a {
  color: var(--slate-600);
  font-weight: 500;
  transition: var(--transition);
}
.container-breadcrum a:hover {
  color: #2563eb;
}
.container-breadcrum .active {
  color: var(--primary);
  font-weight: 700;
}
.container-breadcrum .text-xs {
  font-size: 0.72rem;
}

/* ==========================================================================
   CATEGORY & COLLECTION HERO BANNER
   ========================================================================== */
.category-hero-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.category-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}
.category-hero-icon {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(30, 58, 138, 0.15));
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.category-tag-badge {
  display: inline-block;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.35rem;
}
.category-hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.2;
}
.category-hero-desc {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--slate-600);
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--slate-700);
  font-weight: 500;
}
.category-hero-image-wrap {
  max-width: 220px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.category-hero-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 0.4s ease;
}
.category-hero-image-wrap:hover .category-hero-img {
  transform: none !important;
}

/* Modern Collection Card */
.modern-collection-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.modern-collection-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #93c5fd;
}
.collection-cover-wrap {
  position: relative;
  height: 160px;
  background: var(--slate-100);
  overflow: hidden;
}
.collection-cover-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}
.modern-collection-card:hover .collection-cover-img {
  transform: none !important;
}
.collection-count-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
}
.collection-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.collection-title a {
  color: var(--slate-800);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.35;
  transition: color 0.2s ease;
}
.collection-title a:hover {
  color: #2563eb;
}
.collection-description {
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}
.collection-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.55rem 1rem;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  color: #2563eb;
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition);
}
.collection-view-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.other-category-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.25rem;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-full);
  color: var(--slate-700);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.other-category-pill:hover {
  border-color: #3b82f6;
  color: #2563eb;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   AUTHORS DIRECTORY & PROFILE
   ========================================================================== */
.authors-hero-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.authors-hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--slate-900);
}
.authors-hero-subtitle {
  max-width: 600px;
  margin: 0 auto;
  font-size: 0.95rem;
}
.hero-badge {
  display: inline-block;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}
.alphabet-nav-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  max-width: 800px;
  margin: 0 auto;
}
.alphabet-nav-pill {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid var(--slate-200);
  background: #ffffff;
  color: var(--slate-700);
  transition: var(--transition);
}
.alphabet-nav-pill.has-content {
  background: rgba(37, 99, 235, 0.08);
  border-color: #93c5fd;
  color: #2563eb;
}
.alphabet-nav-pill.has-content:hover {
  background: #2563eb;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.alphabet-nav-pill.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.author-letter-group {
  scroll-margin-top: 90px;
}
.letter-badge-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}
.letter-heading {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--slate-800);
}
.modern-author-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  height: 100%;
}
.modern-author-card:hover {
  border-color: #3b82f6;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.author-avatar-wrap {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--slate-100);
  border: 2px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-500);
  font-size: 1.15rem;
  flex-shrink: 0;
  transition: var(--transition);
}
.modern-author-card:hover .author-avatar-wrap {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border-color: #93c5fd;
}
.author-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--slate-800);
}
.author-view-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
}
.modern-author-card:hover .author-view-link i {
  transform: translateX(3px);
}

.author-profile-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}
.author-profile-avatar-wrap {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #ffffff;
  box-shadow: var(--shadow-lg);
  margin: 0 auto;
}
.author-profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.author-name-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--slate-900);
}
.author-bio-content {
  font-size: 1rem;
  line-height: 1.7;
}

/* ==========================================================================
   SEARCH RESULTS PAGE
   ========================================================================== */
.search-summary-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.search-summary-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--slate-900);
}
.badge-primary-count {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35em 0.8em;
  border-radius: var(--radius-full);
}
.search-param-badge {
  display: inline-block;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  color: var(--slate-700);
  margin-right: 0.5rem;
}
.sort-select {
  width: auto;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border-color: var(--slate-300);
  font-weight: 500;
}
.search-book-item-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  align-items: center;
}
.search-book-item-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #93c5fd;
}
.search-item-thumb {
  position: relative;
  width: 100px;
  height: 135px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  background: var(--slate-100);
}
.search-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.search-book-item-card:hover .search-thumb-img {
  transform: none !important;
}
.resource-pill {
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}
.resource-pill-audio { background: #d97706; }
.resource-pill-video { background: #dc2626; }
.resource-pill-document { background: #2563eb; }
.search-item-info {
  flex-grow: 1;
}
.search-cat-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  margin-right: 0.5rem;
}
.search-views-count {
  font-size: 0.78rem;
  color: var(--slate-400);
}
.search-item-title a {
  color: var(--slate-900);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.35;
  transition: color 0.2s ease;
}
.search-item-title a:hover {
  color: #2563eb;
}
.search-item-author {
  font-size: 0.85rem;
  color: var(--slate-600);
}
.search-item-desc {
  font-size: 0.86rem;
  color: var(--slate-500);
  line-height: 1.45;
  margin-bottom: 0.6rem;
}
.search-item-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.meta-chip-sm {
  font-size: 0.76rem;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  color: var(--slate-600);
}
.btn-action-view {
  white-space: nowrap;
  padding: 0.55rem 1rem;
  font-weight: 600;
  font-size: 0.86rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
}
@media (max-width: 767px) {
  .search-book-item-card {
    flex-direction: column;
    text-align: center;
  }
  .search-item-thumb {
    margin: 0 auto;
  }
  .search-item-action {
    width: 100%;
    margin-top: 1rem;
  }
  .btn-action-view {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   BOOK DETAIL & VIEWER
   ========================================================================== */
.book-overview-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}
.book-cover-frame {
  max-width: 280px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--slate-200);
  background: #ffffff;
}
.book-main-cover-img {
  width: 100%;
  height: 380px;
  object-fit: contain;
  display: block;
}
.resource-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.resource-badge-audio { background: #d97706; }
.resource-badge-video { background: #dc2626; }
.resource-badge-document { background: #2563eb; }

.book-specs-card {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.specs-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--slate-800);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--slate-200);
  padding-bottom: 0.5rem;
}
.specs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.86rem;
}
.specs-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--slate-600);
}
.specs-list li:last-child {
  border-bottom: none;
}
.specs-list li span {
  color: var(--slate-500);
}
.specs-list li strong {
  color: var(--slate-800);
}
.book-main-title {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.25;
}
.author-credit-chip {
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-full);
  padding: 0.35rem 1rem 0.35rem 0.35rem;
  transition: var(--transition);
}
.author-credit-chip:hover {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: var(--shadow-sm);
}
.author-credit-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--slate-200);
}
.author-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.author-credit-name a {
  color: var(--slate-800);
  font-size: 0.88rem;
}
.author-credit-name a:hover {
  color: #2563eb;
}
.book-section-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.book-detail-text {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--slate-700);
}
.keyword-badge {
  display: inline-block;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  margin: 0.2rem;
  transition: var(--transition);
}
.keyword-badge:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: #93c5fd;
  color: #2563eb;
}

/* Book Reader Card */
.book-reader-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
}
.reader-header {
  padding: 1.25rem 1.5rem;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.reader-title {
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
}
.pdf-frame-wrapper {
  position: relative;
  width: 100%;
  height: 800px;
  background: #334155;
}
.pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.video-frame-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}
.video-frame-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.audio-player-wrapper {
  padding: 2.5rem;
  background: var(--slate-50);
  text-align: center;
}
.audio-custom-player {
  width: 100%;
  max-width: 600px;
}

/* ==========================================================================
   MODERN BOOK CARD & COVER PHOTO FILL SYSTEM
   ========================================================================== */
.modern-book-card {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 440px !important;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
}

.modern-book-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: #93c5fd;
}

.book-card-media {
  position: relative !important;
  width: 100% !important;
  height: 240px !important;
  min-height: 240px !important;
  max-height: 240px !important;
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 60%, #e2e8f0 100%) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.book-card-media-sm {
  height: 170px !important;
  min-height: 170px !important;
  max-height: 170px !important;
}

/* Subtle light ambient tint behind the compact cover */
.book-cover-ambient-bg {
  position: absolute !important;
  top: -15px !important;
  left: -15px !important;
  right: -15px !important;
  bottom: -15px !important;
  background-size: cover !important;
  background-position: center center !important;
  filter: blur(20px) saturate(1.2) !important;
  opacity: 0.18 !important;
  transform: scale(1.15) !important;
  z-index: 1 !important;
  pointer-events: none !important;
}

.book-cover-link {
  position: relative !important;
  z-index: 2 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  padding: 12px 8px !important;
  overflow: hidden !important;
}

/* The whole image is fully visible, compact, and neatly proportioned */
.book-cover-img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block !important;
  border-radius: 4px !important;
  box-shadow: 0 4px 14px -1px rgba(15, 23, 42, 0.14), 0 2px 4px rgba(15, 23, 42, 0.08) !important;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.modern-book-card:hover .book-cover-img {
  transform: none !important;
}

.modern-book-card .resource-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(30, 58, 138, 0.9);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.book-card-body {
  padding: 1.15rem !important;
  display: flex !important;
  flex-direction: column !important;
  flex-grow: 1 !important;
  background: #ffffff;
}

.book-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.book-category-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-full);
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-views-badge {
  font-size: 0.75rem;
  color: var(--slate-400);
  font-weight: 600;
  white-space: nowrap;
}

.book-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.45rem;
  height: 2.7em !important;
  min-height: 2.7em !important;
  max-height: 2.7em !important;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.book-card-title a {
  color: var(--slate-900);
  transition: color 0.2s ease;
}

.book-card-title a:hover {
  color: #2563eb;
}

.book-card-desc {
  font-size: 0.83rem;
  color: var(--slate-500);
  line-height: 1.45;
  margin-bottom: 0.85rem;
  height: 2.9em !important;
  min-height: 2.9em !important;
  max-height: 2.9em !important;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.book-card-footer {
  margin-top: auto !important;
  padding-top: 0.75rem;
  border-top: 1px solid var(--slate-100);
}

.btn-read-book {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.85rem;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  color: #2563eb;
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition);
}

.btn-read-book:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* Home page feature items & reference cards - compact whole images with light backdrop */
.feature-book .book-type {
  position: relative !important;
  width: 100% !important;
  height: 220px !important;
  border-radius: var(--radius-sm) !important;
  overflow: hidden !important;
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border: 1px solid var(--slate-200) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: var(--shadow-sm) !important;
}

.feature-book .book-type a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  padding: 10px !important;
}

.feature-book .book-type img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12) !important;
  border-radius: 4px !important;
}

.reference-item a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 120px !important;
  height: 160px !important;
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border: 1px solid var(--slate-200) !important;
  border-radius: var(--radius-sm) !important;
  overflow: hidden !important;
  padding: 8px !important;
  box-shadow: var(--shadow-sm) !important;
}

.reference-item a img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12) !important;
  border-radius: 3px !important;
}

/* Global photo containment for any uploaded book image on all subpaths */
.book-cover-frame img,
.search-item-thumb img,
.collection-cover-wrap img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block !important;
}


/* ==========================================================================
   INTERACTIVE DOCUMENT VIEWER REDESIGN
   ========================================================================== */
.reader-tabs-bar .custom-doc-pills .nav-link {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.45rem 1.15rem;
  transition: var(--transition);
}

.reader-tabs-bar .custom-doc-pills .nav-link:hover {
  background: var(--slate-100);
  color: #2563eb;
}

.reader-tabs-bar .custom-doc-pills .nav-link.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.interactive-reader-box {
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--slate-700);
  display: flex;
  flex-direction: column;
}

.reader-control-bar {
  padding: 0.85rem 1.25rem;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.reader-type-pill {
  background: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.reader-doc-title {
  color: #f8fafc;
  font-size: 0.95rem;
  max-width: 360px;
}

.btn-reader-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: var(--transition);
}

.btn-reader-action:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.reader-viewport-frame {
  width: 100%;
  height: 850px;
  min-height: 800px;
  background: #334155;
  position: relative;
}

.reader-pdf-stage {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.reader-pdf-object,
.reader-pdf-fallback-iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  display: block !important;
}

.reader-video-stage {
  width: 100%;
  height: 100%;
  min-height: 600px;
}

.reader-audio-stage {
  width: 100%;
  height: 100%;
  min-height: 380px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.reader-status-bar {
  padding: 0.6rem 1.25rem;
  background: #1e293b;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: #94a3b8;
}

.status-direct-link {
  color: #60a5fa;
  font-weight: 600;
  transition: var(--transition);
}

.status-direct-link:hover {
  color: #ffffff;
}

/* Fullscreen support styling */
:fullscreen .interactive-reader-box,
:-webkit-full-screen .interactive-reader-box {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

:fullscreen .reader-viewport-frame,
:-webkit-full-screen .reader-viewport-frame {
  height: calc(100vh - 90px) !important;
  min-height: auto !important;
}

@media (max-width: 991px) {
  .reader-viewport-frame {
    height: 650px;
    min-height: 550px;
  }
}

@media (max-width: 767px) {
  .reader-viewport-frame {
    height: 500px;
    min-height: 450px;
  }
  .book-card-media {
    height: 220px !important;
    min-height: 220px !important;
    max-height: 220px !important;
  }
}

/* ==========================================================================
   MODERN CAROUSEL SLIDER ENGINE & CARDS
   ========================================================================== */

/* Universal Carousel Track */
.modern-carousel-track {
  display: flex !important;
  gap: 1.25rem !important;
  overflow-x: auto !important;
  scroll-snap-type: x mandatory !important;
  scroll-behavior: smooth !important;
  padding: 0.5rem 0.25rem 1rem !important;
  margin: 0 -0.25rem;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.modern-carousel-track::-webkit-scrollbar {
  display: none !important;
}

/* Slider Nav Arrow Buttons */
.slider-arrow-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
}

.slider-arrow-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.slider-arrow-btn:active {
  transform: translateY(0);
}

/* Category Box Cards in Carousel */
.carousel-item-box {
  flex: 0 0 240px !important;
  max-width: 240px !important;
  scroll-snap-align: start !important;
}

@media (max-width: 575px) {
  .carousel-item-box {
    flex: 0 0 200px !important;
    max-width: 200px !important;
  }
}

.category-box-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
  text-decoration: none !important;
}

.category-box-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: #93c5fd;
}

.cat-box-media {
  position: relative;
  width: 100%;
  height: 140px;
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--slate-200);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-box-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  transition: transform 0.35s ease;
}

.category-box-card:hover .cat-box-img {
  transform: none !important;
}

.cat-box-placeholder {
  font-size: 2.5rem;
  color: var(--primary);
  opacity: 0.8;
}

.cat-box-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.cat-box-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: center;
}

.cat-box-icon-wrap {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: var(--transition);
}

.category-box-card:hover .cat-box-icon-wrap {
  background: #2563eb;
  color: #ffffff;
}

.cat-box-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.cat-box-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: #2563eb;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.category-box-card:hover .cat-box-link {
  color: #1d4ed8;
}

.category-box-card:hover .cat-box-link i {
  transform: translateX(3px);
}

/* Compact Similar Titles Cards in Carousel */
.carousel-item-similar-book {
  flex: 0 0 175px !important;
  max-width: 175px !important;
  scroll-snap-align: start !important;
}

@media (max-width: 575px) {
  .carousel-item-similar-book {
    flex: 0 0 145px !important;
    max-width: 145px !important;
  }
}

.compact-similar-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
}

.compact-similar-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #93c5fd;
}

.compact-card-media {
  position: relative !important;
  width: 100% !important;
  height: 175px !important;
  min-height: 175px !important;
  max-height: 175px !important;
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 60%, #e2e8f0 100%) !important;
  border-bottom: 1px solid var(--slate-200);
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.compact-cover-link {
  position: relative !important;
  z-index: 2 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  padding: 8px !important;
}

.compact-cover-img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  display: block !important;
  border-radius: 3px !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14) !important;
  transition: transform 0.3s ease !important;
}

.compact-similar-card:hover .compact-cover-img {
  transform: none !important;
}

.compact-type-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: rgba(30, 58, 138, 0.9);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  z-index: 3;
}

.compact-card-body {
  padding: 0.75rem 0.6rem !important;
  display: flex !important;
  flex-direction: column !important;
  flex-grow: 1 !important;
  background: #ffffff;
}

.compact-card-title {
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  margin-bottom: 0.5rem !important;
  height: 2.6em !important;
  min-height: 2.6em !important;
  max-height: 2.6em !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  text-align: center;
}

.compact-card-title a {
  color: var(--slate-900);
  transition: color 0.2s ease;
}

.compact-card-title a:hover {
  color: #2563eb;
}

.compact-card-view-btn {
  margin-top: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.35rem 0.6rem;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  color: #2563eb;
  font-weight: 600;
  font-size: 0.78rem;
  transition: var(--transition);
}

.compact-card-view-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* ==========================================================================
   MINIMAL CLASSIC EXECUTIVE AUTHENTICATION PAGES (LOGIN / REGISTER / RESET)
   ========================================================================== */

.auth-page-body {
  background-color: #f8fafc;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-header {
  background: #ffffff;
  border-bottom: 1px solid var(--slate-200);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.auth-back-btn {
  color: var(--slate-700);
  background: #ffffff;
  border: 1px solid var(--slate-300);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
  text-decoration: none;
}

.auth-back-btn:hover {
  background: var(--slate-100);
  color: var(--primary);
  border-color: var(--primary);
  text-decoration: none;
}

.auth-main-content {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-classic-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 2.25rem 2.25rem;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
  margin-top: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 576px) {
  .auth-classic-card {
    padding: 1.5rem 1.25rem;
  }
}

.auth-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(30, 58, 138, 0.07);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 1px solid rgba(30, 58, 138, 0.15);
}

.auth-heading {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.01em;
}

.auth-subheading {
  color: var(--slate-500);
  font-size: 0.88rem;
  line-height: 1.45;
}

.input-group-auth {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-field-icon {
  position: absolute;
  left: 1rem;
  color: var(--slate-400);
  font-size: 0.95rem;
  pointer-events: none;
  z-index: 4;
}

.auth-input {
  padding-left: 2.65rem !important;
  height: 44px !important;
  border-radius: 6px !important;
  border: 1px solid var(--slate-300) !important;
  font-size: 0.92rem !important;
  color: var(--slate-800) !important;
  background-color: #ffffff !important;
  transition: var(--transition) !important;
}

.auth-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
  outline: none !important;
}

.auth-input::placeholder {
  color: var(--slate-400);
  font-size: 0.88rem;
}

.btn-auth-submit {
  height: 44px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.2);
  transition: var(--transition);
}

.btn-auth-submit:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
  transform: translateY(-1px);
}

.auth-card-footer {
  border-top: 1px solid var(--slate-100);
  padding-top: 1rem;
  margin-top: 1.25rem;
}

.auth-footer {
  background: #ffffff;
  border-top: 1px solid var(--slate-200);
  padding: 1.25rem 0;
}

/* ==========================================================================
   SPLIT-CARD AUTHENTICATION LAYOUT (LEFT FORM & RIGHT BLUISH CARD)
   ========================================================================== */

.auth-split-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.auth-split-form-col {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-split-brand-col {
  background: #f8fafc;
  border-left: 1px solid var(--slate-200);
}

@media (max-width: 767px) {
  .auth-split-brand-col {
    border-left: none;
    border-top: 1px solid var(--slate-200);
  }
}

/* Little Bluish Card on the Right */
.auth-bluish-card {
  background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 60%, #1d4ed8 100%);
  border-radius: 10px;
  box-shadow: 0 8px 24px -4px rgba(30, 58, 138, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
  color: #ffffff;
}

.auth-bluish-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.auth-bluish-card::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -30px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.auth-brand-badge {
  display: inline-block;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
}
.auth-split-brand-col .auth-bluish-card { background:linear-gradient(145deg, #1e3a8a 0%, #2563eb 60%, #1d4ed8 100%) !important; box-shadow:0 8px 24px -4px rgba(30,58,138,.35), inset 0 1px 1px rgba(255,255,255,.25) !important; }
.auth-split-brand-col .auth-split-brand-header { text-align:center !important; }
.auth-split-brand-col .auth-split-title,
.auth-split-brand-col .auth-split-tagline,
.auth-split-brand-col .auth-split-features,
.auth-split-brand-col .auth-split-footer { display:block !important; }
.auth-split-brand-col .auth-brand-badge { margin:0 auto !important; }
.auth-split-brand-col .logo-surface { background:transparent !important; border:0 !important; padding:0 !important; box-shadow:none !important; }
.auth-page-body .auth-header { display:none; }

.auth-split-logo {
  max-height: 48px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

.auth-split-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #ffffff !important;
}

.auth-split-tagline {
  font-size: 0.84rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82) !important;
}

.auth-split-features {
  position: relative;
  z-index: 2;
}

.auth-feature-item {
  position: relative;
  z-index: 2;
}

.auth-feature-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
}

.auth-feature-text .font-weight-bold {
  color: #ffffff !important;
  font-size: 0.84rem;
}

.auth-feature-text .small {
  color: rgba(255, 255, 255, 0.75) !important;
  font-size: 0.76rem;
}

.border-white-10 {
  border-color: rgba(255, 255, 255, 0.12) !important;
}


/* A stable logo surface keeps light artwork visible on every theme. */
.brand-logo-img, .auth-split-logo {
  background: #243553;
  padding: 6px 10px;
  border: 1px solid #64748b;
  border-radius: 8px;
  object-fit: contain;
  filter: none;
}
.main-navbar .brand-logo-img { background:transparent !important; border:0 !important; padding:0 !important; border-radius:0 !important; filter:drop-shadow(0 1px 2px rgba(15,23,42,.16)); }
.main-navbar .logo-surface { max-width:none; padding:0 !important; border:0 !important; border-radius:0 !important; background:transparent !important; box-shadow:none !important; }
.main-navbar .logo-surface img.brand-logo-img { padding:0 !important; background:transparent !important; border:0 !important; }
.auth-split-logo { background:transparent !important; border:0 !important; padding:0 !important; border-radius:0 !important; filter:drop-shadow(0 1px 2px rgba(15,23,42,.2)); }

/* Theme accents use the configured secondary color and its readable text. */
h4 span::after { background: var(--secondary); }
.auth-feature-icon, .auth-icon-badge {
  background: var(--secondary);
  color: var(--secondary-contrast);
}
.btn-primary, .login-form .submit-btn {
  background: var(--primary) !important;
  color: var(--primary-contrast) !important;
}

/* Inner pages keep search available without repeating the landing-page intro. */
.hero-search-section--compact {
  padding: 2.125rem 1rem 1.75rem;
}
.hero-search-section--compact .hero-badge {
  margin-bottom: 0;
}
@media (max-width: 767px) {
  .hero-search-section--compact {
    padding: 1.25rem .75rem;
  }
}

/* Free resources: show the complete cover at every card width. */
.free-resource-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 6px;
  background: #f1f5f9;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .06);
}
.free-resource-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 3px;
}
.free-resource-cover:hover,
.free-resource-cover:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .12);
}

/* Category collection cards: keep the entire image visible, including on hover. */
.category-detail-page .category-collections-section .collection-cover-wrap > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 8px;
}
.category-detail-page .category-collections-section .collection-cover-img {
  object-fit: contain !important;
  object-position: center;
  transform: none !important;
}
.category-detail-page .category-collections-section .collection-card-body .collection-count-badge {
  position: static;
  align-self: flex-start;
}

/* Resource cards show the entire image within a consistent frame. */
.free-resource-cover,
.book-cover-link,
.compact-cover-link,
.feature-book .book-type a,
.category-detail-page .category-collections-section .collection-cover-wrap > a {
  padding: 0 !important;
}
.collection-cover-wrap > a,
.search-item-thumb > a {
  display: block;
  width: 100%;
  height: 100%;
}
.free-resource-cover img,
.book-cover-link .book-cover-img,
.compact-cover-link .compact-cover-img,
.feature-book .book-type img,
.collection-cover-wrap .collection-cover-img,
.category-detail-page .category-collections-section .collection-cover-img,
.search-item-thumb img,
.cat-box-media .cat-box-img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.most-viewed-cover {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 300px;
  overflow: hidden;
  border-radius: 8px;
}
.most-viewed-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Compact catalog heading and sorting toolbar. */
.catalog-sort-bar {
  gap: 10px 16px;
}
.catalog-sort-bar .catalog-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 1rem;
  line-height: 1.4;
}
.catalog-sort-bar .badge-primary-count {
  margin: 0;
  padding: 4px 8px;
  font-size: .72rem;
  line-height: 1.2;
}
.catalog-sort-controls {
  gap: 6px;
}
.catalog-sort-controls .sort-title {
  font-size: .75rem;
}
.catalog-sort-controls .sort-select-pill {
  width: auto;
  max-width: 100%;
  height: 32px;
  padding: 4px 26px 4px 9px;
  font-size: .75rem;
}
@media (max-width: 575px) {
  .catalog-sort-bar .catalog-heading { font-size: .9rem; }
  .catalog-sort-controls { width: 100%; }
}

/* Compact detail page: cover beside readable metadata and immediate access. */
.book-detail-compact .book-overview-card {
  padding: 1.25rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.book-detail-compact .book-cover-container { max-width: 220px; margin: 0 auto; }
.book-detail-compact .book-cover-frame { width: 100%; aspect-ratio: 3 / 4; }
.book-detail-compact .book-main-title { font-size: clamp(1.35rem, 2.2vw, 1.85rem); line-height: 1.3; }
.book-detail-compact .book-action-buttons .btn { padding: .65rem .75rem; font-size: .88rem; }
.book-detail-compact .book-specs-card { padding: .75rem 1rem; }
.book-detail-compact .specs-card-title { font-size: .75rem; margin-bottom: .35rem !important; }
.book-detail-compact .specs-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; font-size: .82rem; }
.book-detail-compact .specs-list li { gap: .75rem; padding: .3rem 0; }
.book-detail-compact .specs-list li strong { text-align: right; overflow-wrap: anywhere; }
.book-detail-compact .specs-list li span { flex-shrink: 0; color: #475569; }
.book-detail-compact .book-publisher-row,
.book-detail-compact .book-keywords-row { font-size: .85rem; margin-bottom: .65rem !important; }
.book-detail-compact .author-credit-avatar { width: 28px; height: 28px; }
.book-detail-compact .book-authors-row { margin-bottom: .5rem !important; }
.book-detail-compact .desc-heading { font-size: 1rem; color: #0f172a; }
.book-detail-compact .book-desc-text { font-size: .9rem; line-height: 1.65; color: #334155 !important; overflow-wrap: anywhere; }
.book-detail-compact .book-desc-text p:last-child { margin-bottom: 0; }
.book-detail-compact .book-desc-text img { max-width: 100%; height: auto; }
.book-detail-compact .book-reader-card { padding: 1rem; border-radius: 12px; box-shadow: var(--shadow-sm); scroll-margin-top: 90px; }
.book-detail-compact .reader-heading { font-size: 1.1rem; }
.book-detail-compact .reader-header-wrap { margin-bottom: .75rem !important; }
.book-detail-compact .reader-control-bar { padding: .65rem .85rem; gap: .5rem; }
@media (max-width: 767px) {
  .book-detail-compact .book-overview-card { padding: 1rem; }
  .book-detail-compact .book-cover-container { max-width: 170px; }
  .book-detail-compact .book-reader-card { padding: .75rem; }
}
@media (max-width: 400px) {
  .book-detail-compact .specs-list { grid-template-columns: 1fr; }
}

/* Smaller title, author credit and metadata on compact resource details. */
.book-detail-compact .book-main-title {
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  margin-bottom: .5rem !important;
}
.book-detail-compact .author-credit-chip {
  padding: .2rem .65rem .2rem .2rem;
  margin-right: .5rem !important;
  margin-bottom: .35rem !important;
}
.book-detail-compact .author-credit-avatar { width: 24px; height: 24px; }
.book-detail-compact .author-credit-name small { font-size: .65rem; line-height: 1.2; }
.book-detail-compact .author-credit-name a { font-size: .78rem; line-height: 1.3; }
.book-detail-compact .book-specs-card { padding: .55rem .75rem; }
.book-detail-compact .specs-card-title {
  font-size: .68rem;
  letter-spacing: .02em;
  padding-bottom: .35rem;
}
.book-detail-compact .specs-list { font-size: .76rem; column-gap: 1rem; }
.book-detail-compact .specs-list li { padding: .2rem 0; }
.book-detail-compact .book-meta-top .badge { font-size: .7rem; padding: .25rem .5rem; }
.book-detail-compact .book-meta-top .text-sm { font-size: .72rem !important; }

/* Equal detail/reader columns on wide screens; full-width reading on mobile. */
.book-detail-compact { max-width: 1480px; }
.book-detail-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.book-detail-split > .book-overview-card,
.book-detail-split > .book-reader-card { min-width: 0; margin-bottom: 0 !important; }
.book-detail-split.book-detail-no-reader > .book-overview-card { grid-column: 1 / -1; width: 100%; }
.book-detail-no-reader .book-info-container { width: 100%; }
.book-detail-split .reader-viewport-frame { height: 72vh; min-height: 500px; }
.book-detail-split .reader-doc-info { min-width: 0; max-width: 100%; }
.book-detail-split .reader-actions-wrap { flex-wrap: wrap; gap: 6px; }
.book-detail-split .reader-status-bar { gap: .5rem; padding: .65rem .8rem; }
@media (min-width: 1200px) {
  .book-detail-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-detail-split .book-overview-card { padding: 1rem; }
  .book-detail-split .book-overview-card > .row > :first-child { flex: 0 0 30%; max-width: 30%; }
  .book-detail-split .book-overview-card > .row > :last-child { flex: 0 0 70%; max-width: 70%; }
  .book-detail-split .book-action-buttons .btn { font-size: .78rem; padding: .55rem .4rem; }
  .book-detail-split .specs-list { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .book-detail-split .reader-viewport-frame { height: 70vh; min-height: 420px; }
}
/* Let the PDF occupy available fullscreen space without losing the controls. */
.book-detail-compact .interactive-reader-box:fullscreen {
  display: flex;
  flex-direction: column;
  width: 100vw !important;
  height: 100vh !important;
  background: #334155;
  border-radius: 0;
}
.book-detail-compact .interactive-reader-box:fullscreen .reader-viewport-frame {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: auto !important;
}
.book-detail-compact .interactive-reader-box:fullscreen .reader-control-bar,
.book-detail-compact .interactive-reader-box:fullscreen .reader-status-bar { flex-shrink: 0; }

/* Catalog cards keep only the cover and linked title. */
.modern-book-card.book-card-title-only { min-height: 0 !important; }
.book-card-title-only .book-card-body { padding: .8rem !important; }
.book-card-title-only .book-card-title { margin-bottom: 0; font-size: .92rem; }

/* Match contained resource-image frames to the white card surface. */
.free-resource-cover,
.most-viewed-cover,
.collection-cover-wrap,
.cat-box-media,
.search-item-thumb,
.book-cover-frame,
.book-card-media,
.compact-card-media { background: #ffffff !important; }
.book-cover-ambient-bg { display: none !important; }
/* Prevent image zoom from clipping edges while a card is hovered. */
.modern-book-card:hover .book-cover-img,
.compact-similar-card:hover .compact-cover-img,
.modern-collection-card:hover .collection-cover-img,
.search-book-item-card:hover .search-thumb-img,
.category-box-card:hover .cat-box-img,
.reference-item a:hover img,
.feature-book:hover img,
.category-hero-image-wrap:hover .category-hero-img { transform: none !important; }

/* Reader on the left; details use the full card width below the cover row. */
.book-detail-split .book-overview-body { margin-top: 1rem; }
.book-detail-split .book-overview-body .specs-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.25rem;
}
.book-detail-split .book-info-container { min-width: 0; }
.book-detail-split .book-main-title { overflow-wrap: anywhere; }
.book-detail-split .book-cover-container { max-width: 150px; }
.book-detail-split .book-action-buttons { margin-bottom: 0 !important; }
.book-detail-split .book-cover-frame .resource-badge { font-size: .6rem; padding: .2rem .4rem; top: 5px; left: 5px; }
@media (min-width: 1200px) {
  .book-detail-split > .book-reader-card { grid-column: 1; grid-row: 1; }
  .book-detail-split > .book-overview-card { grid-column: 2; grid-row: 1; }
}
@media (max-width: 767px) {
  .book-detail-split .book-overview-card > .row { flex-wrap: nowrap; }
  .book-detail-split .book-overview-card > .row > :first-child { flex: 0 0 125px; max-width: 125px; margin-bottom: 0 !important; }
  .book-detail-split .book-overview-card > .row > :last-child { flex: 1; min-width: 0; max-width: none; }
  .book-detail-split .book-action-buttons .btn { font-size: .72rem; padding: .5rem .25rem; }
  .book-detail-split .book-overview-body .specs-list { grid-template-columns: 1fr; }
}
@media (max-width: 359px) {
  .book-detail-split .book-overview-card > .row { flex-wrap: wrap; }
  .book-detail-split .book-overview-card > .row > :first-child,
  .book-detail-split .book-overview-card > .row > :last-child { flex: 0 0 100%; max-width: 100%; }
  .book-detail-split .book-info-container { margin-top: 1rem; }
}

/* Image-only catalog cards reveal a readable title badge on interaction. */
.book-card-title-only .book-card-media { border-bottom: 0 !important; }
.book-hover-title {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 7px;
  background: rgba(15,23,42,.94);
  color: #ffffff;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-align: left;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.book-card-title-only:hover .book-hover-title,
.book-card-title-only:focus-within .book-hover-title {
  opacity: 1;
  transform: none;
}
.book-card-title-only .book-cover-link:focus-visible { outline: 3px solid #60a5fa; outline-offset: -3px; }
@media (hover: none), (pointer: coarse) {
  .book-card-title-only .book-hover-title { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .book-hover-title { transition: none; transform: none; }
}

/* Keep a compact title badge visible; reveal long titles on the badge itself. */
.book-card-title-only .book-hover-title {
  left: 7px;
  right: auto;
  bottom: 7px;
  max-width: calc(100% - 14px);
  padding: 4px 7px;
  border-radius: 5px;
  font-size: .7rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.book-card-title-only .book-hover-title:hover,
.book-card-title-only .book-cover-link:focus-visible .book-hover-title {
  white-space: normal;
  overflow: visible;
}

/* The catalog title chip stays on one line and opens a full-title popover. */
.book-card-title-only { position: relative; }
.book-card-title-only .book-card-media { overflow: hidden; }
.book-card-title-only .book-hover-title {
  cursor: help;
  outline: none;
}
.book-card-title-only .book-hover-title::after {
  content: attr(data-full-title);
  position: absolute;
  left: 0;
  bottom: calc(100% + 7px);
  z-index: 20;
  width: max-content;
  max-width: min(280px, calc(100vw - 40px));
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 7px;
  background: #172333;
  color: #fff;
  box-shadow: 0 8px 22px rgba(15,23,42,.28);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease;
}
.book-card-title-only .book-hover-title:hover::after,
.book-card-title-only .book-hover-title:focus-visible::after {
  visibility: visible;
  opacity: 1;
}
.book-card-title-only .book-hover-title:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
@media (hover: none), (pointer: coarse) {
  .book-card-title-only .book-hover-title:active::after { visibility: visible; opacity: 1; }
}

/* Keep image areas across landing page cards on the same white surface. */
.feature-left,
.feature-book .book-type,
.feature-book .book-type a,
.reference-item a,
.collection-cover-wrap,
.cat-box-media,
.search-item-thumb,
.free-resource-cover,
.most-viewed-cover,
.book-card-media,
.book-cover-frame,
.compact-card-media {
  background: #ffffff !important;
}
.feature-left > a { background: #ffffff; }

/* Match the Resource Viewer height to the details panel in the split layout. */
@media (min-width: 1200px) {
  .book-detail-split { align-items: stretch; }
  .book-detail-split > .book-overview-card,
  .book-detail-split > .book-reader-card { height: 100%; }
  .book-detail-split > .book-reader-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .book-detail-split > .book-reader-card > .reader-content-box {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }
  .book-detail-split .reader-content-box > .tab-content,
  .book-detail-split .reader-content-box > .reader-viewport-frame {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }
  .book-detail-split .reader-content-box .tab-pane.active,
  .book-detail-split .reader-content-box .interactive-reader-box {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }
  .book-detail-split .reader-content-box .reader-viewport-frame {
    flex: 1 1 auto;
    min-height: 480px;
    height: auto;
  }
}

/* Tighter Reference Sites cards with a responsive logo grid. */
.reference .reference-item {
  padding: .55rem;
  margin-bottom: .75rem;
}
.reference .reference-item > a {
  width: 100% !important;
  max-width: 124px;
  height: 104px !important;
  padding: 8px !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 7px rgba(15, 23, 42, .07) !important;
}
.reference .reference-item > a img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center;
}
@media (max-width: 575px) {
  .reference .reference-item { padding: .35rem; }
  .reference .reference-item > a { height: 92px !important; }
}

.collection-page-heading {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  margin: 0 0 1.25rem;
  padding: 0 0 .8rem;
  border-bottom: 1px solid var(--slate-200);
}
.collection-page-heading h1 {
  margin: 0;
  color: var(--slate-900);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
}
.collection-page-heading span {
  color: var(--slate-500);
  font-size: .82rem;
}
@media (max-width: 575px) {
  .collection-page-heading { margin-bottom: 1rem; }
  .collection-page-heading h1 { font-size: 1.15rem; }
}

/* Let catalog title tooltips extend beyond the image and overlap adjacent cards. */
.modern-book-card.book-card-title-only {
  position: relative;
  overflow: visible !important;
}
.modern-book-card.book-card-title-only:hover,
.modern-book-card.book-card-title-only:focus-within { z-index: 50; }
.modern-book-card.book-card-title-only .book-card-media,
.modern-book-card.book-card-title-only .book-cover-link {
  overflow: visible !important;
}
.book-card-title-only .book-hover-title::after {
  z-index: 60;
  max-width: min(300px, calc(100vw - 40px));
}

/* Phone-friendly catalog and collection card grid. */
@media (max-width: 575px) {
  .book-card-media,
  .book-card-media-sm { height: 185px !important; min-height: 185px !important; max-height: 185px !important; }
  .modern-book-card.book-card-title-only { min-height: 0 !important; }
  .book-card-title-only .book-hover-title { max-width: calc(100vw / 2 - 32px); font-size: .66rem; }
  .book-card-title-only .book-hover-title::after { max-width: min(260px, calc(100vw - 36px)); }
  .collection-detail-page .collection-books-section > .row,
  .book-wrapper-row { margin-right: -7px; margin-left: -7px; }
  .collection-detail-page .collection-books-section > .row > [class*="col-"],
  .book-wrapper-row > [class*="col-"] { padding-right: 7px; padding-left: 7px; }
}
@media (max-width: 359px) {
  .collection-detail-page .collection-books-section > .row > [class*="col-"],
  .row.book-wrapper-row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  .book-card-media,
  .book-card-media-sm { height: 210px !important; min-height: 210px !important; max-height: 210px !important; }
}

/* Clear, balanced author credits in the compact book details panel. */
.book-detail-compact .book-authors-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .6rem 0 .75rem !important;
}
.book-detail-compact .author-credit-chip {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-width: min(190px, 100%);
  max-width: 100%;
  margin: 0 !important;
  padding: .55rem .75rem;
  background: #f8faf9;
  border: 1px solid #e0e8e3;
  border-radius: 9px;
}
.book-detail-compact .author-credit-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  margin: 0 !important;
  border: 1px solid #dce5e0;
}
.book-detail-compact .author-credit-name { min-width: 0; }
.book-detail-compact .author-credit-name small {
  margin-bottom: 2px;
  color: #64756c !important;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.book-detail-compact .author-credit-name a {
  display: block;
  color: #234c3b;
  font-size: .84rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.book-detail-compact .author-credit-chip:hover {
  background: #fff;
  border-color: #b9d1c4;
  box-shadow: 0 2px 8px rgba(25,70,49,.08);
}
@media (max-width: 575px) {
  .book-detail-compact .author-credit-chip { min-width: 0; padding: .45rem .6rem; }
  .book-detail-compact .author-credit-avatar { width: 34px; height: 34px; flex-basis: 34px; }
}

/* Match the document canvas to the white pages so no dark gutter shows. */
.reader-document-viewport,
.reader-document-viewport .reader-pdf-stage,
.reader-document-viewport .reader-pdf-object,
.reader-document-viewport .reader-pdf-fallback-iframe {
  background: #ffffff !important;
}
.reader-document-viewport .reader-pdf-stage { inset: 0; }
@media (min-width: 1200px) {
  .book-detail-split .reader-document-viewport { min-height: 480px; }
}

/* Fill the stretched reading area without percentage-height shrinkage. */
.book-detail-page .reader-document-viewport { position: relative; }
.book-detail-page .reader-pdf-stage {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
}
.book-detail-page .reader-pdf-stage iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
  display: block;
}
.book-detail-page .reader-control-bar,
.book-detail-page .reader-status-bar { flex-shrink: 0; }

/* Member dashboard */
.member-dashboard { color: #17251f; }
.member-dashboard-hero { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:1.5rem 1.75rem; margin-bottom:1.25rem; border:1px solid #dce9e2; border-radius:16px; background:linear-gradient(120deg,#f3faf6,#fff); }
.member-eyebrow { display:block; color:#27805d; font-size:.7rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; }
.member-dashboard-hero h1 { margin:.35rem 0 .25rem; color:#173c2c; font-size:1.7rem; font-weight:700; }
.member-dashboard-hero p { margin:0; color:#688074; }
.member-home-link { padding:.55rem .85rem; color:#246b4f; border:1px solid #c9dfd3; border-radius:8px; font-size:.82rem; font-weight:600; white-space:nowrap; }
.member-profile-card,.member-workspace-card,.member-membership-card,.member-stat-card { border:1px solid #dce9e2; border-radius:14px; background:#fff; box-shadow:0 5px 20px rgba(29,74,51,.06); }
.member-profile-card { padding:1.5rem; text-align:center; }
.member-avatar-wrap { position:relative; display:inline-block; margin-bottom:.6rem; }
.member-avatar { width:88px; height:88px; object-fit:cover; border:4px solid #e5f3eb; border-radius:50%; background:#eff6f1; }
.member-online-dot { position:absolute; right:3px; bottom:7px; width:15px; height:15px; border:3px solid #fff; border-radius:50%; background:#31a56f; }
.member-profile-card h2 { margin:.25rem 0 .15rem; color:#193b2c; font-size:1.15rem; }
.member-email { margin:0; color:#71827a; font-size:.82rem; overflow-wrap:anywhere; }
.member-role { display:inline-block; margin-top:.65rem; padding:.28rem .6rem; color:#277653; border-radius:20px; background:#e9f7ef; font-size:.7rem; font-weight:700; }
.member-profile-status { display:flex; gap:.65rem; align-items:flex-start; margin:1.25rem 0; padding:.75rem; text-align:left; border-radius:9px; }
.member-profile-status.is-success { color:#23724e; background:#edf9f1; }.member-profile-status.is-pending { color:#9a6b16; background:#fff8e8; }
.member-profile-status i { margin-top:.15rem; }.member-profile-status strong,.member-profile-status small { display:block; }.member-profile-status strong { font-size:.8rem; }.member-profile-status small { margin-top:.18rem; font-size:.7rem; opacity:.85; }
.member-progress-label { display:flex; justify-content:space-between; color:#71827a; font-size:.72rem; }.member-progress-label strong { color:#277653; }.member-progress { height:6px; margin-top:.4rem; overflow:hidden; border-radius:5px; background:#eaf1ed; }.member-progress span { display:block; height:100%; border-radius:5px; background:#3da878; }
.member-stat-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:.8rem; margin-bottom:1rem; }.member-stat-card { display:flex; align-items:center; gap:.65rem; padding:.9rem; }.member-stat-card small,.member-stat-card strong { display:block; }.member-stat-card small { color:#7a8d83; font-size:.68rem; }.member-stat-card strong { margin-top:.2rem; color:#234938; font-size:.85rem; }.member-stat-icon { display:grid; width:34px; height:34px; place-items:center; border-radius:9px; }.member-stat-icon.blue { color:#286ca0; background:#eaf4fc; }.member-stat-icon.teal { color:#257e78; background:#e8f8f5; }.member-stat-icon.green { color:#278050; background:#e9f8ee; }.member-stat-icon.amber { color:#9b711f; background:#fff6dc; }
.member-membership-card { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-bottom:1rem; padding:1.1rem 1.25rem; }.member-membership-card h2 { margin:.25rem 0 .2rem; color:#234938; font-size:1rem; }.member-membership-card p { margin:0; color:#71827a; font-size:.78rem; }.member-status-pill { flex-shrink:0; padding:.4rem .65rem; border-radius:20px; font-size:.72rem; font-weight:700; }.member-status-pill.active { color:#23724e; background:#e9f8ee; }.member-status-pill.pending { color:#946917; background:#fff5d9; }
.member-workspace-card { overflow:hidden; }.member-tabs-head { padding:1.1rem 1.25rem .75rem; }.member-tabs-head h2 { margin:.25rem 0 0; color:#234938; font-size:1.05rem; }.member-tabs-nav { display:flex; gap:.2rem; padding:0 1.25rem; overflow-x:auto; border-bottom:1px solid #e4eee8; }.member-tabs-nav .nav-link { display:flex; align-items:center; gap:.4rem; padding:.65rem .7rem; color:#6e8077; border-bottom:2px solid transparent; font-size:.76rem; font-weight:600; white-space:nowrap; }.member-tabs-nav .nav-link:hover,.member-tabs-nav .nav-link.active { color:#21734e; border-bottom-color:#36a373; }.member-tabs-nav .nav-link span { display:inline-flex; min-width:18px; height:18px; align-items:center; justify-content:center; padding:0 4px; border-radius:10px; color:#21734e; background:#e8f6ed; font-size:.64rem; }.member-tab-content { padding:1.25rem; }.member-tab-content .form-group { margin-bottom:1rem; }.member-tab-content .form-control { border-color:#d9e7df; border-radius:7px; font-size:.84rem; }.member-tab-content .btn-primary { border:0; border-radius:7px; background:#27845b; }
@media (max-width: 767px) { .member-dashboard-hero { align-items:flex-start; flex-direction:column; padding:1.15rem; }.member-dashboard-hero h1 { font-size:1.4rem; }.member-stat-grid { grid-template-columns:1fr; }.member-membership-card { align-items:flex-start; flex-direction:column; }.member-status-pill { align-self:flex-start; }.member-tab-content { padding:.9rem; } }

.reference-carousel-shell { position:relative; display:flex; align-items:center; gap:.6rem; }
.reference-carousel-viewport { display:flex; gap:.85rem; width:100%; overflow-x:auto; scroll-behavior:smooth; scrollbar-width:none; }
.reference-carousel-viewport::-webkit-scrollbar { display:none; }
.reference-carousel-shell .reference-item { flex:0 0 calc(20% - .7rem); min-width:145px; padding:.35rem; }
.reference-carousel-shell .reference-item > a { display:flex; height:100px; flex-direction:column; align-items:center; justify-content:center; gap:.4rem; padding:.55rem; border:1px solid #e1ebe5; border-radius:10px; background:#fff; transition:transform .2s, box-shadow .2s; }
.reference-carousel-shell .reference-item > a:hover { transform:translateY(-2px); box-shadow:0 6px 16px rgba(29,74,51,.1); text-decoration:none; }
.reference-carousel-shell .reference-item img { width:100%; height:55px; object-fit:contain; }
.reference-carousel-shell .reference-item span { max-width:100%; overflow:hidden; color:#38594b; font-size:.8rem; font-weight:600; text-align:center; text-overflow:ellipsis; white-space:nowrap; }
.reference-carousel-shell .reference-item a:hover span { overflow:visible; color:#1f7650; text-decoration:underline; white-space:normal; }
.reference-carousel-control { flex:0 0 30px; width:30px; height:30px; padding:0; border:1px solid #cfe0d5; border-radius:50%; color:#277653; background:#fff; }
.reference-carousel-control:hover { color:#fff; background:#27845b; }
.reference-empty { width:100%; padding:1rem; text-align:center; color:#71827a; }
.premium-book-badge { position:absolute; top:8px; left:8px; z-index:3; display:inline-flex; align-items:center; gap:.25rem; padding:.25rem .45rem; border:1px solid rgba(255,255,255,.45); border-radius:5px; color:#fff; background:linear-gradient(135deg,#b7791f,#d69e2e); box-shadow:0 2px 7px rgba(90,60,10,.25); font-size:.62rem; font-weight:700; line-height:1; letter-spacing:.02em; }
.search-item-thumb .premium-book-badge { top:8px; left:8px; }
.search-input-field-wrap { position:relative; }
.search-suggestions { display:none; position:absolute; top:calc(100% + 6px); right:0; left:0; z-index:1050; overflow:hidden; border:1px solid #d7e3dc; border-radius:10px; background:#fff; box-shadow:0 10px 28px rgba(15,23,42,.18); text-align:left; }
.search-suggestions.is-visible { display:block; }
.hero-search-section { overflow:visible; z-index:30; }
.hero-search-section::before { overflow:hidden; }
.search-suggestions { max-height:min(60vh, 420px); overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; }
.search-suggestion-item { display:flex; align-items:center; gap:.65rem; padding:.55rem .7rem; color:#234938; border-bottom:1px solid #edf2ef; text-decoration:none !important; }
.search-suggestion-item:last-child { border-bottom:0; }.search-suggestion-item:hover { background:#f1f8f4; }.search-suggestion-item img { width:32px; height:40px; flex:0 0 32px; border-radius:3px; object-fit:cover; }.search-suggestion-item span { min-width:0; flex:1; }.search-suggestion-item strong,.search-suggestion-item small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.search-suggestion-item strong { font-size:.78rem; }.search-suggestion-item small { margin-top:2px; color:#71827a; font-size:.65rem; }.search-suggestion-item > i { color:#7ba18e; font-size:.7rem; }.search-suggestion-loading,.search-suggestion-empty { padding:.8rem; color:#71827a; font-size:.75rem; text-align:center; }
.reference-carousel-shell .reference-item > a { border:0; background:transparent; box-shadow:none; }
.reference-carousel-shell .reference-item > a:hover { background:transparent; box-shadow:none; transform:none; }
.reference-carousel-shell .reference-item { padding:.35rem !important; background:transparent !important; }
.reference-carousel-shell .reference-item > a { max-width:none !important; height:auto !important; min-height:88px; padding:0 !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; background:transparent !important; }
.reference-carousel-shell .reference-item > a img { width:100% !important; height:58px !important; max-height:58px !important; object-fit:contain !important; }
.most-viewed-carousel { display:flex; gap:.6rem; height:100%; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; }
.most-viewed-carousel::-webkit-scrollbar { display:none; }
.most-viewed-carousel .most-viewed-cover { flex:0 0 100%; height:245px; position:relative; scroll-snap-align:start; }
.most-viewed-carousel .most-viewed-cover span { position:absolute; right:.35rem; bottom:.35rem; left:.35rem; padding:.35rem .45rem; overflow:hidden; color:#fff; background:rgba(15,23,42,.72); border-radius:5px; font-size:.68rem; text-overflow:ellipsis; white-space:nowrap; }
.feature-content > .row { align-items:stretch; }
.feature-content .feature-left { height:100%; }
.most-viewed-carousel { flex-wrap:wrap; align-content:flex-start; overflow:hidden; }
.most-viewed-carousel .most-viewed-cover { flex:0 0 calc(50% - .3rem); height:170px; }
.most-viewed-carousel .most-viewed-cover img { object-fit:contain; }
@media (max-width:767px) { .reference-carousel-shell .reference-item { flex-basis:42%; min-width:125px; } }
@media (max-width:575px) {
  .most-viewed-carousel { display:grid; grid-template-columns:1fr; gap:.7rem; padding:.25rem; }
  .most-viewed-carousel .most-viewed-cover,
  .free-resources-section .free-resource-cover { width:100%; height:220px; aspect-ratio:3 / 4; margin:0; }
  .feature-left { margin-top:.75rem; margin-bottom:.75rem; padding:.75rem; }
}
@media (max-width:575px) {
  .book-wrapper-row > [class*="col-"] { flex:0 0 100%; max-width:100%; }
  .book-wrapper-row .modern-book-card { min-height:0 !important; }
  .book-wrapper-row .book-card-media { height:220px !important; min-height:220px !important; max-height:220px !important; }
  .book-wrapper-row > [class*="col-"] { margin-bottom:.65rem !important; }
  .free-resources-section > .row > [class*="col-"] { flex:0 0 100%; max-width:100%; }
  .feature-right .feature-book { flex:0 0 100%; max-width:100%; }
}
.mobile-app-nav { display:none; }
@media (max-width:991px) {
  .main-navbar .navbar-toggler { display:none; }
  .main-navbar .navbar-collapse { display:none !important; }
  .mobile-app-nav { display:flex; position:fixed; right:0; bottom:0; left:0; z-index:1030; justify-content:space-around; padding:.35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); border-top:1px solid rgba(148,163,184,.3); background:rgba(255,255,255,.97); box-shadow:0 -4px 18px rgba(15,23,42,.1); }
  .mobile-app-nav-item { display:flex; min-width:56px; flex:1; flex-direction:column; align-items:center; gap:.15rem; padding:.3rem .1rem; color:#64748b; font-size:.6rem; font-weight:600; line-height:1.1; text-decoration:none !important; }
  .mobile-app-nav-item i { font-size:1rem; }
.mobile-app-nav-item.active,.mobile-app-nav-item:hover { color:var(--primary); }
  .mobile-app-nav-item-wrap { display:flex; flex:1; min-width:56px; }
  .mobile-app-nav-item-wrap.show .mobile-category-menu { display:block !important; }
  .mobile-category-menu { position:fixed !important; right:.5rem; bottom:3.6rem; left:.5rem; z-index:1100 !important; max-height:60vh; overflow-y:auto; margin:0; border:1px solid #dbe5df; border-radius:10px; box-shadow:0 8px 25px rgba(15,23,42,.16); }
  .mobile-app-nav .dropdown-item { padding:.65rem .85rem; font-size:.78rem; }
  body { padding-bottom:3.8rem; }
  .hero-search-section--compact:not(.hero-search-section--mobile-search) { display:none; }
  .main-navbar .user-name-label { display:inline !important; max-width:92px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .member-welcome-name { display:inline; }
}
.mobile-category-page-heading { margin-bottom:1.25rem; padding:1.25rem; border-radius:14px; background:linear-gradient(120deg,#f1f8f4,#fff); }.mobile-category-page-heading h1 { margin:.35rem 0 .25rem; color:#234938; font-size:1.5rem; }.mobile-category-page-heading p { margin:0; color:#71827a; font-size:.82rem; }.mobile-category-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; }.mobile-category-card { display:flex; align-items:center; gap:.65rem; min-height:72px; padding:.75rem; border:1px solid #dce9e2; border-radius:11px; color:#234938; background:#fff; box-shadow:0 4px 12px rgba(29,74,51,.05); text-decoration:none !important; }.mobile-category-card:hover { border-color:#8fc4a6; background:#f5fbf7; }.mobile-category-icon { display:grid; width:36px; height:36px; flex:0 0 36px; place-items:center; border-radius:9px; color:#27845b; background:#e9f7ef; }.mobile-category-card span:nth-child(2) { min-width:0; flex:1; }.mobile-category-card strong,.mobile-category-card small { display:block; }.mobile-category-card strong { overflow:hidden; font-size:.82rem; text-overflow:ellipsis; white-space:nowrap; }.mobile-category-card small { margin-top:.15rem; color:#7b8d84; font-size:.65rem; }.mobile-category-card > .fa-chevron-right { color:#8aaa98; font-size:.7rem; }
@media (max-width:575px) { .mobile-category-list { grid-template-columns:1fr; } }
.member-documents-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:1rem; padding-bottom:.85rem; border-bottom:1px solid #e4eee8; }.member-documents-heading h3 { margin:.2rem 0; color:#234938; font-size:1rem; }.member-documents-heading p { margin:0; color:#71827a; font-size:.75rem; }.member-renew-button { flex-shrink:0; border:0; border-radius:7px; background:#27845b; font-size:.78rem; }.member-renew-modal { border:0; border-radius:14px; overflow:hidden; }.member-renew-modal .modal-header { align-items:flex-start; border-bottom:1px solid #e4eee8; }.member-renew-modal .modal-title { margin-top:.25rem; color:#234938; font-size:1.05rem; }.member-renew-help { color:#71827a; font-size:.78rem; }.member-voucher-preview { display:block; width:100%; max-width:180px; max-height:130px; margin:.75rem auto 0; object-fit:contain; border-radius:8px; }
@media (max-width:575px) { .member-documents-heading { align-items:flex-start; flex-direction:column; }.member-renew-button { width:100%; } }
.mobile-filter-toggle { display:none; }
@media (min-width:992px) { .filters-sidebar .filter-card.collapse { display:block !important; height:auto !important; } }
@media (max-width:991px) { .mobile-filter-toggle { display:flex; width:100%; align-items:center; margin-bottom:.7rem; padding:.7rem .85rem; border:1px solid #d8e6dd; border-radius:9px; color:#234938; background:#fff; font-size:.82rem; font-weight:700; text-align:left; }.mobile-filter-toggle .fa-chevron-down { margin-left:auto; transition:transform .2s; }.mobile-filter-toggle[aria-expanded="true"] .fa-chevron-down { transform:rotate(180deg); }.filters-sidebar .filter-card { margin-bottom:1rem; } }
