:root {
    --bg-main: #f0f4f8;
    --bg-card: rgba(255, 255, 255, 0.88);
    --bg-card-hover: #ffffff;
    --border-color: rgba(226, 232, 240, 0.85);
    --border-glow: rgba(2, 132, 199, 0.45);
    
    /* Vibrant Palettes */
    --primary: #0284c7;
    --primary-gradient: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #4f46e5 100%);
    --accent-gold: #f59e0b;
    --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --emerald-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --rose-gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    --violet-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --cyan-gradient: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);

    --text-title: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    
    --badge-avail-bg: #ecfdf5;
    --badge-avail-text: #059669;
    --badge-avail-border: #a7f3d0;

    --badge-unavail-bg: #fef2f2;
    --badge-unavail-text: #dc2626;
    --badge-unavail-border: #fecaca;

    /* Multi-layered 3D Shadows */
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
    --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --shadow-hover: 0 20px 35px -10px rgba(2, 132, 199, 0.2), 0 10px 15px -5px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    --shadow-glow-blue: 0 8px 20px -4px rgba(2, 132, 199, 0.35);
    --shadow-glow-gold: 0 8px 20px -4px rgba(245, 158, 11, 0.35);

    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-width: 768px;
}

body {
    min-width: 768px;
    font-family: 'Prompt', sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(2, 132, 199, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(245, 158, 11, 0.1) 0px, transparent 45%),
        radial-gradient(at 50% 50%, rgba(99, 102, 241, 0.08) 0px, transparent 60%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(236, 72, 153, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-body);
    min-height: 100vh;
    overflow-x: auto;
    line-height: 1.6;
}

/* ==========================================
   Header & Navbar (Floating Glassmorphism with Grid)
   ========================================== */
.site-header {
    position: sticky;
    top: 12px;
    z-index: 100;
    margin: 0 auto;
    max-width: 1260px;
    background-color: #0b1e3b;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.09) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.09) 1px, transparent 1px),
        linear-gradient(135deg, rgba(9, 26, 54, 0.96) 0%, rgba(15, 39, 74, 0.94) 45%, rgba(30, 58, 138, 0.94) 100%);
    background-size: 10px 10px, 10px 10px, 100% 100%;
    background-repeat: repeat, repeat, no-repeat;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.6rem;
    box-shadow: 
        0 18px 45px -8px rgba(9, 26, 54, 0.45),
        0 4px 16px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.28);
    transition: all 0.3s ease;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
}

.brand-emblem {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--primary-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-glow-blue);
    flex-shrink: 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.brand:hover .brand-emblem {
    transform: rotate(-5deg) scale(1.06);
    box-shadow: 0 12px 25px -2px rgba(37, 99, 235, 0.45);
}

.brand-logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
}

.brand:hover .brand-logo-img {
    transform: rotate(-4deg) scale(1.08);
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
}

.brand-text h1 {
    font-size: 1.18rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.015em;
    line-height: 1.2;
}

.brand-text p {
    font-size: 0.72rem;
    color: #38bdf8;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    background: rgba(255, 255, 255, 0.12);
    padding: 0.28rem 0.4rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
}

.nav-link {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.95rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.nav-link.active {
    color: #0284c7;
    background: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.nav-link:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-login {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
    color: #ffffff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.btn-login:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.65);
    filter: brightness(1.12);
}

/* ==========================================
   Hero Section & Search Box
   ========================================== */
.hero-section {
    padding: 2.25rem 1.5rem 3.5rem;
    text-align: center;
    position: relative;
    max-width: 960px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    color: #b45309;
    padding: 0.45rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px -2px rgba(245, 158, 11, 0.2);
}

.hero-title {
    font-size: 2.85rem;
    font-weight: 900;
    color: var(--text-title);
    line-height: 1.25;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.hero-title span {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 900px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
    white-space: nowrap;
}

/* Floating Search Box with Glowing Depth */
.search-wrapper {
    background: #ffffff;
    border: 2px solid transparent;
    background-image: linear-gradient(#ffffff, #ffffff), linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #f59e0b 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border-radius: 20px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 20px 40px -10px rgba(2, 132, 199, 0.15), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.search-wrapper:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -10px rgba(2, 132, 199, 0.25), 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.search-icon {
    font-size: 1.4rem;
    margin-left: 0.85rem;
    color: var(--primary);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 1.1rem;
    color: var(--text-title);
    font-weight: 500;
}

.search-input::placeholder {
    color: #94a3b8;
}

.shortcut-kbd {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #64748b;
    font-family: monospace;
    font-size: 0.78rem;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.btn-search {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    padding: 0.85rem 1.85rem;
    border-radius: 14px;
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-glow-blue);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px -4px rgba(2, 132, 199, 0.45);
}

/* ==========================================
   Category Dropdown Selector (ปุ่มเลือกหมวดหมู่แบบกะทัดรัด สวยงาม สบายตา)
   ========================================== */
.category-select-container {
    position: relative;
    display: inline-flex;
    justify-content: center;
    margin: 1rem auto 0;
    z-index: 20;
}

.category-select-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.42rem 1rem 0.42rem 0.7rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1.5px solid #cbd5e1;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 2px 8px -1px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    color: #334155;
    user-select: none;
}

.category-select-btn:hover {
    border-color: #0284c7;
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -3px rgba(2, 132, 199, 0.16);
}

.category-select-btn:active {
    transform: translateY(0);
}

.cat-pill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 50%;
    font-size: 0.98rem;
    flex-shrink: 0;
    overflow: hidden;
}

.cat-pill-icon svg {
    width: 16px;
    height: 16px;
    display: block;
    color: #0284c7;
}

.cat-pill-text {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.cat-pill-text strong {
    color: #0369a1;
    font-weight: 700;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-pill-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: #f0f9ff;
    color: #0284c7;
    font-size: 0.72rem;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

/* Popover Menu ที่กดแล้วเด้งมาให้เลือก */
.category-dropdown-popover {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    width: 320px;
    max-width: 90vw;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    border: 1.5px solid #cbd5e1;
    border-radius: 16px;
    box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(2, 132, 199, 0.06);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    z-index: 30;
}

.category-dropdown-popover.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.cat-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
}

.btn-close-cat-menu {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    transition: all 0.15s;
    line-height: 1;
}

.btn-close-cat-menu:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.cat-popover-list {
    max-height: 290px;
    overflow-y: auto;
    padding: 0.4rem;
}

.cat-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.52rem 0.85rem;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    text-align: left;
    transition: all 0.15s ease;
}

.cat-menu-item:hover {
    background: #f0f9ff;
    color: #0284c7;
    transform: translateX(3px);
}

.cat-menu-item.active {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}

.cat-menu-item.active:hover {
    color: #ffffff;
    transform: none;
}

.item-icon {
    font-size: 1.05rem;
    flex-shrink: 0;
}

.item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-active-check {
    font-size: 0.88rem;
    font-weight: bold;
    display: none;
}

.cat-menu-item.active .item-active-check {
    display: inline-block;
}

/* ==========================================
   Live Counters & Stats (Dimensional Glass)
   ========================================== */
.stats-section {
    max-width: 1240px;
    margin: 2rem auto 0.75rem;
    padding: 0 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-card);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0.9;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.stat-icon.green {
    background: linear-gradient(135deg, #ecfdf5 0%, #a7f3d0 100%);
    color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.stat-icon.gold {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #f3e8ff 0%, #ddd6fe 100%);
    color: #7c3aed;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

.stat-info h3 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-title);
    line-height: 1.1;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.stat-info p {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* ==========================================
   Section Headers
   ========================================== */
.section-container {
    max-width: 1240px;
    margin: 0 auto 4.5rem;
    padding: 0 1.5rem;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-title);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.98rem;
    margin-top: 0.3rem;
}

.badge-counter {
    font-size: 0.9rem;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: var(--primary);
    padding: 0.35rem 0.95rem;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid #7dd3fc;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}

.head-right-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.btn-reshuffle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.btn-reshuffle:hover {
    background: #f0fdf4;
    border-color: #10b981;
    color: #047857;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px -2px rgba(16, 185, 129, 0.2);
}

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

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================
   Book Cards Grid (3D Lift, Borders & Sheen)
   ========================================== */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.75rem;
}

.book-card {
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Card Hover Elevation (Universal for all Category Palettes) */
.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 35px -8px rgba(15, 23, 42, 0.16), 0 6px 14px -2px rgba(15, 23, 42, 0.08) !important;
}

.book-body {
    flex: 1;
    margin-bottom: 1.25rem;
}

.book-call-no {
    font-family: monospace;
    font-size: 0.82rem;
    padding: 0.25rem 0.65rem;
    border-radius: 8px;
    display: inline-block;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.book-main-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text-title);
    margin-bottom: 0.5rem;
    line-height: 1.45;
}

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

.book-shelf {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: #0f172a;
    margin-top: 0.85rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border: 1px solid #e2e8f0;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.book-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border-color);
}

/* Status Indicator Pill */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.35rem 0.8rem;
    border-radius: 9999px;
}

.status-pill.avail {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #059669;
    border: 1px solid #a7f3d0;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
}

.status-pill.unavail {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    border: 1px solid #fecaca;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    box-shadow: 0 0 6px currentColor;
}

.btn-card-action {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #cbd5e1;
    color: var(--primary);
    padding: 0.5rem 0.95rem;
    border-radius: 10px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.book-card:hover .btn-card-action {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--shadow-glow-blue);
    transform: translateY(-1px);
}

/* ==========================================
   Student Borrow Status Checker (Glass Layer)
   ========================================== */
.checker-card {
    background: linear-gradient(145deg, #f0f7ff 0%, #e0effe 50%, #ede9fe 100%);
    backdrop-filter: blur(16px);
    border: 1.5px solid #bfdbfe;
    border-radius: 22px;
    padding: 2.75rem;
    box-shadow: 0 20px 45px -10px rgba(2, 132, 199, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    position: relative;
    overflow: hidden;
}

.checker-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    bottom: 0;
    background: var(--primary-gradient);
}

.checker-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2.75rem;
    align-items: center;
}

.checker-input-box {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.checker-input {
    flex: 1;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    color: var(--text-title);
    padding: 0.85rem 1.15rem;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.checker-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.18);
}

.quick-id-tags {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.quick-id-link {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    margin-left: 0.35rem;
    font-weight: 600;
}

/* Result box */
.checker-result {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1.75rem;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.03);
}

.borrow-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid var(--primary);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s;
}

.borrow-item:hover {
    transform: translateX(4px);
}

.borrow-item.overdue {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    border-color: #fecaca;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.08);
}

/* ==========================================
   Modern Dialog Modal (Luxury Library Card)
   ========================================== */
dialog {
    border: none;
    border-radius: 24px;
    background: #ffffff;
    color: var(--text-title);
    padding: 0;
    max-width: 780px;
    width: 94%;
    margin: auto;
    box-shadow: 0 25px 70px -15px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(226, 232, 240, 0.9);
    position: relative;
    overflow: hidden;
}

dialog[open] {
    animation: modalPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

dialog::backdrop {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
}

.modal-top-accent {
    height: 6px;
    width: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8, #818cf8, #ec4899);
}

.modal-inner {
    padding: 1.85rem 2.25rem 1.85rem;
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-dept-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.modal-dept-badge {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1.5px solid #bfdbfe;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.modal-callno-badge {
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0369a1;
    background: #f0f9ff;
    border: 1.5px solid #bae6fd;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.modal-close-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #64748b;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    transform: rotate(90deg) scale(1.05);
}

/* Modal Content Grid (3D Book Visual + Info Column) */
.modal-content-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 1.75rem;
}

@media (max-width: 680px) {
    .modal-content-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .modal-book-visual-col {
        display: none;
    }
    .modal-inner {
        padding: 1.25rem 1.25rem;
    }
}

.modal-book-visual-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Realistic 3D Technical Textbook Mockup */
.book-cover-3d {
    width: 180px;
    height: 250px;
    position: relative;
    border-radius: 4px 14px 14px 4px;
    box-shadow: -5px 0 0 -1px #0f172a, 12px 16px 28px -4px rgba(15, 23, 42, 0.25), inset -2px 0 8px rgba(0, 0, 0, 0.08);
    background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
    cursor: pointer;
}

.book-cover-3d:hover {
    transform: translateY(-5px) rotateY(-4deg) rotateZ(-1deg);
    box-shadow: -6px 0 0 -1px #0f172a, 16px 22px 35px -4px rgba(15, 23, 42, 0.32);
}

.book-cover-spine {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 14px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0%, rgba(255, 255, 255, 0.25) 50%, rgba(0, 0, 0, 0.12) 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px 0 0 4px;
    z-index: 2;
}

.book-cover-front {
    padding: 1.15rem 1rem 1rem 1.45rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.book-cover-dept-strip {
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    border-radius: 2px;
    margin-bottom: 0.6rem;
}

.book-cover-icon {
    font-size: 2.4rem;
    text-align: center;
    margin-bottom: 0.35rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
}

.book-cover-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.book-cover-author {
    font-size: 0.72rem;
    color: #475569;
    text-align: center;
    margin-top: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-cover-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(0, 0, 0, 0.12);
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
}

.modal-status-wrap {
    margin-top: 1.15rem;
    text-align: center;
    width: 100%;
}

.modal-copies-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.modal-book-info-col {
    display: flex;
    flex-direction: column;
}

.modal-book-main-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
}

.modal-book-subtitle {
    font-size: 0.84rem;
    color: #64748b;
    margin-bottom: 1.15rem;
}

/* Metadata Cards Grid */
.modal-meta-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
}

.modal-meta-card {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 0.95rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.meta-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.meta-card-val {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    word-break: break-word;
}

.modal-code-badge {
    font-family: monospace;
    font-size: 0.88rem;
    font-weight: 800;
    color: #0284c7;
    background: #e0f2fe;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #bae6fd;
}

/* Hero Shelf Location Card (Physical Library Highlight) */
.modal-shelf-card {
    background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 50%, #f0fdf4 100%);
    border: 1.5px solid #a5f3fc;
    border-radius: 16px;
    padding: 1.15rem 1.35rem;
    box-shadow: 0 6px 18px -3px rgba(6, 182, 212, 0.15);
    position: relative;
    overflow: hidden;
}

.shelf-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.shelf-card-icon-bubble {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #ffffff;
    color: #0891b2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 3px 8px rgba(6, 182, 212, 0.2);
    flex-shrink: 0;
}

.shelf-card-heading {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0e7490;
}

.shelf-card-subheading {
    font-size: 0.78rem;
    color: #64748b;
}

.shelf-card-location-box {
    background: #ffffff;
    border: 1.5px solid #67e8f9;
    border-radius: 12px;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.08);
    margin-bottom: 0.65rem;
}

.shelf-icon-pin {
    font-size: 1.1rem;
}

.shelf-location-text {
    font-size: 1.12rem;
    font-weight: 800;
    color: #0369a1;
    letter-spacing: -0.01em;
}

.shelf-card-tip {
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.45;
    display: flex;
    gap: 0.4rem;
}

/* Modal Footer Actions */
.modal-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.15rem;
    border-top: 1px solid #e2e8f0;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-borrow-rule-hint {
    font-size: 0.82rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.modal-actions-btns {
    display: flex;
    gap: 0.65rem;
}

.btn-copy-code {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1.5px solid #7dd3fc;
    color: #0284c7;
    padding: 0.6rem 1.15rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.1);
}

.btn-copy-code:hover {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.3);
    transform: translateY(-1px);
}

.btn-close-modal-main {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #334155;
    padding: 0.6rem 1.25rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.btn-close-modal-main:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Toast Notification */
.toast-notice {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid #38bdf8;
    color: #ffffff;
    padding: 1rem 1.6rem;
    border-radius: 14px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 20px rgba(56, 189, 248, 0.3);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.toast-notice.show {
    transform: translateY(0);
    opacity: 1;
}

/* ==========================================
   Footer - Sleek Compact Bar with Interactive Flair
   ========================================== */
.site-footer {
    position: relative;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0.95rem 1.5rem;
    margin-top: 2.25rem;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.03);
    z-index: 20;
}

/* เส้นสายรุ้งแอนิเมชันด้านบนสุดของ Footer */
.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2.5px;
    background: linear-gradient(90deg, #1e3a8a, #0284c7, #10b981, #6366f1, #1e3a8a);
    background-size: 250% 100%;
    animation: footerGradientSlide 8s linear infinite;
}

@keyframes footerGradientSlide {
    0% { background-position: 0% 50%; }
    100% { background-position: 250% 50%; }
}

.footer-compact-container {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* ฝั่งซ้าย: ข้อมูลสถาบัน + ที่อยู่ + เวลาทำการ (ชิดซ้ายเสมอ) */
.footer-info-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 0.2rem;
    min-width: 0;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-title);
    letter-spacing: -0.2px;
    white-space: nowrap;
}

.footer-brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    flex-shrink: 0;
}

.footer-sub-details {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
}

.footer-separator {
    color: #cbd5e1;
    font-size: 0.75rem;
    user-select: none;
}

.footer-location {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.footer-location:hover {
    color: #0284c7;
}

.footer-hours-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.55rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    font-size: 0.74rem;
    color: #166534;
    font-weight: 600;
    letter-spacing: 0.1px;
    white-space: nowrap;
}

.footer-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: footerDotPulse 2s infinite;
    flex-shrink: 0;
}

@keyframes footerDotPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ฝั่งขวา: ป้ายเครดิตผู้พัฒนาพิเศษ + ปุ่มเลื่อนขึ้นบนสุด (ชิดขวาเสมอ) */
.footer-action-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ป้ายผู้พัฒนาแบบ Glass Pill พร้อมแอนิเมชัน */
.footer-dev-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    user-select: none;
    white-space: nowrap;
}

.footer-dev-pill:hover {
    background: linear-gradient(135deg, #09172e 0%, #172a4c 100%);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.25);
    transform: translateY(-2px);
}

.footer-dev-icon {
    display: inline-block;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.footer-dev-pill:hover .footer-dev-icon {
    animation: pawWiggle 0.4s infinite alternate;
}

@keyframes pawWiggle {
    0% { transform: rotate(-14deg) scale(1.15); }
    100% { transform: rotate(14deg) scale(1.15); }
}

.footer-dev-name {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.footer-dev-pill:hover .footer-dev-name {
    background: linear-gradient(135deg, #38bdf8 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ปุ่มเลื่อนกลับขึ้นบนสุด (Scroll to Top) */
.btn-back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    white-space: nowrap;
}

.btn-back-to-top:hover {
    background: #1e3a8a;
    border-color: #1e3a8a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
    transform: translateY(-2px);
}

.btn-back-to-top:hover svg circle {
    fill: #2563eb;
}

.btn-back-to-top:hover svg path {
    stroke: #ffffff;
}

/* ปรับแต่งสำหรับหน้าจอเล็กและแท็บเล็ต (เช่น iPad 768px): แบ่งชิดซ้ายและชิดขวา ไม่กินความสูง */
@media (max-width: 991px) {
    .site-footer {
        padding: 0.75rem 1.15rem;
        margin-top: 1.5rem;
    }
    .footer-compact-container {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }
    .footer-info-group {
        align-items: flex-start;
        text-align: left;
    }
    .footer-action-group {
        justify-content: flex-end;
    }
}

/* สำหรับมือถือจอเล็ก (< 640px) ให้ข้อมูลแบ่ง 2 บรรทัดกะทัดรัด */
@media (max-width: 640px) {
    .footer-compact-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .footer-info-group {
        width: 100%;
    }
    .footer-action-group {
        width: 100%;
        justify-content: space-between;
        padding-top: 0.35rem;
        border-top: 1px dashed #e2e8f0;
    }
}

@media (max-width: 768px) {
    .site-header { top: 0; border-radius: 0; }
    .nav-menu { display: none; }
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { white-space: normal; font-size: 1rem; }
    .checker-grid { grid-template-columns: 1fr; }
}

/* ========================================================
   Streamline Ultimate Colors Icon Styles
   ======================================================== */
.sl-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
}

.brand:hover .sl-icon,
.btn-login:hover .sl-icon,
.btn-search:hover .sl-icon,
.btn-reshuffle:hover .sl-icon,
.stat-card:hover .sl-icon,
.cat-menu-item:hover .sl-icon,
.nav-link:hover .sl-icon {
    transform: scale(1.12);
}

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

.sl-icon-spin {
    animation: slSpin 1s linear infinite;
}

@keyframes slSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Public Books Modern Pagination Component
   ========================================================================== */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.pagination-info {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pagination-info strong {
    color: var(--text-title);
    font-weight: 700;
}

.pagination-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.85rem;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.pagination-btn:hover:not(:disabled):not(.active) {
    background: #f8fafc;
    border-color: #94a3b8;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px -3px rgba(2, 132, 199, 0.18);
}

.pagination-btn:active:not(:disabled):not(.active) {
    transform: translateY(0);
}

.pagination-btn.active {
    background: var(--primary-gradient);
    color: #ffffff !important;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 4px 14px -2px rgba(2, 132, 199, 0.45);
    cursor: default;
}

.pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
    box-shadow: none;
    transform: none;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 40px;
    padding: 0 0.5rem;
    border-radius: 12px;
    border: 1.5px dashed #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.pagination-ellipsis:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.12);
}

.no-result-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

@media (max-width: 640px) {
    .pagination-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        text-align: center;
        padding: 1rem;
    }
    .pagination-info {
        justify-content: center;
    }
    .pagination-controls {
        justify-content: center;
    }
    .pagination-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 0.65rem;
        font-size: 0.84rem;
    }
}

