/* ==========================================================================
   SIKKHALAY STUDENT PORTAL — DIGITAL LIBRARY & NCTB REPOSITORY STYLES
   Modern, Eye-Catching, Responsive Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. MASTER BANNER SECTION (100% Width, 125px to 150px Height)
   Eye-Catching Gradient: Tomato (#FF6347), Golden (#F59E0B), Violet (#7C3AED)
   -------------------------------------------------------------------------- */
.library-hero-banner {
    width: 100%;
    min-height: 125px;
    height: 140px;
    max-height: 150px;
    position: relative;
    border-radius: var(--radius-lg, 16px);
    margin-bottom: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 28px -6px rgba(124, 58, 237, 0.28), 0 4px 12px rgba(255, 99, 71, 0.18);
    background: linear-gradient(135deg, #4C1D95 0%, #7C3AED 24%, #C026D3 48%, #E11D48 68%, #FF5722 84%, #F59E0B 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.library-hero-banner:hover {
    box-shadow: 0 14px 34px -4px rgba(124, 58, 237, 0.35), 0 6px 16px rgba(245, 158, 11, 0.28);
}

/* Graphic Banner Image Overlay */
.library-banner-bg-graphic {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center right;
    pointer-events: none;
    z-index: 1;
    opacity: 0.95;
    mix-blend-mode: hard-light;
}

/* Ambient Radial Light Highlights (Tomato, Violet, Golden) */
.library-hero-banner::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 20%;
    width: 320px;
    height: 220px;
    background: radial-gradient(circle, rgba(255, 99, 71, 0.65) 0%, transparent 70%);
    pointer-events: none;
    z-index: 2;
    filter: blur(25px);
}

.library-hero-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: 15%;
    width: 300px;
    height: 180px;
    background: radial-gradient(circle, rgba(254, 240, 138, 0.7) 0%, rgba(245, 158, 11, 0.4) 50%, transparent 75%);
    pointer-events: none;
    z-index: 2;
    filter: blur(20px);
}

/* Banner Content Wrapper */
.library-banner-content {
    position: relative;
    z-index: 5;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    gap: 16px;
    color: #FFFFFF;
}

.library-banner-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    max-width: 68%;
    min-width: 0;
}

/* Verified Archive Badge */
.library-banner-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #FEF08A;
    width: fit-content;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.library-banner-pill i {
    color: #FDE047;
    animation: rotateSparkle 3s infinite linear;
}

@keyframes rotateSparkle {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.18) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

.library-banner-title {
    font-size: clamp(17px, 2.2vw + 6px, 23px);
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    color: #FFFFFF;
    text-shadow: 0 2px 8px rgba(15, 23, 42, 0.4);
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.library-banner-title span {
    background: linear-gradient(135deg, #FEF08A 0%, #FFD166 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.library-banner-desc {
    font-size: clamp(11.5px, 1.2vw + 3px, 13px);
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.92);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Banner Stats Right Group */
.library-banner-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.library-stat-pill {
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-md, 12px);
    padding: 8px 14px;
    text-align: center;
    min-width: 90px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.library-stat-pill:hover {
    transform: translateY(-2px);
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(254, 240, 138, 0.5);
}

.library-stat-num {
    font-size: 17px;
    font-weight: 800;
    color: #FEF08A;
    line-height: 1.1;
    display: block;
}

.library-stat-label {
    font-size: 10.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: block;
    margin-top: 2px;
}

/* --------------------------------------------------------------------------
   2. SIMPLE AND SMART FILTER SECTION
   Clean, intuitive controls for instant dynamic filtering
   -------------------------------------------------------------------------- */
.library-filter-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 16px);
    padding: 14px 18px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.library-filter-panel:hover {
    border-color: var(--border-hover);
}

/* Top Row: Search Input + Sort Dropdown + Quick Saved Toggle */
.filter-search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.library-search-box {
    position: relative;
    flex: 1 1 320px;
    min-width: 240px;
}

.library-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.library-search-input {
    width: 100%;
    height: 42px;
    padding: 0 42px 0 40px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
}

.library-search-input:focus {
    border-color: var(--brand-primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3.5px var(--brand-glow);
}

.library-search-input:focus + .library-search-icon {
    color: var(--brand-primary);
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
}

.search-clear-btn:hover {
    color: var(--text-main);
    background: var(--bg-subtle);
}

/* Secondary Filter Selects */
.filter-select-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.library-filter-select {
    height: 42px;
    padding: 0 32px 0 14px;
    border-radius: var(--radius-sm, 10px);
    border: 1.5px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    transition: all 0.2s ease;
}

.library-filter-select:hover {
    border-color: var(--border-hover);
    background-color: var(--bg-surface);
}

.library-filter-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

/* Saved Books Quick Filter Toggle Button */
.btn-saved-filter {
    height: 42px;
    padding: 0 16px;
    border-radius: var(--radius-sm, 10px);
    border: 1.5px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-saved-filter i {
    color: #E11D48;
    transition: transform 0.2s ease;
}

.btn-saved-filter:hover {
    background: #FFF1F2;
    border-color: #FECDD3;
    color: #E11D48;
}

.btn-saved-filter.active {
    background: #E11D48;
    border-color: #E11D48;
    color: #FFFFFF;
}

.btn-saved-filter.active i {
    color: #FFFFFF;
    transform: scale(1.15);
}

/* Bottom Row: Smart Class & Stage Chips */
.filter-chips-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-chips-row::-webkit-scrollbar {
    display: none;
}

.filter-chip-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    margin-right: 4px;
}

.filter-chip {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-chip:hover {
    background: var(--bg-active);
    color: var(--brand-primary);
    border-color: rgba(67, 56, 202, 0.3);
    transform: translateY(-1px);
}

.filter-chip.active {
    background: var(--brand-primary);
    color: #FFFFFF;
    border-color: var(--brand-primary);
    box-shadow: 0 4px 12px -2px rgba(67, 56, 202, 0.35);
    font-weight: 700;
}

.filter-chip .chip-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    font-size: 10.5px;
}

.filter-chip.active .chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

/* Active Filter Summary Bar */
.filter-active-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 6px;
    border-top: 1px dashed var(--border-color);
}

.active-summary-text {
    font-weight: 600;
    color: var(--text-secondary);
}

.btn-reset-filters {
    background: transparent;
    border: none;
    color: var(--brand-primary);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    transition: all 0.15s ease;
}

.btn-reset-filters:hover {
    background: var(--brand-light);
    color: var(--brand-primary-hover);
}

/* --------------------------------------------------------------------------
   3. SECTION HEADINGS & BADGES
   -------------------------------------------------------------------------- */
.library-section-title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.library-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm, 10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.badge-nctb-featured {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #D97706;
    border: 1px solid rgba(217, 119, 6, 0.25);
}

.badge-all-books {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    color: var(--brand-primary);
    border: 1px solid rgba(67, 56, 202, 0.2);
}

.library-section-heading h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.25;
    margin: 0;
}

.library-section-heading p {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

.nctb-certified-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #059669;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

/* --------------------------------------------------------------------------
   4. FEATURED NCTB BOOKS GRID (2 ROW, STRICTLY NO SCROLLBAR)
   Advanced, Eye-Catching, Modern, Smarter & Premium Design
   -------------------------------------------------------------------------- */
.nctb-featured-container {
    margin-bottom: 34px;
    width: 100%;
    overflow: visible; /* NO INNER SCROLLBAR */
}

/* Strict 2-Row CSS Grid — Responsive Columns, No Internal Scrollbars */
.nctb-featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 18px;
    width: 100%;
    overflow: visible; /* NO scrollbars */
}

/* Responsive Grid Adapting to Maintain 2 Rows Without Overflow Scrollbars */
@media (max-width: 1199px) and (min-width: 900px) {
    .nctb-featured-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
}

@media (max-width: 899px) and (min-width: 640px) {
    .nctb-featured-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    /* Hide items beyond 6 to maintain 2 exact rows cleanly */
    .nctb-featured-grid > .nctb-book-card:nth-child(n+7) {
        display: none;
    }
}

@media (max-width: 639px) {
    .nctb-featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    /* On mobile, show 4 items = exactly 2 rows x 2 cols, no inner scroll */
    .nctb-featured-grid > .nctb-book-card:nth-child(n+5) {
        display: none;
    }
}

/* ==========================================================================
   5. PREMIUM 3D NCTB BOOK CARD COMPONENT
   ========================================================================== */
.nctb-book-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    isolation: isolate;
}

.nctb-book-card:hover {
    transform: translateY(-6px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 16px 36px -6px rgba(67, 56, 202, 0.16), 0 4px 12px rgba(15, 23, 42, 0.05);
}

/* Realistic 3D Book Cover Presentation Area */
.book-cover-stage {
    position: relative;
    width: 100%;
    height: 180px;
    background: radial-gradient(circle at 50% 30%, #F8FAFC 0%, #E2E8F0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 16px 12px 10px 12px;
}

/* The 3D Book Object */
.book-3d-wrapper {
    position: relative;
    width: 105px;
    height: 148px;
    perspective: 800px;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.nctb-book-card:hover .book-3d-wrapper {
    transform: rotateY(-14deg) scale(1.05);
}

.book-cover-surface {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 3px 8px 8px 3px;
    box-shadow: 4px 6px 18px rgba(15, 23, 42, 0.28), 1px 1px 3px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px 7px 7px 11px;
    color: #FFFFFF;
    overflow: hidden;
    position: relative;
}

/* Left Book Spine 3D Highlight & Shadow */
.book-cover-surface::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.38) 0%, rgba(255, 255, 255, 0.22) 50%, rgba(0, 0, 0, 0.18) 100%);
    z-index: 5;
    border-radius: 3px 0 0 3px;
}

/* Book Sheen Reflection Sweep on Hover */
.book-cover-surface::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 200%;
    height: 200%;
    background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.28) 50%, transparent 60%);
    transform: rotate(25deg);
    transition: transform 0.6s ease;
    pointer-events: none;
    z-index: 6;
}

.nctb-book-card:hover .book-cover-surface::after {
    transform: rotate(25deg) translate(30%, 30%);
}

/* Realistic 3D Paper Page Edges (Right and Bottom) */
.book-paper-edge-right {
    position: absolute;
    right: -4px;
    top: 4px;
    bottom: 4px;
    width: 5px;
    background: repeating-linear-gradient(to right, #FAF8F5, #FAF8F5 1px, #E2DED9 1px, #E2DED9 2px);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.15);
    border-radius: 0 2px 2px 0;
    z-index: 1;
}

/* Official NCTB Holographic Foil Seal */
.nctb-gold-seal {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, #FEF08A 0%, #F59E0B 75%, #B45309 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #451A03;
    z-index: 4;
    border: 1px solid #FFFBEB;
}

/* Subject Specific Gradients */
.theme-physics {
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 55%, #0284C7 100%);
}
.theme-higher-math {
    background: linear-gradient(135deg, #2E1065 0%, #5B21B6 50%, #7C3AED 100%);
}
.theme-chemistry {
    background: linear-gradient(135deg, #064E3B 0%, #047857 55%, #059669 100%);
}
.theme-biology {
    background: linear-gradient(135deg, #14532D 0%, #15803D 55%, #22C55E 100%);
}
.theme-bangla {
    background: linear-gradient(135deg, #881337 0%, #BE123C 55%, #E11D48 100%);
}
.theme-english {
    background: linear-gradient(135deg, #1E1B4B 0%, #3730A3 55%, #4F46E5 100%);
}
.theme-ict {
    background: linear-gradient(135deg, #020617 0%, #1E293B 50%, #4338CA 100%);
}
.theme-math {
    background: linear-gradient(135deg, #78350F 0%, #B45309 50%, #D97706 100%);
}
.theme-accounting {
    background: linear-gradient(135deg, #1F2937 0%, #374151 55%, #6B7280 100%);
}

/* Cover Typography & Graphic */
.book-cover-top {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.book-cover-edition {
    font-size: 7.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #FEF08A;
}

.book-cover-class {
    font-size: 8px;
    font-weight: 700;
    opacity: 0.9;
}

.book-cover-symbol {
    align-self: center;
    font-size: 32px;
    margin: 4px 0;
    opacity: 0.92;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.book-cover-bot {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    padding-top: 3px;
}

.book-cover-title {
    font-size: 10px;
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Hind Siliguri', var(--font-main);
}

.book-cover-publisher {
    font-size: 6.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.78);
    display: block;
    margin-top: 1px;
}

/* Top Corner Floating Badges */
.card-floating-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    pointer-events: none;
}

.badge-class-pill {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #FFFFFF;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-bookmark-heart {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.btn-bookmark-heart:hover {
    background: #FFF1F2;
    color: #E11D48;
    transform: scale(1.12);
}

.btn-bookmark-heart.saved {
    background: #FFE4E6;
    color: #E11D48;
}

.btn-bookmark-heart.saved i {
    font-weight: 900;
}

/* Card Body Content */
.nctb-card-body {
    padding: 12px 14px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    background: var(--bg-surface);
}

.card-subject-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.badge-subject-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.badge-version-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.nctb-card-title {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
    margin: 0;
    font-family: 'Hind Siliguri', var(--font-main);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta Data Pills (Pages, Size, Rating) */
.nctb-card-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stat-item.rating {
    color: #D97706;
}

.stat-item.rating i {
    color: #F59E0B;
}

/* Card Action Buttons */
.nctb-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.btn-read-online {
    flex: 1;
    height: 34px;
    background: var(--brand-primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm, 8px);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-read-online:hover {
    background: var(--brand-primary-hover);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.28);
}

.btn-action-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-action-icon:hover {
    background: var(--bg-surface);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    transform: translateY(-1.5px);
}

/* --------------------------------------------------------------------------
   6. ALL BOOKS SECTION
   Dynamic Grid, Filters, List View Switch, and Pagination
   -------------------------------------------------------------------------- */
.all-books-container {
    width: 100%;
    margin-bottom: 40px;
}

/* View Mode Toggles (Grid vs List) */
.view-mode-switch {
    display: inline-flex;
    align-items: center;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 8px);
    padding: 2px;
}

.btn-view-mode {
    width: 32px;
    height: 30px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-view-mode.active {
    background: var(--bg-surface);
    color: var(--brand-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* All Books Grid Layout */
.all-books-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    width: 100%;
}

@media (max-width: 1199px) and (min-width: 900px) {
    .all-books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (max-width: 899px) and (min-width: 580px) {
    .all-books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (max-width: 579px) {
    .all-books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* List View Layout Mode */
.all-books-grid.list-view-mode {
    grid-template-columns: 1fr;
    gap: 12px;
}

.all-books-grid.list-view-mode .nctb-book-card {
    flex-direction: row;
    align-items: center;
}

.all-books-grid.list-view-mode .book-cover-stage {
    width: 130px;
    height: 120px;
    padding: 8px;
    flex-shrink: 0;
}

.all-books-grid.list-view-mode .book-3d-wrapper {
    width: 70px;
    height: 98px;
}

.all-books-grid.list-view-mode .nctb-card-body {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 18px;
}

.all-books-grid.list-view-mode .nctb-card-actions {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    min-width: 220px;
}

/* Empty Filter State */
.library-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background: var(--bg-surface);
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-lg, 16px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.empty-state-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.library-empty-state h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.library-empty-state p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 360px;
    margin: 0;
}

/* Pagination Bar */
.library-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-active);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.page-btn.active {
    background: var(--brand-primary);
    color: #FFFFFF;
    border-color: var(--brand-primary);
    box-shadow: 0 3px 10px -2px rgba(67, 56, 202, 0.35);
}

.page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   7. INTERACTIVE SMART E-BOOK READER MODAL
   Rich full-screen experience with zoom, theme modes & navigation
   -------------------------------------------------------------------------- */
.reader-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.reader-modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.reader-modal-window {
    width: 95vw;
    max-width: 1080px;
    height: 92vh;
    max-height: 860px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg, 16px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

/* Reader Toolbar */
.reader-toolbar {
    height: 54px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    gap: 12px;
    flex-shrink: 0;
}

.reader-title-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.reader-book-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.reader-controls-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reader-tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.reader-tool-btn:hover {
    background: var(--bg-surface);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.reader-page-indicator {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0 8px;
    white-space: nowrap;
}

/* Reader Paper Canvas Stage */
.reader-stage-container {
    flex: 1;
    overflow-y: auto;
    background: #E2E8F0;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    transition: background 0.25s ease;
}

/* Reader Theme Modes */
.reader-stage-container.theme-sepia {
    background: #EEDBBE;
}
.reader-stage-container.theme-dark {
    background: #0B0F19;
}

.reader-page-paper {
    width: 100%;
    max-width: 740px;
    min-height: 980px;
    background: #FFFFFF;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 44px 50px;
    color: #1E293B;
    font-family: 'Hind Siliguri', serif;
    line-height: 1.75;
    position: relative;
    transition: all 0.25s ease;
}

.reader-stage-container.theme-sepia .reader-page-paper {
    background: #F8F1E3;
    color: #4A3B32;
    box-shadow: 0 10px 30px rgba(74, 59, 50, 0.12);
}

.reader-stage-container.theme-dark .reader-page-paper {
    background: #1E293B;
    color: #E2E8F0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Reader Page Typography */
.reader-paper-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reader-curriculum-label {
    font-size: 11px;
    font-weight: 800;
    color: #D97706;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reader-chapter-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.reader-learning-box {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-left: 4px solid #16A34A;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 18px 0;
    font-size: 13.5px;
}

.reader-stage-container.theme-dark .reader-learning-box {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.35);
    color: #86EFAC;
}

.reader-formula-callout {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    font-family: 'Fira Code', monospace;
    font-weight: 600;
    font-size: 16px;
    color: #1D4ED8;
    margin: 20px 0;
}

.reader-stage-container.theme-dark .reader-formula-callout {
    background: rgba(29, 78, 216, 0.15);
    border-color: rgba(29, 78, 216, 0.4);
    color: #93C5FD;
}

/* Reader Floating Side Navigation */
.reader-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 20;
}

.reader-nav-arrow:hover {
    background: var(--brand-primary);
    color: #FFFFFF;
    transform: translateY(-50%) scale(1.1);
}

.reader-nav-prev {
    left: 20px;
}
.reader-nav-next {
    right: 20px;
}

/* --------------------------------------------------------------------------
   8. CHAPTER OUTLINE MODAL STYLING
   -------------------------------------------------------------------------- */
.chapter-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chapter-modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.chapter-modal-card {
    width: 90vw;
    max-width: 580px;
    max-height: 80vh;
    background: var(--bg-surface);
    border-radius: var(--radius-lg, 16px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chapter-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chapter-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chapter-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius-sm, 10px);
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.chapter-list-item:hover {
    background: var(--bg-active);
    border-color: rgba(67, 56, 202, 0.3);
}

.chapter-info-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chapter-num-badge {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--brand-light);
    color: var(--brand-primary);
    font-size: 11.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   9. RESPONSIVE DESIGN ADJUSTMENTS
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .library-hero-banner {
        height: 130px;
        min-height: 125px;
        max-height: 135px;
        margin-bottom: 14px;
    }

    .library-banner-content {
        padding: 10px 14px;
    }

    .library-banner-left {
        max-width: 80%;
        gap: 4px;
    }

    .library-banner-pill {
        font-size: 10px;
        padding: 2px 8px;
    }

    .library-banner-title {
        font-size: 16px;
    }

    .library-banner-desc {
        font-size: 11px;
        -webkit-line-clamp: 1;
    }

    .library-stat-pill:nth-child(2) {
        display: none;
    }

    .library-stat-pill {
        padding: 6px 10px;
        min-width: 75px;
    }

    .library-stat-num {
        font-size: 15px;
    }

    .library-filter-panel {
        padding: 12px;
        gap: 10px;
    }

    .book-cover-stage {
        height: 150px;
        padding: 10px;
    }

    .book-3d-wrapper {
        width: 86px;
        height: 122px;
    }

    .nctb-card-body {
        padding: 10px;
        gap: 6px;
    }

    .nctb-card-title {
        font-size: 13px;
    }

    .btn-read-online {
        height: 32px;
        font-size: 11px;
    }

    .btn-action-icon {
        width: 32px;
        height: 32px;
    }

    .reader-page-paper {
        padding: 24px 20px;
    }

    .reader-nav-arrow {
        display: none;
    }
}

@media (max-width: 480px) {
    .library-banner-right {
        display: none;
    }

    .library-banner-left {
        max-width: 100%;
    }

    .library-hero-banner {
        height: 125px;
        min-height: 125px;
        max-height: 125px;
    }

    .nctb-featured-grid {
        gap: 8px;
    }

    .all-books-grid {
        gap: 8px;
    }

    .book-cover-stage {
        height: 138px;
    }

    .book-3d-wrapper {
        width: 78px;
        height: 112px;
    }

    .nctb-card-stats {
        font-size: 10.5px;
        gap: 6px;
    }
}
