/* ============================================
   SMAN 5 Bulungan - Library Management System
   Main Stylesheet - SLiMS Public Template
   Rewritten with modern, stunning design
   ============================================ */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================
   1. CSS Custom Properties
   ============================================ */
:root {
  /* Primary Colors */
  --primary: #1a73e8;
  --primary-dark: #0d47a1;
  --primary-light: #4a9af5;
  --primary-gradient: linear-gradient(135deg, #1a73e8, #0d47a1);
  --primary-gradient-hover: linear-gradient(135deg, #4a9af5, #1a73e8);
  --primary-rgb: 26, 115, 232;

  /* Secondary & Accent */
  --secondary: #5f6368;
  --accent: #fbbc04;
  --accent-dark: #e6a800;
  --accent-light: #fdd835;
  --accent-rgb: 251, 188, 4;

  /* Status Colors */
  --success: #0f9d58;
  --success-light: #e6f4ea;
  --success-rgb: 15, 157, 88;
  --danger: #ea4335;
  --danger-light: #fce8e6;
  --danger-rgb: 234, 67, 53;
  --warning: #f9ab00;
  --warning-light: #fef7e0;
  --warning-rgb: 249, 171, 0;
  --info: #4285f4;
  --info-light: #e8f0fe;
  --info-rgb: 66, 133, 244;

  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e8eaed;
  --bg-overlay: rgba(0, 0, 0, 0.5);
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-dark: rgba(0, 0, 0, 0.25);

  /* Text */
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #9aa0a6;
  --text-white: #ffffff;
  --text-link: #1a73e8;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 24px 56px rgba(0, 0, 0, 0.14), 0 8px 20px rgba(0, 0, 0, 0.07);
  --shadow-primary: 0 8px 24px rgba(26, 115, 232, 0.3);
  --shadow-accent: 0 8px 24px rgba(251, 188, 4, 0.35);
  --shadow-glow: 0 0 20px rgba(26, 115, 232, 0.2);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', 'Consolas', monospace;

  /* Spacing */
  --section-padding: 90px 0;
  --container-padding: 0 20px;

  /* Navbar */
  --navbar-height: 72px;

  /* Z-index layers */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-navbar: 1030;
  --z-modal: 1050;
  --z-tooltip: 1070;
}

/* ============================================
   2. Keyframe Animations
   ============================================ */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 1; }
  80%, 100% { transform: scale(1.8); opacity: 0; }
}

@keyframes gradient-rotate {
  0% { --angle: 0deg; }
  100% { --angle: 360deg; }
}

@keyframes mesh-move {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(5%, -3%) scale(1.05); }
  50% { transform: translate(-3%, 5%) scale(0.95); }
  75% { transform: translate(-5%, -2%) scale(1.02); }
}

@keyframes particle-float-1 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.4; }
  25% { transform: translate(80px, -120px) rotate(90deg); opacity: 0.7; }
  50% { transform: translate(-40px, -200px) rotate(180deg); opacity: 0.3; }
  75% { transform: translate(60px, -80px) rotate(270deg); opacity: 0.6; }
}

@keyframes particle-float-2 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.3; }
  33% { transform: translate(-60px, -150px) rotate(120deg); opacity: 0.6; }
  66% { transform: translate(50px, -100px) rotate(240deg); opacity: 0.2; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes border-dance {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes medal-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.4); }
  50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

@keyframes count-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes wave-motion {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes icon-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ============================================
   3. Base Reset & Typography
   ============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--navbar-height);
}

body {
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.15rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

::selection {
  background-color: var(--primary);
  color: var(--text-white);
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================
   4. Custom Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  border-radius: 10px;
  border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

@supports (scrollbar-color: auto) {
  * {
    scrollbar-color: var(--primary-light) var(--bg-secondary);
    scrollbar-width: thin;
  }
}

/* ============================================
   5. Navbar (.sman5-navbar)
   ============================================ */
.sman5-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-navbar);
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  background: transparent;
  transition: all var(--transition-normal);
}

.sman5-navbar .navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.sman5-navbar .navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-white);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.sman5-navbar .navbar-brand img {
  height: 42px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text .brand-name {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand-text .brand-sub {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.8;
}

.sman5-navbar .navbar-menu {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sman5-navbar .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
}

.sman5-navbar .nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: all var(--transition-normal);
  transform: translateX(-50%);
}

.sman5-navbar .nav-link:hover::after,
.sman5-navbar .nav-link.active::after {
  width: 60%;
}

.sman5-navbar .nav-link:hover,
.sman5-navbar .nav-link.active {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.12);
}

.sman5-navbar .nav-link i {
  font-size: 1rem;
}

.sman5-navbar .navbar-search {
  position: relative;
}

.sman5-navbar .navbar-search input {
  padding: 9px 16px 9px 38px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-white);
  font-size: 0.85rem;
  width: 200px;
  transition: all var(--transition-normal);
  outline: none;
  font-family: var(--font-family);
  backdrop-filter: blur(4px);
}

.sman5-navbar .navbar-search input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.sman5-navbar .navbar-search input:focus {
  width: 280px;
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.sman5-navbar .navbar-search i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
}

.sman5-navbar .navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.sman5-navbar .navbar-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Theme toggle */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1rem;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(15deg);
}

.theme-icon-light,
.theme-icon-dark {
  transition: opacity var(--transition-fast);
}

/* Glassmorphism scrolled state */
.sman5-navbar.scrolled,
.sman5-navbar.navbar-scrolled,
.glass-morphism {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 8px 32px rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.sman5-navbar.scrolled .navbar-brand,
.sman5-navbar.navbar-scrolled .navbar-brand {
  color: var(--text-primary);
}

.sman5-navbar.scrolled .nav-link,
.sman5-navbar.navbar-scrolled .nav-link {
  color: var(--text-secondary);
}

.sman5-navbar.scrolled .nav-link::after,
.sman5-navbar.navbar-scrolled .nav-link::after {
  background: var(--primary);
}

.sman5-navbar.scrolled .nav-link:hover,
.sman5-navbar.scrolled .nav-link.active,
.sman5-navbar.navbar-scrolled .nav-link:hover,
.sman5-navbar.navbar-scrolled .nav-link.active {
  color: var(--primary);
  background: var(--info-light);
}

.sman5-navbar.scrolled .navbar-search input,
.sman5-navbar.navbar-scrolled .navbar-search input {
  border-color: var(--bg-tertiary);
  background: var(--bg-secondary);
  color: var(--text-primary);
  backdrop-filter: none;
}

.sman5-navbar.scrolled .navbar-search input::placeholder,
.sman5-navbar.navbar-scrolled .navbar-search input::placeholder {
  color: var(--text-muted);
}

.sman5-navbar.scrolled .navbar-search input:focus,
.sman5-navbar.navbar-scrolled .navbar-search input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
  background: var(--bg-primary);
}

.sman5-navbar.scrolled .navbar-search i,
.sman5-navbar.navbar-scrolled .navbar-search i {
  color: var(--text-muted);
}

.sman5-navbar.scrolled .navbar-toggle,
.sman5-navbar.navbar-scrolled .navbar-toggle {
  color: var(--text-primary);
}

.sman5-navbar.scrolled .theme-toggle-btn,
.sman5-navbar.navbar-scrolled .theme-toggle-btn {
  border-color: var(--bg-tertiary);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

/* ============================================
   6. Hero Section (.sman5-hero / .hero-section)
   ============================================ */
.sman5-hero,
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  overflow: hidden;
  padding: 120px 20px 80px;
}

/* Gradient mesh background */
.sman5-hero::before,
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 60%, rgba(74, 154, 245, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 25%, rgba(251, 188, 4, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 70% 70% at 50% 80%, rgba(13, 71, 161, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 70% 50%, rgba(66, 133, 244, 0.2) 0%, transparent 45%);
  pointer-events: none;
  animation: mesh-move 20s ease-in-out infinite;
}

/* Bottom fade to content */
.sman5-hero::after,
.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: linear-gradient(to top, var(--bg-primary), transparent);
  pointer-events: none;
  z-index: 1;
}

/* Floating particles via CSS */
.sman5-hero .hero-particles,
.hero-section .hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.sman5-hero .hero-particles::before,
.hero-section .hero-particles::before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-full);
  top: 30%;
  left: 20%;
  animation: particle-float-1 12s ease-in-out infinite;
  box-shadow:
    120px 80px 0 rgba(255, 255, 255, 0.25),
    300px -40px 0 rgba(251, 188, 4, 0.3),
    500px 120px 0 rgba(255, 255, 255, 0.2),
    -100px 200px 0 rgba(255, 255, 255, 0.15),
    200px 300px 0 rgba(74, 154, 245, 0.25),
    700px 50px 0 rgba(255, 255, 255, 0.18),
    400px -100px 0 rgba(251, 188, 4, 0.2);
}

.sman5-hero .hero-particles::after,
.hero-section .hero-particles::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  top: 60%;
  right: 25%;
  animation: particle-float-2 15s ease-in-out infinite;
  box-shadow:
    -80px -60px 0 rgba(255, 255, 255, 0.2),
    -200px 30px 0 rgba(251, 188, 4, 0.2),
    100px -120px 0 rgba(255, 255, 255, 0.3),
    -300px -100px 0 rgba(255, 255, 255, 0.15),
    50px 150px 0 rgba(74, 154, 245, 0.2);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
  animation: fadeInUp 0.8s ease-out;
}

.hero-title {
  font-size: clamp(2rem, 5.5vw, 3.75rem);
  font-weight: 900;
  color: var(--text-white);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.hero-title span {
  background: linear-gradient(135deg, #fbbc04 0%, #fdd835 50%, #f9ab00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 2.5rem;
  line-height: 1.75;
  max-width: 600px;
  margin-inline: auto;
}

/* Hero search with animated gradient border */
.hero-search {
  max-width: 580px;
  margin: 0 auto 3rem;
  position: relative;
  padding: 3px;
  border-radius: calc(var(--radius-xl) + 3px);
  background: linear-gradient(135deg, rgba(255,255,255,0.5), rgba(251,188,4,0.5), rgba(74,154,245,0.5), rgba(255,255,255,0.5));
  background-size: 300% 300%;
  animation: border-dance 4s ease infinite;
}

.hero-search input {
  width: 100%;
  padding: 18px 65px 18px 26px;
  border: none;
  border-radius: var(--radius-xl);
  font-size: 1rem;
  font-family: var(--font-family);
  background: rgba(255, 255, 255, 0.97);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  outline: none;
  transition: all var(--transition-normal);
}

.hero-search input:focus {
  background: var(--text-white);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

.hero-search input::placeholder {
  color: var(--text-muted);
}

.hero-search button {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: var(--text-white);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-spring);
  box-shadow: var(--shadow-primary);
}

.hero-search button:hover {
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.45);
}

.hero-search button:active {
  transform: translateY(-50%) scale(0.96);
}

/* Quick filters */
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 1.5rem;
  animation: fadeInUp 1s ease-out 0.2s both;
}

.quick-filters .filter-tag {
  padding: 6px 18px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  backdrop-filter: blur(4px);
}

.quick-filters .filter-tag:hover {
  background: rgba(255, 255, 255, 0.25);
  color: var(--text-white);
  transform: translateY(-2px);
}

/* Hero stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 2.5rem;
  animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-stat-item {
  text-align: center;
}

.hero-stat-item .stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.2;
}

.hero-stat-item .stat-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

/* Decorative shapes */
.hero-shape {
  position: absolute;
  border-radius: var(--radius-full);
  opacity: 0.06;
  background: var(--text-white);
  animation: float 8s ease-in-out infinite;
}

.hero-shape-1 {
  width: 450px;
  height: 450px;
  top: -120px;
  right: -120px;
  animation-delay: 0s;
}

.hero-shape-2 {
  width: 280px;
  height: 280px;
  bottom: 80px;
  left: -100px;
  animation-delay: -3s;
}

.hero-shape-3 {
  width: 160px;
  height: 160px;
  top: 38%;
  right: 12%;
  animation-delay: -5s;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: fadeIn 1.5s ease-out 1s both;
}

.scroll-indicator::after {
  content: '';
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
  animation: float 2s ease-in-out infinite;
}

/* ============================================
   7. Section Headers & Dividers
   ============================================ */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.section-header p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

.section-header .section-line {
  width: 56px;
  height: 4px;
  background: var(--primary-gradient);
  border-radius: 2px;
  margin: 14px auto 0;
  position: relative;
}

.section-header .section-line::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 0;
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--accent);
}

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--bg-tertiary), transparent);
  border: none;
  margin: 0;
}

/* ============================================
   8. Categories Section (.sman5-categories)
   ============================================ */
.sman5-categories,
.categories-section {
  padding: var(--section-padding);
  background: var(--bg-secondary);
  position: relative;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--container-padding);
}

.category-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px 12px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-spring);
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.06);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: -1;
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.category-card:hover::before {
  opacity: 1;
}

.category-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.35rem;
  color: #fff;
  background: var(--primary-gradient);
  transition: all var(--transition-spring);
  position: relative;
}

.category-icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 20px;
  background: inherit;
  opacity: 0;
  filter: blur(10px);
  z-index: -1;
  transition: opacity var(--transition-normal);
}

.category-card:hover .category-icon {
  transform: scale(1.12) rotate(-5deg);
  animation: icon-bounce 0.6s ease;
}

.category-card:hover .category-icon::after {
  opacity: 0.4;
}


.category-number {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.category-name,
.category-card h5,
.category-card h6 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  transition: color var(--transition-fast);
}

.category-card:hover .category-name,
.category-card:hover h5,
.category-card:hover h6 {
  color: var(--primary);
}

/* ============================================
   9. Book Cards (.book-card / .collection-card)
   ============================================ */
.sman5-popular,
.sman5-latest,
.collection-section {
  padding: var(--section-padding);
  background: var(--bg-primary);
}

.sman5-popular {
  background: var(--bg-secondary);
}

/* Swiper overrides */
.collection-section .swiper,
.sman5-popular .swiper,
.sman5-latest .swiper {
  padding: 20px 10px 55px;
}

.swiper-pagination .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background: var(--primary);
  opacity: 0.25;
  transition: all var(--transition-normal);
}

.swiper-pagination .swiper-pagination-bullet-active {
  opacity: 1;
  width: 30px;
  border-radius: 5px;
  background: var(--primary-gradient);
}

/* Glass effect swiper arrows */
.swiper-button-next,
.swiper-button-prev {
  width: 48px !important;
  height: 48px !important;
  background: var(--bg-glass) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-full) !important;
  box-shadow: var(--shadow-md) !important;
  color: var(--primary) !important;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: all var(--transition-normal) !important;
  opacity: 0;
}

.swiper:hover .swiper-button-next,
.swiper:hover .swiper-button-prev {
  opacity: 1;
}

.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 0.95rem !important;
  font-weight: 800 !important;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  background: var(--primary) !important;
  color: var(--text-white) !important;
  box-shadow: var(--shadow-primary) !important;
  transform: scale(1.08);
}

/* Book card with 3D tilt on hover */
.book-card,
.collection-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  border: 1px solid rgba(0, 0, 0, 0.05);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  position: relative;
  transform-style: preserve-3d;
  perspective: 800px;
  height: 100%;
}

.book-card:hover,
.collection-card:hover {
  transform: translateY(-6px) rotateX(2deg) rotateY(-1deg);
  box-shadow: var(--shadow-xl);
  border-color: rgba(var(--primary-rgb), 0.15);
}

/* Book cover with zoom and gradient overlay */
.book-cover,
.collection-card .card-cover {
  position: relative;
  height: 260px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
}

.book-cover img,
.collection-card .card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
  will-change: transform;
}

.book-card:hover .book-cover img,
.collection-card:hover .card-cover img {
  transform: scale(1.08);
}

/* Gradient overlay on cover */
.book-cover::after,
.collection-card .card-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.05) 40%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity var(--transition-normal);
  pointer-events: none;
}

.book-card:hover .book-cover::after,
.collection-card:hover .card-cover::after {
  opacity: 1;
}

.collection-card .card-cover .availability-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(6px);
  z-index: 1;
}

.collection-card .card-body {
  padding: 18px;
}

.card-title,
.collection-card .card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
  transition: color var(--transition-fast);
}

.book-card:hover .card-title,
.collection-card:hover .card-title {
  color: var(--primary);
}

.collection-card .card-author {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ============================================
   10. Stat Counter / Cards (.stat-counter, .stat-card)
   ============================================ */
.sman5-visitor-stats,
.stats-section {
  padding: var(--section-padding);
  background: var(--primary-gradient);
  position: relative;
  overflow: hidden;
}

.sman5-visitor-stats::before,
.stats-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 10% 50%, rgba(255, 255, 255, 0.1), transparent 45%),
    radial-gradient(circle at 90% 30%, rgba(255, 255, 255, 0.07), transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.05), transparent 40%);
  pointer-events: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--container-padding);
  position: relative;
  z-index: 1;
}

.stat-item,
.stat-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

/* Large translucent background icon */
.stat-item::before,
.stat-card::before {
  content: '';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

/* Animated ring decoration */
.stat-item::after,
.stat-card::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 70px;
  height: 70px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  animation: spin-slow 20s linear infinite;
  pointer-events: none;
}

.stat-item:hover,
.stat-card:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-icon,
.stat-card .stat-icon {
  font-size: 2.2rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 14px;
  display: inline-block;
}

.icon-circle {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  margin-bottom: 14px;
  font-size: 1.4rem;
  color: var(--text-white);
}

.stat-number,
.stat-card .stat-number {
  display: block;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.2;
  margin-bottom: 6px;
  animation: count-up 0.6s ease-out;
}

.stat-label,
.stat-card .stat-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ============================================
   11. Top Readers Podium (.sman5-top-readers)
   ============================================ */
.sman5-top-readers,
.readers-section {
  padding: var(--section-padding);
  background: var(--bg-secondary);
}

.reader-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 28px;
  max-width: 850px;
  margin: 0 auto;
  padding: 0 20px;
  perspective: 1000px;
}

.reader-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-spring);
  flex: 1;
  max-width: 240px;
  position: relative;
  transform-style: preserve-3d;
}

.reader-card:hover {
  transform: translateY(-8px) rotateY(-2deg);
  box-shadow: var(--shadow-xl);
}

.reader-card.rank-1 {
  padding-top: 44px;
  padding-bottom: 44px;
  order: 2;
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.04) 0%, var(--bg-primary) 40%);
  border: 1px solid rgba(255, 215, 0, 0.15);
}

.reader-card.rank-1:hover {
  box-shadow: var(--shadow-xl), 0 0 30px rgba(255, 215, 0, 0.12);
}

.reader-card.rank-2 { order: 1; }
.reader-card.rank-3 { order: 3; }

/* Glowing medal badges */
.medal-badge,
.reader-card .medal {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-white);
  z-index: 2;
}

.medal-badge.gold,
.reader-card .medal.gold {
  background: linear-gradient(135deg, #ffd700, #ffb300, #ffd700);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
  animation: medal-glow 2.5s ease-in-out infinite;
}

.medal-badge.silver,
.reader-card .medal.silver {
  background: linear-gradient(135deg, #e0e0e0, #9e9e9e, #c0c0c0);
  box-shadow: 0 4px 12px rgba(192, 192, 192, 0.35);
}

.medal-badge.bronze,
.reader-card .medal.bronze {
  background: linear-gradient(135deg, #cd7f32, #a0522d, #cd7f32);
  box-shadow: 0 4px 12px rgba(205, 127, 50, 0.35);
}

/* Animated ring borders on avatars */
.reader-avatar,
.reader-card .reader-avatar {
  width: 84px;
  height: 84px;
  border-radius: var(--radius-full);
  object-fit: cover;
  margin: 0 auto 14px;
  border: 3px solid var(--bg-tertiary);
  position: relative;
  transition: all var(--transition-normal);
}

.reader-card.rank-1 .reader-avatar {
  width: 104px;
  height: 104px;
  border-color: #ffd700;
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.15), 0 0 20px rgba(255, 215, 0, 0.1);
}

.reader-card.rank-2 .reader-avatar {
  border-color: #c0c0c0;
}

.reader-card.rank-3 .reader-avatar {
  border-color: #cd7f32;
}

.reader-card:hover .reader-avatar {
  transform: scale(1.06);
}

.reader-card .reader-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.reader-card .reader-class {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.reader-card .reader-count {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.reader-card .reader-count small {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
}

/* ============================================
   12. Library Info (.sman5-library-info)
   ============================================ */
.sman5-library-info,
.library-info {
  padding: var(--section-padding);
  background: var(--bg-primary);
}

.library-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--container-padding);
  align-items: start;
}

.library-info .info-details h3,
.info-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.info-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: all var(--transition-normal);
}

.info-card:hover {
  box-shadow: var(--shadow-md);
}

.library-info .info-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.library-info .info-item i {
  font-size: 1.1rem;
  color: var(--primary);
  margin-top: 3px;
  min-width: 20px;
}

.library-info .info-item p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.library-info .info-item strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.map-wrapper,
.library-info .map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.map-wrapper iframe,
.library-info .map-container iframe {
  width: 100%;
  height: 380px;
  border: none;
  display: block;
}

/* ============================================
   13. Search Results (.sman5-search-results)
   ============================================ */
.sman5-search-results,
.search-results-section {
  padding: calc(var(--navbar-height) + 30px) 0 70px;
  min-height: 70vh;
}

.sman5-content,
.content-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--container-padding);
}

.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 14px;
}

.search-results-header h4 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.search-results-header h4 span {
  color: var(--primary);
}

.search-results-container,
.search-results {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--container-padding);
}

/* Search form inline */
.search-form-inline {
  display: flex;
  gap: 12px;
  max-width: 600px;
  margin-bottom: 2rem;
}

.search-form-inline input {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all var(--transition-normal);
  outline: none;
}

.search-form-inline input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.search-form-inline button {
  padding: 12px 24px;
  background: var(--primary-gradient);
  color: var(--text-white);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.search-form-inline button:hover {
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

/* List View result cards with animated entrance */
.result-card {
  display: flex;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: all var(--transition-normal);
  text-decoration: none;
  animation: fadeInUp 0.4s ease-out both;
}

.result-card:nth-child(1) { animation-delay: 0s; }
.result-card:nth-child(2) { animation-delay: 0.05s; }
.result-card:nth-child(3) { animation-delay: 0.1s; }
.result-card:nth-child(4) { animation-delay: 0.15s; }
.result-card:nth-child(5) { animation-delay: 0.2s; }
.result-card:nth-child(6) { animation-delay: 0.25s; }

.result-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--primary-rgb), 0.15);
  transform: translateX(4px);
}

.result-card .result-cover {
  width: 130px;
  min-height: 170px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  overflow: hidden;
}

.result-card .result-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.result-card:hover .result-cover img {
  transform: scale(1.06);
}

.result-card .result-details {
  flex: 1;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.result-card .result-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.45;
  transition: color var(--transition-fast);
}

.result-card:hover .result-title {
  color: var(--primary);
}

.result-card .result-author {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.result-card .result-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.result-card .result-meta span {
  margin-right: 16px;
}

.result-card .result-badge {
  align-self: center;
  padding: 20px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Grid View with smooth layout transition */
.search-results-container.grid-view,
.search-results.grid-view {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.grid-view .result-card {
  flex-direction: column;
  margin-bottom: 0;
  animation-name: scaleIn;
}

.grid-view .result-card:hover {
  transform: translateY(-6px);
}

.grid-view .result-card .result-cover {
  width: 100%;
  height: 240px;
}

.grid-view .result-card .result-badge {
  padding: 0 18px 18px;
  align-self: flex-start;
}

/* List view */
.list-view .result-card {
  flex-direction: row;
}

/* View Toggle */
.view-toggle {
  display: inline-flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.view-toggle button,
.view-toggle-btn {
  padding: 7px 16px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family);
  font-weight: 500;
}

.view-toggle button.active,
.view-toggle-btn.active {
  background: var(--bg-primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.view-toggle button:hover:not(.active),
.view-toggle-btn:hover:not(.active) {
  color: var(--primary);
}

/* Biblio card */
.biblio-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: all var(--transition-normal);
  text-decoration: none;
  display: block;
}

.biblio-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.biblio-card .biblio-cover {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.biblio-card .biblio-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.biblio-card:hover .biblio-cover img {
  transform: scale(1.06);
}

.biblio-card .biblio-body {
  padding: 16px;
}

.biblio-card .biblio-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.biblio-card:hover .biblio-title {
  color: var(--primary);
}

/* ============================================
   14. Detail Page
   ============================================ */
.detail-page {
  padding: calc(var(--navbar-height) + 30px) 0 70px;
}

/* Detail cover sidebar */
.detail-cover-wrapper {
  position: sticky;
  top: calc(var(--navbar-height) + 24px);
}

.detail-cover-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 0;
  border: 1px solid rgba(0, 0, 0, 0.04);
  background: var(--bg-secondary);
}

.detail-cover-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-slow);
}

.detail-cover-card:hover img {
  transform: scale(1.03);
}

.detail-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  gap: 0.5rem;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Detail content */
.detail-content-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.detail-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.detail-author {
  font-size: 1rem;
  color: var(--text-secondary);
}

.detail-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bg-tertiary);
}

.detail-info-table {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
}

.detail-info-table dl {
  margin-bottom: 0;
}

.detail-info-table dt {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.detail-info-table dd {
  font-size: 0.9rem;
  color: var(--text-primary);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.detail-info-table dt:last-of-type,
.detail-info-table dd:last-of-type {
  border-bottom: none;
}

.detail-notes {
  line-height: 1.7;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.detail-availability table {
  width: 100%;
}

.detail-availability table th,
.detail-availability table td {
  padding: 8px 12px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-light);
}

.detail-comments {
  margin-top: 0.5rem;
}

/* ============================================
   15. Member Area (.sman5-member)
   ============================================ */
.sman5-member,
.member-area {
  padding: calc(var(--navbar-height) + 30px) 0 70px;
  min-height: 80vh;
}

.member-content,
.member-dashboard {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--container-padding);
}

.member-header {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 32px;
  padding: 28px;
  background: var(--primary-gradient);
  border-radius: var(--radius-lg);
  color: var(--text-white);
  position: relative;
  overflow: hidden;
}

.member-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.08), transparent 60%);
  border-radius: var(--radius-full);
  pointer-events: none;
}

.member-header .member-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  border: 3px solid rgba(255, 255, 255, 0.3);
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.member-header h3 {
  color: var(--text-white);
  margin-bottom: 2px;
}

.member-header p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  font-size: 0.9rem;
}

.member-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.member-stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-normal);
}

.member-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.member-stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.member-stat-card .stat-icon.icon-primary {
  background: var(--info-light);
  color: var(--primary);
}

.member-stat-card .stat-icon.icon-success {
  background: var(--success-light);
  color: var(--success);
}

.member-stat-card .stat-icon.icon-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.member-stat-card .stat-info h4 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0;
  color: var(--text-primary);
}

.member-stat-card .stat-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.member-loan-table {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.member-loan-table table {
  width: 100%;
  border-collapse: collapse;
}

.member-loan-table th {
  background: var(--bg-secondary);
  padding: 13px 18px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
}

.member-loan-table td {
  padding: 15px 18px;
  font-size: 0.9rem;
  color: var(--text-primary);
  border-top: 1px solid var(--bg-tertiary);
  transition: background var(--transition-fast);
}

.member-loan-table tr:hover td {
  background: var(--bg-secondary);
}

/* ============================================
   16. Footer (.sman5-footer)
   ============================================ */
.sman5-footer {
  background: #111827;
  color: rgba(255, 255, 255, 0.7);
  padding: 0;
  position: relative;
}

/* Wave SVG border at top (handled by footer-wave SVG) */

.footer-wave {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.footer-wave svg {
  display: block;
  width: 100%;
  height: 80px;
}

.footer-content {
  padding-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 20px 44px;
  position: relative;
  z-index: 2;
}

.footer-col h4 {
  color: var(--text-white);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 22px;
  position: relative;
  padding-bottom: 10px;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

.footer-col p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  line-height: 1.75;
}

.footer-brand,
.footer-col .footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.footer-col .footer-brand img {
  height: 38px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-col .footer-brand span {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-white);
}

.footer-links,
.footer-col ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.footer-links li,
.footer-col ul li {
  margin-bottom: 12px;
}

.footer-links li a,
.footer-col ul li a {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-links li a::before,
.footer-col ul li a::before {
  content: '';
  width: 0;
  height: 1px;
  background: var(--primary-light);
  transition: width var(--transition-normal);
}

.footer-links li a:hover,
.footer-col ul li a:hover {
  color: var(--text-white);
  padding-left: 0;
}

.footer-links li a:hover::before,
.footer-col ul li a:hover::before {
  width: 12px;
}

.footer-col .footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.footer-col .footer-contact-item i {
  color: var(--primary-light);
  margin-top: 3px;
}

/* Animated social icons with brand colors */
.social-icons,
.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.social-btn,
.social-icons a,
.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
  font-size: 1rem;
  transition: all var(--transition-spring);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.social-btn:hover,
.social-icons a:hover,
.footer-social a:hover {
  transform: translateY(-4px) scale(1.05);
  color: var(--text-white);
}

/* Brand color hover states */
.social-btn.facebook:hover,
.social-icons a.facebook:hover { background: #1877f2; box-shadow: 0 6px 16px rgba(24, 119, 242, 0.4); }
.social-btn.twitter:hover,
.social-icons a.twitter:hover { background: #1da1f2; box-shadow: 0 6px 16px rgba(29, 161, 242, 0.4); }
.social-btn.instagram:hover,
.social-icons a.instagram:hover { background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045); box-shadow: 0 6px 16px rgba(131, 58, 180, 0.4); }
.social-btn.youtube:hover,
.social-icons a.youtube:hover { background: #ff0000; box-shadow: 0 6px 16px rgba(255, 0, 0, 0.4); }
.social-btn.whatsapp:hover,
.social-icons a.whatsapp:hover { background: #25d366; box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4); }
.social-btn.tiktok:hover,
.social-icons a.tiktok:hover { background: #000; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); }

/* Fallback hover for unclassed social icons */
.social-icons a:hover,
.footer-social a:hover {
  background: var(--primary);
  box-shadow: var(--shadow-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 22px 20px;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.footer-bottom a {
  color: var(--primary-light);
  transition: color var(--transition-fast);
}

.footer-bottom a:hover {
  color: var(--text-white);
}

/* ============================================
   17. Components - Badges, Buttons, etc.
   ============================================ */

/* Badges */
.badge-available {
  background: var(--success-light);
  color: var(--success);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-unavailable {
  background: var(--danger-light);
  color: var(--danger);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-reference {
  background: var(--warning-light);
  color: var(--warning);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Buttons */
.btn-primary-custom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 26px;
  background: var(--primary-gradient);
  color: var(--text-white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary-custom::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary-gradient-hover);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
  color: var(--text-white);
}

.btn-primary-custom:hover::before {
  opacity: 1;
}

.btn-primary-custom:active {
  transform: translateY(0);
}

.btn-primary-custom span,
.btn-primary-custom i {
  position: relative;
  z-index: 1;
}

.btn-outline-custom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 26px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-outline-custom:hover {
  background: var(--primary);
  color: var(--text-white);
  box-shadow: var(--shadow-primary);
  transform: translateY(-2px);
}

/* Pagination */
.pagination-custom {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
}

.pagination-custom a,
.pagination-custom span {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.pagination-custom a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--info-light);
}

.pagination-custom .active {
  background: var(--primary);
  color: var(--text-white);
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}

/* Breadcrumb */
.breadcrumb-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  font-size: 0.85rem;
}

.breadcrumb-custom a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.breadcrumb-custom a:hover {
  color: var(--primary);
}

.breadcrumb-custom span {
  color: var(--text-muted);
}

.breadcrumb-custom .current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================
   18. Skeleton Loading with Shimmer
   ============================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    rgba(255, 255, 255, 0.6) 40%,
    rgba(255, 255, 255, 0.6) 60%,
    var(--bg-tertiary) 100%
  );
  background-size: 300% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 10px;
  border-radius: 4px;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }

.skeleton-avatar {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
}

.skeleton-cover {
  height: 200px;
  border-radius: var(--radius-md);
}

.skeleton-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ============================================
   19. Back to Top Button (#backToTop)
   ============================================ */
#backToTop,
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: var(--text-white);
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  transition: all var(--transition-spring);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Scroll progress ring */
#backToTop::before,
.scroll-top::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(var(--primary-rgb), 0.15);
  pointer-events: none;
}

#backToTop::after,
.scroll-top::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  transform: rotate(var(--scroll-progress, 0deg));
  transition: transform 0.1s linear;
  pointer-events: none;
}

#backToTop.visible,
.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#backToTop:hover,
.scroll-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.45);
}

#backToTop:active,
.scroll-top:active {
  transform: translateY(-1px);
}

/* ============================================
   20. Modern Form Inputs
   ============================================ */
.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all var(--transition-normal);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

/* Animated floating label */
.form-group label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all var(--transition-normal);
  background: var(--bg-primary);
  padding: 0 4px;
}

.form-group textarea ~ label {
  top: 18px;
  transform: none;
}

.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
  top: -2px;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: transparent;
}

.form-group input:focus::placeholder,
.form-group textarea:focus::placeholder {
  color: var(--text-muted);
}

/* Focus ring effect */
.form-group input:focus-visible,
.form-group textarea:focus-visible,
.form-group select:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.12);
}

/* ============================================
   21. Library Info Social Icons (light bg)
   ============================================ */
.library-info .social-icons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.library-info .social-icons a {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all var(--transition-spring);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.library-info .social-icons a:hover {
  background: var(--primary);
  color: var(--text-white);
  transform: translateY(-4px);
  box-shadow: var(--shadow-primary);
  border-color: transparent;
}

/* ============================================
   22. Utility Classes
   ============================================ */
.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
}

.animate-fadeInUp {
  animation: fadeInUp 0.5s ease-out both;
}

.animate-fadeIn {
  animation: fadeIn 0.4s ease-out both;
}

.animate-scaleIn {
  animation: scaleIn 0.4s ease-out both;
}

/* ============================================
   23. Responsive - Large Desktop (1200px+)
   ============================================ */
/* Handled by default styles above */

/* ============================================
   24. Responsive - Desktop / Small Desktop
   ============================================ */
@media (max-width: 1200px) {
  .hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
  }

  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 30px;
  }

  .detail-cover-wrapper {
    position: static;
  }
}

/* ============================================
   25. Responsive - Tablet (max 992px)
   ============================================ */
@media (max-width: 992px) {
  :root {
    --section-padding: 65px 0;
    --navbar-height: 64px;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .hero-stats {
    gap: 40px;
  }

  .hero-stat-item .stat-number {
    font-size: 2rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .library-info-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .search-results-container.grid-view,
  .search-results.grid-view {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-content-card {
    padding: 1.5rem;
  }

  .member-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  /* Navbar mobile */
  .sman5-navbar .navbar-toggle {
    display: block;
  }

  .sman5-navbar .navbar-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-primary);
    flex-direction: column;
    align-items: stretch;
    padding: 80px 24px 24px;
    box-shadow: var(--shadow-xl);
    transition: right var(--transition-normal);
    z-index: 1040;
    overflow-y: auto;
  }

  .sman5-navbar .navbar-menu.open {
    right: 0;
  }

  .sman5-navbar .navbar-menu .nav-link {
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }

  .sman5-navbar .navbar-menu .nav-link::after {
    display: none;
  }

  .sman5-navbar .navbar-menu .nav-link:hover,
  .sman5-navbar .navbar-menu .nav-link.active {
    background: var(--info-light);
    color: var(--primary);
  }

  .sman5-navbar .navbar-search {
    width: 100%;
  }

  .sman5-navbar .navbar-search input {
    width: 100%;
    background: var(--bg-secondary);
    border-color: var(--bg-tertiary);
    color: var(--text-primary);
    backdrop-filter: none;
  }

  .sman5-navbar .navbar-search input::placeholder {
    color: var(--text-muted);
  }

  .sman5-navbar .navbar-search input:focus {
    width: 100%;
  }

  .sman5-navbar .navbar-search i {
    color: var(--text-muted);
  }

  .navbar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1035;
    backdrop-filter: blur(2px);
  }

  .navbar-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease;
  }

  /* Swiper arrows always visible on touch */
  .swiper-button-next,
  .swiper-button-prev {
    opacity: 1 !important;
  }
}

/* ============================================
   26. Responsive - Small Tablet (max 768px)
   ============================================ */
@media (max-width: 768px) {
  .sman5-hero,
  .hero-section {
    min-height: 88vh;
    padding: 100px 16px 60px;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 20px;
  }

  .hero-stat-item .stat-number {
    font-size: 1.8rem;
  }

  .hero-search {
    margin-bottom: 2rem;
  }

  .quick-filters {
    gap: 8px;
  }

  .quick-filters .filter-tag {
    padding: 5px 14px;
    font-size: 0.78rem;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .category-card {
    padding: 22px 14px;
  }

  .reader-podium {
    flex-direction: column;
    align-items: center;
  }

  .reader-card {
    max-width: 100%;
    width: 100%;
  }

  .reader-card.rank-1 { order: -1; }
  .reader-card.rank-2 { order: 0; }
  .reader-card.rank-3 { order: 1; }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .stat-item,
  .stat-card {
    padding: 22px 16px;
  }

  .stat-number,
  .stat-card .stat-number {
    font-size: 1.8rem;
  }

  .result-card {
    flex-direction: column;
  }

  .result-card .result-cover {
    width: 100%;
    min-height: 200px;
    height: 200px;
  }

  .result-card .result-badge {
    padding: 0 18px 18px;
    align-self: flex-start;
  }

  .search-results-container.grid-view,
  .search-results.grid-view {
    grid-template-columns: 1fr 1fr;
  }

  .detail-content-card {
    padding: 1.25rem;
  }

  .member-cards {
    grid-template-columns: 1fr;
  }

  .member-header {
    flex-direction: column;
    text-align: center;
  }

  .member-loan-table {
    overflow-x: auto;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-col h4::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-col {
    text-align: center;
  }

  .footer-col .footer-brand {
    justify-content: center;
  }

  .social-icons,
  .footer-social {
    justify-content: center;
  }

  .footer-links li a::before,
  .footer-col ul li a::before {
    display: none;
  }

  .footer-col .footer-contact-item {
    justify-content: center;
    text-align: left;
  }

  .scroll-indicator {
    display: none;
  }
}

/* ============================================
   27. Responsive - Mobile (max 576px)
   ============================================ */
@media (max-width: 576px) {
  :root {
    --section-padding: 50px 0;
  }

  .sman5-navbar {
    padding: 0 1rem;
  }

  .hero-search input {
    padding: 14px 52px 14px 18px;
    font-size: 0.9rem;
  }

  .hero-search button {
    width: 42px;
    height: 42px;
    font-size: 0.95rem;
  }

  .hero-search {
    padding: 2px;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .category-icon {
    width: 46px;
    height: 46px;
    font-size: 1.1rem;
    border-radius: 12px;
    margin-bottom: 8px;
  }

  .category-name,
  .category-card h5,
  .category-card h6 {
    font-size: 0.78rem;
  }

  .category-number {
    font-size: 0.68rem;
  }

  .category-card {
    padding: 16px 8px 14px;
  }

  .section-header h2 {
    font-size: clamp(1.3rem, 4vw, 1.6rem);
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-number,
  .stat-card .stat-number {
    font-size: 1.5rem;
  }

  .stat-label,
  .stat-card .stat-label {
    font-size: 0.68rem;
    letter-spacing: 1px;
  }

  .search-results-container.grid-view,
  .search-results.grid-view {
    grid-template-columns: 1fr;
  }

  .detail-tabs .nav-tabs .nav-link {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  #backToTop,
  .scroll-top {
    width: 42px;
    height: 42px;
    bottom: 18px;
    right: 18px;
    font-size: 0.95rem;
  }

  .pagination-custom a,
  .pagination-custom span {
    min-width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }

  .search-form-inline {
    flex-direction: column;
  }

  .search-form-inline button {
    width: 100%;
  }
}

/* ============================================
   28. Responsive - Very Small (max 380px)
   ============================================ */
@media (max-width: 380px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: 16px;
  }
}

/* ============================================
   29. Print Styles
   ============================================ */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    font-family: 'Georgia', 'Times New Roman', serif;
  }

  .sman5-navbar,
  .sman5-footer,
  .scroll-top,
  #backToTop,
  .hero-search,
  .quick-filters,
  .hero-particles,
  .hero-shape,
  .scroll-indicator,
  .theme-toggle-btn,
  .navbar-toggle,
  .navbar-overlay,
  .social-icons,
  .footer-social,
  .view-toggle,
  .swiper-button-next,
  .swiper-button-prev,
  .swiper-pagination {
    display: none !important;
  }

  .sman5-hero,
  .hero-section {
    min-height: auto !important;
    padding: 20px 0 !important;
  }

  .hero-title {
    font-size: 24pt !important;
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
  }

  .hero-title span {
    -webkit-text-fill-color: #000 !important;
  }

  a {
    text-decoration: underline;
    color: #000 !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
  }

  a[href^="#"]::after,
  a[href^="javascript"]::after {
    content: "";
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  p, li, blockquote {
    orphans: 3;
    widows: 3;
  }

  .book-card,
  .collection-card,
  .result-card,
  .biblio-card {
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
    margin-bottom: 12pt;
  }

  .stats-grid,
  .categories-grid,
  .member-cards {
    display: block !important;
  }

  .stat-item,
  .stat-card,
  .category-card,
  .member-stat-card {
    display: inline-block;
    width: 48%;
    margin-bottom: 12pt;
    border: 1px solid #ccc !important;
    padding: 8pt;
    vertical-align: top;
  }
}

/* ============================================
   30. Reduced Motion Preferences
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-shape,
  .hero-particles::before,
  .hero-particles::after {
    animation: none !important;
  }

  .hero-search {
    animation: none;
    background-size: 100% 100%;
  }
}

/* ============================================
   31. News Cards
   ============================================ */
.news-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.news-card-image {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-card:hover .news-card-image img {
  transform: scale(1.08);
}

.news-card-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
}

.news-card-header {
  height: 140px;
  background: linear-gradient(135deg, var(--sman5-primary), var(--sman5-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-card-header .news-card-date-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
}

.news-card-header .news-day {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.news-card-header .news-month {
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.news-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.news-date-badge {
  position: absolute;
  top: -28px;
  right: 16px;
  background: var(--sman5-primary);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: 0 4px 12px rgba(var(--sman5-primary-rgb), 0.3);
  z-index: 2;
}

.news-date-badge .news-day {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.news-date-badge .news-month {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.news-meta {
  margin-bottom: 0.5rem;
}

.news-meta-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.news-meta-date i {
  margin-right: 4px;
  color: var(--sman5-primary);
}

.news-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.news-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-title a:hover {
  color: var(--sman5-primary);
}

.news-excerpt {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}

.news-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sman5-primary);
  text-decoration: none;
  transition: gap 0.2s ease;
}

.news-read-more:hover {
  gap: 10px;
  color: var(--sman5-secondary);
}

/* ============================================
   32. Missing Template Classes (Hero, Book Cards, Top Readers, Footer, Stats, etc.)
   ============================================ */

/* --- Hero Logo --- */
.hero-logo {
  margin-bottom: 1.5rem;
}

.hero-logo-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin: 0 auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
  border-radius: var(--radius-md);
}

/* --- Hero Floating Icons --- */
.hero-floating-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.floating-icon {
  position: absolute;
  color: rgba(255, 255, 255, 0.12);
  font-size: 1.8rem;
  animation: float 6s ease-in-out infinite;
}

.floating-icon.fi-1 { top: 15%; left: 8%; font-size: 2rem; animation-delay: 0s; }
.floating-icon.fi-2 { top: 25%; right: 10%; font-size: 2.5rem; animation-delay: -1.5s; }
.floating-icon.fi-3 { bottom: 35%; left: 15%; font-size: 1.5rem; animation-delay: -3s; }
.floating-icon.fi-4 { bottom: 20%; right: 15%; font-size: 2.2rem; animation-delay: -4s; }
.floating-icon.fi-5 { top: 50%; left: 50%; font-size: 1.6rem; animation-delay: -2s; }

/* --- Hero Search Inner (new structure) --- */
.hero-search-inner {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--radius-xl);
  padding: 6px 6px 6px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  gap: 8px;
}

.search-icon-wrapper {
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.hero-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-family: var(--font-family);
  color: #1a1a2e;
  outline: none;
  padding: 10px 8px;
  min-width: 0;
}

.hero-search-input::placeholder {
  color: var(--text-muted);
}

.hero-search-btn {
  flex-shrink: 0;
  border: none;
  background: var(--primary-gradient);
  color: var(--text-white);
  padding: 12px 24px;
  border-radius: var(--radius-xl);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-spring);
  box-shadow: var(--shadow-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-search-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.45);
}

/* --- Hero Stats (new structure) --- */
.hero-stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.hero-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}

.hero-stat-content {
  display: flex;
  flex-direction: column;
}

.hero-stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.1;
}

.hero-stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
}

/* --- Hero Wave --- */
.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  line-height: 0;
  z-index: 2;
}

.hero-wave svg {
  display: block;
  width: 100%;
  height: 80px;
}

/* --- Scroll Indicator --- */
.scroll-indicator-text {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.scroll-indicator-arrow {
  animation: float 2s ease-in-out infinite;
}

/* --- Quick Filter Badges --- */
.filter-badge {
  padding: 6px 18px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  backdrop-filter: blur(4px);
}

.filter-badge:hover,
.filter-badge.active {
  background: rgba(255, 255, 255, 0.25);
  color: var(--text-white);
  transform: translateY(-2px);
}

/* --- Section Header Flex (Popular/Latest) --- */
.section-header-flex {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 1.5rem;
}

/* --- Section Badge --- */
.section-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-xl);
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.section-badge-gold {
  background: rgba(255, 215, 0, 0.15);
  color: #d4a800;
}

.section-badge-success {
  background: rgba(var(--success-rgb), 0.1);
  color: var(--success);
}

/* --- Section Title & Subtitle --- */
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* --- Section Divider (line) --- */
.section-divider {
  width: 56px;
  height: 4px;
  background: var(--primary-gradient);
  border-radius: 2px;
  margin-top: 14px;
}

.section-divider-gold {
  background: linear-gradient(135deg, #ffd700, #f59e0b);
}

/* --- See All Button --- */
.see-all-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- Book Card (new sub-elements) --- */
.book-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 10px;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
}

.book-cover-placeholder i {
  font-size: 2.5rem;
  opacity: 0.4;
}

.book-cover-placeholder span {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.6;
  line-height: 1.3;
}

.book-cover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: 2;
}

.book-card:hover .book-cover-overlay {
  opacity: 1;
}

.book-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 3;
  backdrop-filter: blur(6px);
}

.badge-popular {
  background: rgba(234, 67, 53, 0.85);
  color: #fff;
}

.badge-new {
  background: rgba(15, 157, 88, 0.85);
  color: #fff;
}

.book-info {
  padding: 14px;
  margin-top: auto;
}

.book-title {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.35;
  min-height: 2.4em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.book-title a:hover {
  color: var(--primary);
}

.book-author {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-author i {
  font-size: 0.7rem;
}

/* --- Swiper equal height slides --- */
.swiper-wrapper {
  align-items: stretch;
}

.swiper-slide {
  height: auto;
}

/* --- Swiper Navigation Arrows --- */
.popular-swiper .swiper-button-prev,
.popular-swiper .swiper-button-next,
.latest-swiper .swiper-button-prev,
.latest-swiper .swiper-button-next {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all var(--transition-fast);
}

.popular-swiper .swiper-button-prev::after,
.popular-swiper .swiper-button-next::after,
.latest-swiper .swiper-button-prev::after,
.latest-swiper .swiper-button-next::after {
  font-size: 14px;
  color: var(--primary);
}

.popular-swiper .swiper-button-prev:hover,
.popular-swiper .swiper-button-next:hover,
.latest-swiper .swiper-button-prev:hover,
.latest-swiper .swiper-button-next:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.popular-swiper .swiper-button-prev:hover::after,
.popular-swiper .swiper-button-next:hover::after,
.latest-swiper .swiper-button-prev:hover::after,
.latest-swiper .swiper-button-next:hover::after {
  color: #fff;
}

/* --- Swiper Pagination --- */
.popular-swiper .swiper-pagination,
.latest-swiper .swiper-pagination {
  bottom: 0;
  position: relative;
  margin-top: 20px;
}

/* --- Top Readers Section (rewrite for template HTML) --- */
.sman5-top-readers {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  overflow: hidden;
}

.podium-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.reader-podium {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 20px 10px 0;
}

.reader-podium-first {
  transform: scale(1.05);
}

/* Podium medal */
.podium-medal {
  position: relative;
  margin-bottom: 12px;
  z-index: 2;
}

.medal-circle {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.reader-podium-first .medal-circle {
  width: 50px;
  height: 50px;
  font-size: 1.3rem;
  animation: medal-glow 2.5s ease-in-out infinite;
}

.medal-shine {
  position: absolute;
  inset: -6px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255, 215, 0, 0.3);
  animation: pulse-ring 2s ease-in-out infinite;
}

/* Reader avatar */
.reader-avatar-wrapper {
  position: relative;
  margin-bottom: 12px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.reader-avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-full);
  border: 3px solid;
  opacity: 0.6;
}

.reader-avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--bg-tertiary);
}

.reader-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reader-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #334155, #475569);
  color: rgba(255, 255, 255, 0.5);
  font-size: 2rem;
}

/* Reader info */
.reader-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.reader-type {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
  display: block;
}

.reader-stats-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}

.reader-stat-badge {
  padding: 3px 10px;
  border-radius: var(--radius-xl);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.reader-stat-badge-secondary {
  background: rgba(255, 255, 255, 0.05);
}

/* Podium base */
.podium-base {
  width: 100%;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20px;
  margin-top: auto;
}

.reader-podium:nth-child(1) .podium-base,
.order-md-1 .podium-base {
  background: linear-gradient(180deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05));
}

.reader-podium:nth-child(2) .podium-base,
.order-md-2 .podium-base,
.reader-podium-first .podium-base {
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
}

.reader-podium:nth-child(3) .podium-base,
.order-md-3 .podium-base {
  background: linear-gradient(180deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.05));
}

.podium-rank {
  font-size: 2.5rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.15);
  line-height: 1;
}

/* Additional readers (4th+) */
.reader-card-mini {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 20px 12px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all var(--transition-normal);
}

.reader-card-mini:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-4px);
}

.reader-rank-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
}

.reader-avatar-mini {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0 auto 8px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.2rem;
}

.reader-avatar-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reader-name-mini {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2px;
}

.reader-count-mini {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
}

/* --- Visitor Stats (fix stat-counter conflict) --- */
.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card-bg-icon {
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 4rem;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

.stat-card .stat-icon,
.stat-card .stat-number,
.stat-card .stat-label,
.stat-card .stat-desc {
  position: relative;
  z-index: 1;
}

.stat-desc {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  display: block;
  margin-top: 4px;
}

/* Fix .stat-counter element being an inline span, not a grid */
span.stat-counter {
  display: inline;
  padding: 0;
}

/* --- Map Placeholder --- */
.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  gap: 12px;
}

.map-placeholder i {
  font-size: 3rem;
  opacity: 0.3;
}

.map-placeholder p {
  font-size: 1rem;
  margin: 0;
}

/* --- Info Card (library info) --- */
.info-card-header {
  padding: 18px 24px;
  background: var(--primary-gradient);
  color: var(--text-white);
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.info-card-body {
  padding: 24px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.contact-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.contact-content {
  flex: 1;
}

.contact-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.contact-value {
  font-size: 0.9rem;
  color: var(--text-primary);
}

a.contact-value:hover {
  color: var(--primary);
}

.info-card-social {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--bg-tertiary);
}

/* Social btn on light bg */
.info-card-social .social-btn,
.sman5-library-info .social-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all var(--transition-spring);
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.info-card-social .social-btn:hover,
.sman5-library-info .social-btn:hover {
  color: var(--text-white);
  transform: translateY(-4px);
}

.social-instagram:hover { background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045) !important; }
.social-whatsapp:hover { background: #25d366 !important; }
.social-facebook:hover { background: #1877f2 !important; }
.social-youtube:hover { background: #ff0000 !important; }

/* --- Footer (Bootstrap grid compatibility) --- */
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
}

.footer-logo {
  height: 48px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-brand-name {
  color: var(--text-white);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0;
  line-height: 1.3;
}

.footer-about {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.88rem;
  line-height: 1.7;
}

.footer-heading {
  color: var(--text-white);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

.footer-links {
  padding: 0;
  margin: 0;
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links li a {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.88rem;
  text-decoration: none;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-links li a:hover {
  color: var(--text-white);
  padding-left: 4px;
}

.footer-links li a i {
  font-size: 0.65rem;
  opacity: 0.5;
}

.footer-contact {
  padding: 0;
  margin: 0;
  list-style: none;
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.55);
}

.footer-contact li i {
  color: var(--primary-light);
  margin-top: 3px;
  min-width: 16px;
  font-size: 0.85rem;
}

.footer-contact li a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
}

.footer-contact li a:hover {
  color: var(--text-white);
}

.footer-popular-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.topic-tag:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-white);
  transform: translateY(-2px);
}

.footer-version {
  opacity: 0.5;
  margin-left: 4px;
}

.footer-bottom small a {
  color: var(--primary-light);
}

.footer-bottom small a:hover {
  color: var(--text-white);
}

/* --- Back to Top Button (show class from JS) --- */
#backToTop.show,
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: var(--text-white);
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  transition: all var(--transition-spring);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.45);
}

.back-to-top-progress {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  transform: rotate(-90deg);
  pointer-events: none;
}

.back-to-top-progress circle {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-state-icon {
  font-size: 3rem;
  color: var(--text-muted);
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.empty-state-dark .empty-state-icon {
  color: rgba(255, 255, 255, 0.3);
}

/* --- Hover Lift Utility --- */
.hover-lift {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* --- Category Card (extended) --- */
.category-card {
  position: relative;
}

.category-card-bg {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: 0;
}

.category-card:hover .category-card-bg {
  opacity: 0.08;
}

.category-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.category-card-content .category-name {
  min-height: 2.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-card-content .category-desc {
  flex: 1;
}

.category-card-content .category-count {
  margin-top: auto;
}

.category-card-glow {
  position: absolute;
  bottom: -10px;
  left: 20%;
  right: 20%;
  height: 20px;
  border-radius: var(--radius-full);
  filter: blur(16px);
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: 0;
}

.category-card:hover .category-card-glow {
  opacity: 0.3;
}

.category-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.category-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 8px;
  opacity: 0.8;
}

/* --- Hamburger Icon (Bootstrap toggler) --- */
.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 24px;
}

.hamburger-icon span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: all var(--transition-fast);
}

/* --- Navbar Logo --- */
.navbar-logo {
  height: 38px;
  width: auto;
}

.navbar-logo-placeholder {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.brand-text-wrapper .brand-text {
  font-weight: 700;
  font-size: 1rem;
}

/* --- Nav Action Buttons --- */
.nav-action-btn {
  font-size: 0.82rem;
}

.member-avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.7rem;
}

.member-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Responsive fixes for new elements --- */
@media (max-width: 768px) {
  .hero-stat-divider {
    display: none;
  }

  .hero-stats {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .section-header-flex {
    flex-direction: column;
    align-items: flex-start;
  }

  .reader-podium-first {
    transform: none;
  }

  .podium-base {
    height: auto !important;
    min-height: 60px;
  }

  .footer-heading::after {
    left: 0;
  }
}

@media (max-width: 576px) {
  .hero-search-btn span {
    display: none;
  }

  .hero-search-btn {
    padding: 12px 16px;
  }

  .hero-logo-img {
    width: 60px;
    height: 60px;
  }
}

/* ============================================
   33. High Contrast Mode
   ============================================ */
@media (prefers-contrast: high) {
  :root {
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  }

  .category-card,
  .book-card,
  .collection-card,
  .result-card,
  .biblio-card,
  .info-card,
  .member-stat-card {
    border: 2px solid var(--text-primary);
  }

  .sman5-navbar.scrolled,
  .sman5-navbar.navbar-scrolled {
    border-bottom: 2px solid var(--text-primary);
  }
}
