/* ============================================
   UNIVERSITY LIBRARY - Main Stylesheet
   Ахмет Ясауи Университеті Кітапханасы
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --lib-primary: #1a7a8a;
  --lib-primary-dark: #146570;
  --lib-primary-light: #e8f4f6;
  --lib-accent: #0d6efd;
  --lib-dark: #1b2a3d;
  --lib-gray: #6c757d;
  --lib-gray-light: #f5f7fa;
  --lib-white: #ffffff;
  --lib-border: #dee2e6;
  --lib-text: #333333;
  --lib-text-light: #666666;
  --lib-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --lib-shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
  --lib-radius: 12px;
  --lib-radius-sm: 8px;
  --lib-transition: all 0.3s ease;
  --lib-gradient: linear-gradient(135deg, #1a7a8a 0%, #2196a8 50%, #28a5b8 100%);
  --lib-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dark mode variables */
[data-theme="dark"] {
  --lib-primary: #2ec4d8;
  --lib-primary-dark: #1a7a8a;
  --lib-primary-light: #1a2d33;
  --lib-dark: #e8e8e8;
  --lib-gray: #adb5bd;
  --lib-gray-light: #1a1f2e;
  --lib-white: #0f1523;
  --lib-border: #2a3042;
  --lib-text: #e0e0e0;
  --lib-text-light: #adb5bd;
  --lib-shadow: 0 2px 12px rgba(0,0,0,0.3);
  --lib-shadow-hover: 0 8px 30px rgba(0,0,0,0.4);
  --lib-gradient: linear-gradient(135deg, #0f3d45 0%, #164d58 50%, #1a5c6a 100%);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--lib-font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--lib-text);
  background-color: var(--lib-white);
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--lib-transition);
}

a:hover {
  color: var(--lib-primary);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Preloader ---------- */
.lib-preloader {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--lib-white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s ease;
}

.lib-preloader.hidden {
  opacity: 0;
  pointer-events: none;
}

.lib-preloader .spinner {
  width: 50px; height: 50px;
  border: 4px solid var(--lib-border);
  border-top-color: var(--lib-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Top Bar ---------- */
.lib-topbar {
  background: var(--lib-white);
  border-bottom: 1px solid var(--lib-border);
  padding: 8px 0;
  font-size: 13px;
}

.lib-topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lib-topbar-left a {
  color: var(--lib-text-light);
  margin-right: 20px;
  font-weight: 500;
}

.lib-topbar-left a:hover {
  color: var(--lib-primary);
}

.lib-topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.lib-topbar-right .lang-switch {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--lib-text-light);
  font-size: 13px;
}

.lib-topbar-right .lang-switch img {
  width: 18px;
  height: 13px;
  border-radius: 2px;
}

.lib-topbar-right .time-display {
  color: var(--lib-text-light);
  font-size: 13px;
}

/* ---------- Header ---------- */
.lib-header {
  background: var(--lib-white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.lib-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
}

.lib-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.lib-logo img {
  height: 48px;
  width: auto;
  flex-shrink: 0;
}

.lib-logo-text {
  padding-left: 0;
}

.lib-logo-text h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--lib-dark);
  line-height: 1.2;
  white-space: nowrap;
}

.lib-logo-text span {
  font-size: 11px;
  color: var(--lib-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ---------- Navigation ---------- */
.lib-nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.lib-nav a {
  padding: 10px 16px;
  font-weight: 500;
  font-size: 14px;
  color: var(--lib-text);
  position: relative;
  white-space: nowrap;
}

.lib-nav a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: var(--lib-primary);
  transition: var(--lib-transition);
  transform: translateX(-50%);
}

.lib-nav a:hover::after,
.lib-nav a.active::after {
  width: 70%;
}

.lib-nav a:hover,
.lib-nav a.active {
  color: var(--lib-primary);
}

/* ---- Dynamic admin nav: flat <ul> inside .lib-nav ---- */
.lib-admin-pages-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0;
}

.lib-admin-pages-nav > li > a {
  padding: 10px 16px;
  font-weight: 500;
  font-size: 14px;
  color: var(--lib-text);
  display: block;
  position: relative;
  text-decoration: none;
  transition: color .2s;
  white-space: nowrap;
}
.lib-admin-pages-nav > li > a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: var(--lib-primary);
  transition: var(--lib-transition);
  transform: translateX(-50%);
}
.lib-admin-pages-nav > li:hover > a::after,
.lib-admin-pages-nav > li.active > a::after { width: 70%; }
.lib-admin-pages-nav > li:hover > a,
.lib-admin-pages-nav > li.active > a { color: var(--lib-primary); }

/* Dropdown parent */
.lib-nav-dropdown { position: relative; }

.lib-nav-dropdown-toggle .lib-caret {
  font-size: 10px;
  margin-left: 4px;
  transition: transform .25s;
}
.lib-nav-dropdown.open .lib-caret { transform: rotate(180deg); }
.lib-nav-dropdown-toggle { cursor: pointer; }

/* Dropdown sub-menu */
.lib-nav-sub {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  z-index: 1000;
  border: 1px solid var(--lib-border);
}
[data-theme="dark"] .lib-nav-sub { background: #1f2937; }
.lib-nav-dropdown.open .lib-nav-sub { display: block; animation: navSubIn .18s ease; }
@keyframes navSubIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lib-nav-sub li a {
  display: block;
  padding: 8px 18px;
  font-size: 13px;
  color: var(--lib-text);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.lib-nav-sub li a:hover {
  background: rgba(26,122,138,.08);
  color: var(--lib-primary);
  padding-left: 24px;
}
.lib-nav-sub li.active a {
  color: var(--lib-primary);
  font-weight: 600;
}

/* Header actions */
.lib-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lib-dark-toggle {
  background: none;
  border: 1px solid var(--lib-border);
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--lib-text);
  transition: var(--lib-transition);
}

.lib-dark-toggle:hover {
  background: var(--lib-gray-light);
  border-color: var(--lib-primary);
  color: var(--lib-primary);
}

/* Mobile menu button */
.lib-mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--lib-text);
  cursor: pointer;
  padding: 5px;
}

/* ---------- Sub Navigation ---------- */
.lib-subnav {
  background: var(--lib-primary);
  padding: 0;
}

.lib-subnav .container {
  display: flex;
  align-items: center;
  gap: 0;
}

.lib-subnav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 500;
  transition: var(--lib-transition);
  white-space: nowrap;
}

.lib-subnav a i {
  font-size: 16px;
}

.lib-subnav a:hover,
.lib-subnav a.active {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}
/* ---------- Full Video Hero With Sound Toggle ---------- */

.lib-video-full-hero {
  padding: 0 !important;
  background: #000 !important;
  height: calc(100vh - 80px);
  min-height: 420px;
  max-height: 760px;
  width: 100%;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.lib-video-full-hero::before {
  display: none !important;
}

.lib-hero-bg-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: #000;
}

.lib-video-sound-btn {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  z-index: 5;
}

.lib-video-sound-btn:hover {
  background: rgba(26,122,138,0.8);
  transform: scale(1.06);
}

.lib-video-sound-btn.sound-on {
  background: rgba(26,122,138,0.9);
}

@media (max-width: 768px) {
  .lib-video-full-hero {
    height: 60vh;
    min-height: 300px;
  }

  .lib-video-sound-btn {
    width: 46px;
    height: 46px;
    right: 16px;
    bottom: 16px;
    font-size: 18px;
  }
}
/* ---------- Hero / Search Section ---------- */
.lib-hero {
  background: url('/assets/images/logo.jpeg') center center / cover no-repeat;
  padding: 60px 0 70px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.lib-hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -20%;
  width: 140%; height: 200%;
  background: radial-gradient(circle at 30% 70%, rgba(255,255,255,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.lib-hero h2 {
  font-size: 36px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
  line-height: 1.3;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.lib-hero p {
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  max-width: 620px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

/* Search Tabs */
.lib-search-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 0;
  background: rgba(255,255,255,0.12);
  border-radius: var(--lib-radius) var(--lib-radius) 0 0;
  overflow: hidden;
  display: inline-flex;
}

.lib-search-tabs button {
  padding: 12px 28px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--lib-transition);
  font-family: var(--lib-font);
}

.lib-search-tabs button:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
}

.lib-search-tabs button.active {
  background: var(--lib-white);
  color: var(--lib-text);
}

/* Search Box */
.lib-search-box {
  max-width: 680px;
  margin: 0 auto;
  background: var(--lib-white);
  border-radius: 0 var(--lib-radius) var(--lib-radius) var(--lib-radius);
  padding: 8px;
  display: flex;
  align-items: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.lib-search-box .search-icon {
  padding: 0 12px;
  color: var(--lib-gray);
  font-size: 20px;
}

.lib-search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  padding: 12px 8px;
  font-family: var(--lib-font);
  background: transparent;
  color: var(--lib-text);
}

.lib-search-box input::placeholder {
  color: var(--lib-gray);
}

.lib-search-box .search-btn {
  background: var(--lib-primary);
  color: #fff;
  border: none;
  border-radius: var(--lib-radius-sm);
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--lib-transition);
  font-family: var(--lib-font);
}

.lib-search-box .search-btn:hover {
  background: var(--lib-primary-dark);
  transform: translateY(-1px);
}

/* Search quick links */
.lib-search-links {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 24px;
}

.lib-search-links a {
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.4);
}

.lib-search-links a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* ---------- Slider / Banner Section ---------- */
.lib-slider-section {
  padding: 50px 0;
  background: var(--lib-gray-light);
}

.lib-slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--lib-radius);
  box-shadow: var(--lib-shadow);
}

.lib-slider-track {
  display: flex;
  transition: transform 0.5s ease;
}

.lib-slide {
  min-width: 100%;
  display: flex;
  align-items: center;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  border-radius: var(--lib-radius);
  overflow: hidden;
  min-height: 455px;
  position: relative;
}

.lib-slide::before {
  content: '';
  position: absolute;
  inset: 0;
}

.lib-slide-content {
  flex: 1;
  padding: 50px 50px;
  color: #fff;
  position: relative;
  z-index: 1;
}

.lib-slide-content .slide-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  margin-bottom: 20px;
}

.lib-slide-content .slide-badge i {
  font-size: 16px;
}

.lib-slide-content h3 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.lib-slide-content p {
  font-size: 15px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 24px;
  line-height: 1.6;
  max-width: 500px;
}

.lib-slide-actions {
  display: flex;
  gap: 12px;
}

.lib-slide-actions .btn-primary-lib {
  background: var(--lib-primary);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--lib-radius-sm);
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: var(--lib-transition);
}

.lib-slide-actions .btn-primary-lib:hover {
  background: var(--lib-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(26,122,138,0.4);
}

.lib-slide-actions .btn-outline-lib {
  background: transparent;
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--lib-radius-sm);
  font-weight: 600;
  font-size: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  cursor: pointer;
  transition: var(--lib-transition);
}

.lib-slide-actions .btn-outline-lib:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
}

/* Slider controls */
.lib-slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.lib-slider-dots button {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: none;
  background: var(--lib-border);
  cursor: pointer;
  transition: var(--lib-transition);
  padding: 0;
}

.lib-slider-dots button.active {
  background: var(--lib-primary);
  width: 30px;
  border-radius: 6px;
}

.lib-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.9);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--lib-text);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: var(--lib-transition);
}

.lib-slider-arrow:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.lib-slider-arrow.prev { left: 16px; }
.lib-slider-arrow.next { right: 16px; }

/* ---------- Quick Access Section ---------- */
.lib-quick-access {
  padding: 60px 0;
  background: var(--lib-white);
}

.lib-section-title {
  text-align: center;
  margin-bottom: 40px;
}

.lib-section-title h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--lib-dark);
  margin-bottom: 8px;
}

.lib-section-title .title-line {
  width: 60px; height: 3px;
  background: var(--lib-primary);
  margin: 0 auto;
  border-radius: 2px;
}

.lib-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.lib-quick-card {
  background: var(--lib-white);
  border: 1px solid var(--lib-border);
  border-radius: var(--lib-radius);
  padding: 32px 24px;
  text-align: center;
  transition: var(--lib-transition);
  cursor: pointer;
}

.lib-quick-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--lib-shadow-hover);
  border-color: var(--lib-primary);
}

.lib-quick-card .card-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--lib-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 28px;
  color: var(--lib-primary);
  transition: var(--lib-transition);
}

.lib-quick-card:hover .card-icon {
  background: var(--lib-primary);
  color: #fff;
  transform: scale(1.05);
}

.lib-quick-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--lib-dark);
  margin-bottom: 10px;
}

.lib-quick-card p {
  font-size: 13px;
  color: var(--lib-text-light);
  line-height: 1.6;
}

/* ---------- News + Sidebar Section ---------- */
.lib-news-section {
  padding: 60px 0;
  background: var(--lib-gray-light);
}

.lib-news-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  align-items: start;
}

.lib-news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.lib-news-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--lib-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.lib-news-header h2 i {
  color: var(--lib-primary);
}

.lib-news-header .view-all {
  color: var(--lib-primary);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lib-news-header .view-all:hover {
  text-decoration: underline;
}

/* News card */
.lib-news-card {
  background: var(--lib-white);
  border-radius: var(--lib-radius);
  overflow: hidden;
  display: flex;
  margin-bottom: 20px;
  box-shadow: var(--lib-shadow);
  transition: var(--lib-transition);
}

.lib-news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--lib-shadow-hover);
}

.lib-news-card-image {
  flex: 0 0 180px;
  overflow: hidden;
}

.lib-news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.lib-news-card:hover .lib-news-card-image img {
  transform: scale(1.05);
}

.lib-news-card-body {
  flex: 1;
  padding: 20px;
}

.lib-news-card-body .news-category {
  display: inline-block;
  background: var(--lib-primary-light);
  color: var(--lib-primary);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.lib-news-card-body h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--lib-dark);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lib-news-card-body p {
  font-size: 13px;
  color: var(--lib-text-light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.lib-news-card-body .news-date {
  font-size: 12px;
  color: var(--lib-gray);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.news-view-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--lib-primary);
  background: rgba(26,122,138,.08);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(26,122,138,.18);
  transition: background .2s;
  white-space: nowrap;
}
.lib-news-card:hover .news-view-count {
  background: rgba(26,122,138,.16);
}

/* ---------- Sidebar ---------- */
.lib-sidebar-block {
  background: var(--lib-white);
  border-radius: var(--lib-radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--lib-shadow);
}

.lib-sidebar-block h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--lib-dark);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--lib-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lib-sidebar-block h3 i {
  color: var(--lib-primary);
}

.lib-sidebar-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--lib-radius-sm);
  margin-bottom: 6px;
  transition: var(--lib-transition);
  color: var(--lib-text);
  font-size: 14px;
  font-weight: 500;
}

.lib-sidebar-link:hover {
  background: var(--lib-primary-light);
  color: var(--lib-primary);
  transform: translateX(4px);
}

.lib-sidebar-link .link-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--lib-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--lib-primary);
  flex-shrink: 0;
  transition: var(--lib-transition);
}

.lib-sidebar-link:hover .link-icon {
  background: var(--lib-primary);
  color: #fff;
}

/* ---------- New Books Section ---------- */
.lib-books-section {
  padding: 60px 0;
  background: var(--lib-white);
}

.lib-books-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.lib-books-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--lib-dark);
}

.lib-books-navigation {
  display: flex;
  gap: 10px;
}

.lib-books-navigation button {
  width: 40px; height: 40px;
  border: 1px solid var(--lib-border);
  border-radius: 50%;
  background: var(--lib-white);
  cursor: pointer;
  font-size: 18px;
  color: var(--lib-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--lib-transition);
}

.lib-books-navigation button:hover {
  background: var(--lib-primary);
  color: #fff;
  border-color: var(--lib-primary);
}

.lib-books-carousel {
  overflow: hidden;
  position: relative;
}

.lib-books-track {
  display: flex;
  gap: 24px;
  transition: transform 0.5s ease;
}

.lib-book-card {
  flex: 0 0 calc((100% - 120px) / 6);
  background: var(--lib-white);
  border: 1px solid var(--lib-border);
  border-radius: var(--lib-radius);
  overflow: hidden;
  transition: var(--lib-transition);
  cursor: pointer;
}

.lib-book-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--lib-shadow-hover);
}

.lib-book-card .book-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--lib-gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lib-book-card .book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.lib-book-card:hover .book-cover img {
  transform: scale(1.05);
}

.lib-book-card .book-info {
  padding: 14px;
}

.lib-book-card .book-info h5 {
  font-size: 14px;
  font-weight: 600;
  color: var(--lib-dark);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-book-card .book-info span {
  font-size: 12px;
  color: var(--lib-gray);
}

/* ---------- Booking Modal ---------- */
.lib-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 10000;
}

.lib-modal.open {
  display: block;
}

.lib-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 14, 22, 0.64);
}

.lib-modal-dialog {
  position: relative;
  width: min(760px, calc(100% - 24px));
  margin: 4vh auto;
  background: var(--lib-white);
  border: 1px solid var(--lib-border);
  border-radius: var(--lib-radius);
  box-shadow: var(--lib-shadow-hover);
  padding: 24px;
  max-height: 92vh;
  overflow-y: auto;
}

.lib-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--lib-gray-light);
  color: var(--lib-text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.lib-modal-dialog h3 {
  margin-bottom: 16px;
  color: var(--lib-dark);
}

.lib-booking-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--lib-text-light);
}

.lib-booking-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lib-booking-form input,
.lib-booking-form select,
.lib-booking-form textarea {
  width: 100%;
  border: 1px solid var(--lib-border);
  border-radius: var(--lib-radius-sm);
  padding: 10px;
  margin-bottom: 12px;
  font-family: var(--lib-font);
  background: var(--lib-white);
  color: var(--lib-text);
}

.lib-booking-submit {
  margin-top: 2px;
}

.lib-booking-message {
  margin-top: 10px;
  font-size: 14px;
}

.lib-booking-message.success { color: #138a52; }
.lib-booking-message.error { color: #bb1f2b; }

.lib-booking-info-list {
  padding-left: 18px;
  color: var(--lib-text);
}

.lib-booking-info-list li {
  margin: 8px 0;
}

/* ---------- Footer ---------- */
.lib-footer {
  background: #1b2a3d;
  color: rgba(255,255,255,0.7);
  padding: 50px 0 0;
}

.lib-footer-top,
.lib-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.lib-footer-brand h3 {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
}

.lib-footer-brand p {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
}

.lib-footer-col h4 {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
}

.lib-footer-col a {
  display: block;
  padding: 5px 0;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  transition: var(--lib-transition);
}

.lib-footer-col a:hover {
  color: #fff;
  padding-left: 6px;
}

.lib-footer-social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.lib-footer-social a {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: rgba(255,255,255,0.6);
  transition: var(--lib-transition);
}

.lib-footer-social a:hover {
  background: var(--lib-primary);
  border-color: var(--lib-primary);
  color: #fff;
  padding-left: 0;
}

.lib-footer-badge {
  margin-top: 20px;
  background: rgba(255,67,67,0.15);
  border: 1px solid rgba(255,67,67,0.3);
  padding: 8px 16px;
  border-radius: var(--lib-radius-sm);
  display: inline-block;
}

.lib-footer-badge a {
  color: #ff6b6b;
  font-size: 13px;
  font-weight: 600;
}

.lib-footer-badge a:hover {
  padding-left: 0;
}

.lib-footer-bottom {
  text-align: center;
  padding: 20px 0;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}

.lib-footer-bottom a {
  color: rgba(255,255,255,0.5);
}

.lib-footer-bottom a:hover {
  color: #fff;
}

/* ---------- Scroll to Top ---------- */
.lib-scroll-top {
  position: fixed;
  bottom: 30px; right: 30px;
  width: 46px; height: 46px;
  background: var(--lib-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(26,122,138,0.4);
  opacity: 0;
  transform: translateY(20px);
  transition: var(--lib-transition);
  z-index: 999;
}

.lib-scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.lib-scroll-top:hover {
  background: var(--lib-primary-dark);
  transform: translateY(-3px);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .lib-quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .lib-news-layout {
    grid-template-columns: 1fr;
  }
  .lib-footer-top,
  .lib-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .lib-book-card {
    flex: 0 0 calc((100% - 72px) / 4);
  }
  .lib-slide {
    min-height: 340px;
  }
}

@media (max-width: 768px) {
  .lib-topbar {
    display: none;
  }

  .lib-mobile-menu-btn {
    display: block;
  }

  .lib-nav {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--lib-white);
    flex-direction: column;
    padding: 80px 30px 30px;
    z-index: 9999;
  }

  .lib-nav.open {
    display: flex;
  }

  .lib-nav a {
    padding: 14px 0;
    font-size: 18px;
    border-bottom: 1px solid var(--lib-border);
  }

  /* Mobile: dynamic admin nav pages */
  .lib-admin-pages-nav {
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
  }
  .lib-admin-pages-nav > li > a {
    padding: 14px 0;
    font-size: 18px;
    border-bottom: 1px solid var(--lib-border);
    width: 100%;
  }
  .lib-nav-sub {
    position: static;
    box-shadow: none;
    border: none;
    background: var(--lib-gray-light);
    border-radius: 6px;
    padding: 4px 0;
    margin-top: 4px;
    display: none;
  }
  .lib-nav-dropdown.open .lib-nav-sub { display: block; }
  .lib-nav-sub li a { padding: 10px 20px; font-size: 15px; }

  .lib-nav .close-nav {
    display: block;
    position: absolute;
    top: 20px; right: 20px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--lib-text);
  }

  .lib-header-actions {
    gap: 8px;
  }

  .lib-subnav .container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .lib-hero h2 {
    font-size: 26px;
  }

  .lib-hero p {
    font-size: 14px;
  }

  .lib-search-tabs button {
    padding: 10px 16px;
    font-size: 13px;
  }

  .lib-slide {
    flex-direction: column;
    min-height: auto;
  }

  .lib-slide-content {
    padding: 30px 24px;
  }

  .lib-slide-content h3 {
    font-size: 22px;
  }

  .lib-quick-grid {
    grid-template-columns: 1fr;
  }

  .lib-news-card {
    flex-direction: column;
  }

  .lib-news-card-image {
    flex: none;
    height: 180px;
  }

  .lib-book-card {
    flex: 0 0 calc((100% - 48px) / 3);
  }

  .lib-footer-top,
  .lib-footer-grid {
    grid-template-columns: 1fr;
  }

  .lib-books-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .lib-booking-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .lib-hero {
    padding: 40px 0 50px;
  }

  .lib-hero h2 {
    font-size: 22px;
  }

  .lib-search-box {
    flex-direction: column;
    border-radius: var(--lib-radius);
  }

  .lib-search-box .search-btn {
    width: 100%;
  }

  .lib-search-links {
    flex-direction: column;
    gap: 10px;
  }

  .lib-slide-actions {
    flex-direction: column;
  }

  .lib-book-card {
    flex: 0 0 calc((100% - 24px) / 2);
  }

  .lib-slider-arrow {
    width: 36px; height: 36px;
    font-size: 16px;
  }
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Smooth transitions for dark mode */
body, .lib-header, .lib-quick-card, .lib-news-card,
.lib-sidebar-block, .lib-book-card, .lib-search-box {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* =============================================
   STATS COUNTER SECTION
   ============================================= */
.lib-stats-section {
  background: linear-gradient(135deg, var(--lib-primary) 0%, #0d5c6a 100%);
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}
.lib-stats-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}
.lib-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  position: relative;
}
.lib-stat-item {
  text-align: center;
  color: #fff;
  padding: 24px 16px;
}
.stat-icon {
  font-size: 36px;
  opacity: .75;
  margin-bottom: 12px;
}
.stat-num {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -1px;
}
.stat-label {
  font-size: 13px;
  opacity: .8;
  text-transform: uppercase;
  letter-spacing: .5px;
}
@media (max-width: 768px) {
  .lib-stats-grid { grid-template-columns: repeat(2,1fr); gap: 20px; }
  .stat-num { font-size: 32px; }
}
@media (max-width: 420px) {
  .lib-stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* =============================================
   NEW MODAL SHARED HELPERS
   ============================================= */
.modal-header-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(26,122,138,.12);
  color: var(--lib-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin: 0 auto 16px;
}
.modal-header-icon.info  { background: rgba(41,128,185,.12); color:#2980b9; }
.modal-header-icon.eresurs { background: rgba(142,68,173,.12); color:#8e44ad; }
.modal-header-icon.room { background: rgba(39,174,96,.12);  color:#27ae60; }

.modal-subtitle {
  text-align: center;
  color: #777;
  font-size: 14px;
  margin-top: -8px;
  margin-bottom: 20px;
}

.lib-modal-dialog h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--lib-dark);
  text-align: center;
  margin-bottom: 8px;
}

.lib-form .form-group { margin-bottom: 14px; }
.lib-form .form-group label { display:block; font-size:13px; font-weight:600; color:#555; margin-bottom:5px; }
.lib-form input,
.lib-form select,
.lib-form textarea {
  width:100%; padding:10px 13px; border:1.5px solid #dde3ea;
  border-radius: 8px; font-size:14px; color: var(--lib-dark);
  background:#fff; transition: border-color .2s;
  box-sizing: border-box;
}
.lib-form input:focus, .lib-form select:focus, .lib-form textarea:focus {
  outline:none; border-color: var(--lib-primary);
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 500px) { .form-row-2 { grid-template-columns: 1fr; } }

.radio-group { display:flex; gap:16px; flex-wrap:wrap; margin-top:4px; }
.radio-label { display:flex; align-items:center; gap:6px; font-size:14px; cursor:pointer; }
.radio-label input { width:auto; }

.btn-full { width:100%; margin-top:8px; justify-content:center; }

/* =============================================
   LIBRARY INFO GRID & STEPS
   ============================================= */
.lib-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.lib-info-card {
  background: #f4f8fa;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.lib-info-card > i { font-size: 22px; color: var(--lib-primary); margin-bottom:8px; display:block; }
.lib-info-card h4 { font-size:13px; font-weight:700; margin-bottom:6px; color: var(--lib-dark); }
.lib-info-card p { font-size:12px; color:#666; margin:0; line-height:1.5; }

.lib-info-steps { margin-bottom: 20px; }
.lib-info-steps h4 { font-size:14px; font-weight:700; margin-bottom:14px; color: var(--lib-dark); }
.step-timeline { display:flex; gap:0; counter-reset: step; }
.step-timeline > div {
  flex:1; text-align:center; position:relative; padding: 0 4px;
}
.step-timeline > div + div::before {
  content:''; position:absolute; top:16px; left:-50%; width:100%; height:2px;
  background: #dde3ea; z-index:0;
}
.step-timeline span {
  width:32px; height:32px; border-radius:50%;
  background: var(--lib-primary); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:700; margin:0 auto 8px; position:relative; z-index:1;
}
.step-timeline p { font-size:11px; color:#666; line-height:1.4; }

/* =============================================
   E-RESOURCES DATABASE GRID
   ============================================= */
.eresurs-db-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.eresurs-db-card {
  border-radius: 10px;
  padding: 14px 8px;
  text-align: center;
  background: #f4f8fa;
  border-top: 3px solid var(--dc, var(--lib-primary));
  transition: transform .15s;
}
.eresurs-db-card:hover { transform: translateY(-2px); }
.eresurs-db-card span { display:block; font-size:13px; font-weight:700; color: var(--lib-dark); margin-bottom:3px; }
.eresurs-db-card small { font-size:11px; color:#888; }

.eresurs-access-info { margin-bottom: 18px; }
.eresurs-access-info h4 { font-size:14px; font-weight:700; margin-bottom:10px; color: var(--lib-dark); }
.eresurs-access-info ul { padding-left:20px; margin:0; }
.eresurs-access-info li { font-size:13px; color:#555; line-height:1.6; }

/* =============================================
   ROOM BOOKING WIZARD MODAL
   ============================================= */
.lib-modal-wizard {
  max-width: 560px;
  padding: 28px 32px 24px;
}
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}
.wizard-step {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; cursor: default;
}
.wizard-step .step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: #e8edf2; color: #888;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  transition: background .25s, color .25s;
}
.wizard-step .step-label { font-size: 11px; color: #999; }
.wizard-step.active .step-num { background: var(--lib-primary); color: #fff; }
.wizard-step.active .step-label { color: var(--lib-primary); font-weight:600; }
.wizard-step.done .step-num { background: #d0f0e8; color: #27ae60; }
.wizard-step-line { flex:1; height:2px; background:#e8edf2; min-width:20px; max-width:40px; }

.wizard-panel { display: none; }
.wizard-panel.active { display: block; }

.wizard-panel h3 { font-size:17px; font-weight:700; color: var(--lib-dark); margin-bottom:16px; text-align:left; }

.room-info-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: #f4f8fa; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 20px;
  border-left: 4px solid var(--lib-primary);
}
.ric-icon { font-size: 28px; color: var(--lib-primary); flex-shrink:0; }
.room-info-card h4 { font-size:15px; font-weight:700; margin:0 0 4px; color: var(--lib-dark); }
.room-info-card p { font-size:13px; color:#666; margin:2px 0; }

.date-hint { font-size:12px; color:#888; margin-top:8px; }
.wf-field { margin-bottom:14px; }
.wf-field label { display:block; font-size:13px; font-weight:600; color:#555; margin-bottom:5px; }
.wf-field input,
.wf-field textarea,
.wf-field select {
  width:100%; padding:10px 13px; border:1.5px solid #dde3ea;
  border-radius:8px; font-size:14px; box-sizing:border-box; background:#fff;
  transition: border-color .2s;
}
.wf-field input:focus, .wf-field textarea:focus { outline:none; border-color: var(--lib-primary); }

.wizard-date-display { font-size:14px; color: var(--lib-primary); font-weight:600; margin-bottom:14px; }

.time-slots-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 20px; color: #888; font-size: 14px; justify-content: center;
}
.time-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.time-slot-btn {
  padding: 10px 6px; border-radius: 8px;
  border: 1.5px solid #dde3ea;
  background: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s; text-align: center;
}
.time-slot-btn:hover:not(:disabled) { border-color: var(--lib-primary); background: rgba(26,122,138,.07); color: var(--lib-primary); }
.time-slot-btn.selected { background: var(--lib-primary); color: #fff; border-color: var(--lib-primary); }
.time-slot-btn.booked { background: #f5f5f5; color: #bbb; cursor: not-allowed; border-style: dashed; text-decoration: line-through; }

.duration-select { margin-bottom: 16px; }
.duration-select > label { font-size:13px; font-weight:600; color:#555; margin-bottom:8px; display:block; }
.duration-btns { display: flex; gap: 8px; }
.dur-btn {
  padding: 8px 14px; border-radius: 8px;
  border: 1.5px solid #dde3ea;
  background: #fff; font-size: 13px; font-weight:600; cursor: pointer; transition: all .15s;
}
.dur-btn.active { background: var(--lib-primary); color: #fff; border-color: var(--lib-primary); }
.dur-btn:hover:not(.active) { border-color: var(--lib-primary); color: var(--lib-primary); }

.wizard-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 20px; gap: 10px;
}
.btn-wizard-next, .btn-wizard-back {
  padding: 10px 22px; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer; border: none; transition: all .15s;
  display: flex; align-items: center; gap: 6px;
}
.btn-wizard-next { background: var(--lib-primary); color: #fff; }
.btn-wizard-next:hover:not(:disabled) { background: #0d5c6a; }
.btn-wizard-next:disabled { background: #b0c4cc; cursor: not-allowed; }
.btn-wizard-back { background: #f0f2f5; color: #555; }
.btn-wizard-back:hover { background: #e4e8ed; }

.wizard-confirm-box { text-align: center; }
.confirm-icon { font-size: 48px; color: var(--lib-primary); margin-bottom: 12px; }
.confirm-details {
  background: #f4f8fa; border-radius: 10px;
  padding: 16px 20px; margin: 16px 0; text-align: left;
}
.confirm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #eef2f5;
  font-size: 13px; color: var(--lib-dark);
}
.confirm-row:last-child { border-bottom: none; }
.confirm-row i { color: var(--lib-primary); width: 16px; flex-shrink:0; }

.wizard-success-box { text-align: center; padding: 20px 0; }
.success-anim {
  font-size: 64px; color: #27ae60;
  animation: successPop .5s cubic-bezier(.17,.67,.35,1.3) both;
  margin-bottom: 16px;
}
@keyframes successPop {
  from { transform: scale(0); opacity:0; }
  to   { transform: scale(1); opacity:1; }
}
.wizard-success-box h3 { color: #27ae60; margin-bottom: 8px; }
.wizard-success-box p  { color: #666; font-size: 14px; margin-bottom: 20px; }

/* =============================================
   SCIENTIFIC PUBLICATIONS PAGE
   ============================================= */
/* Hero banner */
.lib-page-hero,
.lib-pub-hero {
  background: linear-gradient(135deg, var(--lib-primary) 0%, #0d5c6a 100%);
  padding: 44px 0 36px;
  color: #fff;
}
.lib-page-hero-content {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.lib-page-hero-icon {
  width: 60px; height: 60px; flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.lib-page-hero h1 { font-size: 28px; font-weight: 800; margin: 0 0 4px; }
.lib-page-hero p  { font-size: 14px; opacity: .85; margin: 0; }

/* Search form inside hero */
.lib-pub-search-form { display: block; margin: 0; }
.lib-pub-search-box {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.lib-pub-search-box i {
  padding: 0 14px;
  color: #aaa;
  font-size: 15px;
  flex-shrink: 0;
}
.lib-pub-search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 13px 10px 13px 0;
  font-size: 14px;
  background: transparent;
  color: var(--lib-dark);
}
.lib-pub-search-box button {
  padding: 13px 22px;
  background: var(--lib-primary);
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.lib-pub-search-box button:hover { background: #0d5c6a; }

/* Layout */
.lib-pub-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  padding: 32px 0 48px;
  align-items: start;
}

/* Sidebar */
.lib-pub-sidebar {
  background: #fff;
  border-radius: var(--lib-radius);
  box-shadow: var(--lib-shadow);
  overflow: hidden;
  position: sticky;
  top: 100px;
}
.lib-pub-filter-block {
  padding: 18px 20px;
  border-bottom: 1px solid #f0f2f5;
}
.lib-pub-filter-block:last-child { border-bottom: none; }
.lib-pub-filter-block h4 {
  font-size: 14px; font-weight: 700; color: var(--lib-dark);
  margin: 0 0 14px; display: flex; align-items: center; gap: 7px;
}
.lib-pub-filter-block h4 i { color: var(--lib-primary); }
.filter-group { margin-bottom: 14px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-label {
  font-size: 11px; font-weight: 700; color: #999;
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 8px; display: block;
}
.filter-tag {
  display: inline-block; padding: 5px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  background: #f0f2f5; color: #555;
  cursor: pointer; margin: 3px; border: 1.5px solid transparent;
  transition: all .15s; text-decoration: none;
}
.filter-tag:hover { border-color: var(--lib-primary); color: var(--lib-primary); }
.filter-tag.active { background: var(--lib-primary); color: #fff; border-color: var(--lib-primary); }

/* Sidebar stats */
.pub-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f5f7fa;
  font-size: 13px;
  color: var(--lib-dark);
}
.pub-stat-row:last-child { border-bottom: none; }
.pub-stat-row strong { color: var(--lib-primary); font-weight: 700; }

/* Top bar */
.lib-pub-top-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.lib-pub-top-bar span { font-size: 14px; color: #666; }
.pub-clear-filters { font-size: 13px; color: #e74c3c; font-weight: 600; text-decoration: none; }
.pub-clear-filters:hover { opacity: .8; }

/* Publication cards grid */
.lib-pub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.lib-pub-card {
  background: #fff;
  border-radius: var(--lib-radius);
  box-shadow: var(--lib-shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.lib-pub-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.pub-card-header {
  padding: 14px 16px 10px;
  border-bottom: 3px solid var(--lib-primary);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}
.pub-card-body {
  padding: 14px 16px;
  flex: 1;
}
.pub-badge {
  display: inline-block; padding: 3px 9px; border-radius: 12px;
  font-size: 11px; font-weight: 700;
  background: rgba(26,122,138,.12); color: var(--lib-primary);
}
.pub-year { font-size: 12px; color: #888; font-weight: 700; }
.pub-title { font-size: 13px; font-weight: 700; color: var(--lib-dark); margin: 0 0 6px; line-height:1.45; }
.pub-authors { font-size: 12px; color: var(--lib-primary); margin-bottom: 4px; font-style: italic; }
.pub-journal { font-size: 11px; color: #888; margin-bottom: 8px; }
.pub-abstract {
  font-size: 12px; color: #666; line-height: 1.5;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.pub-card-footer {
  padding: 10px 16px;
  border-top: 1px solid #f0f2f5;
  display: flex; gap: 6px; flex-wrap: wrap;
  align-items: center;
}
.pub-link-btn {
  padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
  text-decoration: none; border: none; cursor: pointer; transition: background .15s;
  display: inline-flex; align-items: center; gap: 4px;
}
.pub-link-btn.doi-btn  { background: rgba(26,122,138,.1);  color: var(--lib-primary); }
.pub-link-btn.pdf-btn  { background: rgba(231,76,60,.1);   color: #e74c3c; }
.pub-link-btn.more-btn { background: #f0f2f5; color: #555; }
.pub-link-btn:hover { opacity: .8; }
.pub-abstract-toggle, .pub-detail-btn {
  padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
  background: #f0f2f5; color: #555; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; margin-left: auto;
}
.pub-abstract-toggle:hover, .pub-detail-btn:hover { background: #e4e8ed; }

/* Clickable card body */
.pub-card-clickable { cursor: pointer; transition: background .15s; }
.pub-card-clickable:hover { background: #f7f9fb; }

.lib-pub-empty { text-align: center; padding: 48px; color: #888; }
.lib-pub-empty i { font-size: 48px; margin-bottom: 12px; opacity: .4; display: block; }
.lib-pub-empty h3 { font-size: 18px; margin-bottom: 8px; }
.lib-pub-empty p  { margin-bottom: 20px; }

/* Pagination */
.lib-pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.page-btn {
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 8px; border: 1.5px solid #dde3ea;
  background: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; color: #555; transition: all .15s;
}
.page-btn:hover { border-color: var(--lib-primary); color: var(--lib-primary); }
.page-btn.active { background: var(--lib-primary); color: #fff; border-color: var(--lib-primary); }

/* Abstract modal */
.pub-modal-inner { padding: 8px 0; }
.pub-modal-inner h3 { font-size: 17px; font-weight: 700; color: var(--lib-dark); margin-bottom: 8px; text-align: left; }

/* Publication detail modal */
.pub-detail-dialog { max-width: 640px; }
.pub-detail-title {
  font-size: 19px; font-weight: 800; line-height: 1.45;
  margin: 10px 0 8px; color: var(--lib-dark);
}
.pub-detail-authors {
  font-size: 13px; color: var(--lib-primary); font-style: italic; margin-bottom: 6px;
}
.pub-detail-meta {
  font-size: 12px; color: #999; margin-bottom: 14px;
}
.pub-detail-abstract {
  background: #f4f8fa; border-radius: 10px; padding: 16px; margin: 14px 0;
}
.pub-detail-abstract h4 {
  font-size: 12px; font-weight: 700; margin-bottom: 8px;
  color: var(--lib-dark); text-transform: uppercase; letter-spacing: .04em;
}
.pub-detail-abstract p {
  font-size: 14px; line-height: 1.8; color: #444; margin: 0;
}
.pub-detail-no-abstract { font-size: 13px; color: #aaa; font-style: italic; margin: 14px 0; }
.pub-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.pub-detail-actions .pub-link-btn { font-size: 12px; padding: 7px 14px; }

@media (max-width: 900px) {
  .lib-pub-layout { grid-template-columns: 1fr; }
  .lib-pub-sidebar { position: static; }
  .lib-pub-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 560px) {
  .lib-pub-grid { grid-template-columns: 1fr; }
  .eresurs-db-grid { grid-template-columns: repeat(2,1fr); }
  .lib-modal-wizard { padding: 20px 16px 16px; }
  .time-slots-grid { grid-template-columns: repeat(3,1fr); }
}
