/* ============================================
   TDBB Library (kutuphane.tdbb.test)
   Library-specific components only.
   Colors/fonts/header/footer come from front.css.
   ============================================ */

/* ---- Main ---- */
.lib-main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* ---- Page header / breadcrumbs ---- */
.lib-page-header {
    margin-bottom: 1.5rem;
}
.lib-page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy-dark);
    margin-bottom: .25rem;
}
.lib-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: .8125rem;
    color: var(--text-muted);
}
.lib-breadcrumb a { color: var(--navy); text-decoration: none; }
.lib-breadcrumb a:hover { text-decoration: underline; }
.lib-breadcrumb li + li::before { content: '/'; margin-right: .25rem; color: #ccc; }

/* ---- Book Card ---- */
.book-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    perspective: 600px;
    height: 100%;
    background: none;
    border: none;
    border-radius: 0;
    overflow: visible;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
}
.book-card:hover {
    box-shadow: none;
    transform: none;
}

/* 3D book wrapper */
.book-card-img {
    position: relative;
    width: 100%;
    max-width: 180px;
    aspect-ratio: 0.7;
    margin: 0 auto;
    padding-top: 0;
    background: none;
    overflow: visible;
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
}
.book-card:hover .book-card-img {
    transform: rotateY(-18deg);
}

/* Cover image */
.book-card-img img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px 8px 8px 2px;
    box-shadow:
        6px 6px 18px rgba(0,0,0,0.25),
        1px 1px 3px rgba(0,0,0,0.15);
    z-index: 2;
    backface-visibility: hidden;
    transition: box-shadow 0.4s;
}
.book-card:hover .book-card-img img {
    box-shadow:
        10px 10px 30px rgba(0,0,0,0.35),
        2px 2px 6px rgba(0,0,0,0.15);
}

/* Spine — left edge */
.book-card-img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 14px;
    height: 100%;
    background: linear-gradient(90deg, #3a3226 0%, #5a4d3e 40%, #4a3f32 100%);
    border-radius: 2px 0 0 2px;
    z-index: 3;
    box-shadow: inset -2px 0 4px rgba(0,0,0,0.3);
}

/* Page edges — right side */
.book-card-img::after {
    content: '';
    position: absolute;
    top: 3px;
    right: -3px;
    width: 6px;
    height: calc(100% - 6px);
    background: linear-gradient(90deg,
        #e8e4dc 0%, #f5f2ec 30%, #ece8e0 50%, #f2efe8 70%, #e0dcd4 100%
    );
    border-radius: 0 2px 2px 0;
    z-index: 1;
    box-shadow: 2px 1px 4px rgba(0,0,0,0.1);
}

/* Featured badge */
.book-card-img .badge-featured {
    position: absolute;
    top: .5rem;
    right: .5rem;
    background: var(--turquoise);
    color: #fff;
    font-size: .65rem;
    padding: .25rem .5rem;
    border-radius: 4px;
    z-index: 5;
}

/* Book body */
.book-card-body {
    padding: .6rem .25rem .25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
    max-width: 180px;
}
.book-card-title {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}
.book-card-title a {
    color: inherit;
    text-decoration: none;
}
.book-card-title a:hover { color: var(--navy); }
.book-card-meta {
    font-size: .72rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* ---- Author Card ---- */
.author-card {
    text-align: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem 1rem;
    transition: all .3s ease;
    position: relative;
}
.author-card:hover {
    box-shadow: 0 8px 30px rgba(13,56,128,0.10);
    transform: translateY(-3px);
    border-color: transparent;
}
.author-card-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto .75rem;
    display: block;
    background: linear-gradient(135deg, rgba(13,56,128,0.08), rgba(0,175,203,0.08));
    border: 3px solid var(--light-blue);
    transition: border-color .3s;
}
.author-card:hover .author-card-photo {
    border-color: var(--turquoise);
}
.author-card-name {
    font-weight: 600;
    font-size: .88rem;
    margin-bottom: .25rem;
    line-height: 1.35;
}
.author-card-name a { color: var(--text); text-decoration: none; }
.author-card-name a:hover { color: var(--navy); }

/* ---- Category Card ---- */
.category-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.75rem 1.25rem;
    text-align: center;
    transition: all .3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    position: relative;
    overflow: hidden;
}
.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--navy), var(--turquoise));
    opacity: 0;
    transition: opacity .3s;
}
.category-card:hover {
    box-shadow: 0 8px 30px rgba(13,56,128,0.12);
    border-color: transparent;
    transform: translateY(-4px);
    color: var(--text);
}
.category-card:hover::before {
    opacity: 1;
}
.category-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(13,56,128,0.08), rgba(0,175,203,0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .85rem;
    transition: background .3s, transform .3s;
}
.category-card:hover .category-card-icon {
    background: linear-gradient(135deg, var(--navy), var(--turquoise));
    transform: scale(1.08);
}
.category-card-icon i {
    font-size: 1.5rem;
    color: var(--navy);
    transition: color .3s;
}
.category-card:hover .category-card-icon i {
    color: #fff;
}
.category-card-name {
    font-weight: 600;
    font-size: .9rem;
    line-height: 1.35;
}
.category-card-name a { color: var(--text); text-decoration: none; }
.category-card-name a:hover { color: var(--navy); }
.category-card-img { margin-bottom: .75rem; }
.category-card-img img { max-height: 60px; object-fit: contain; }

/* ---- Book Detail (Professional) ---- */
.bd-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.05);
}
.bd-layout {
    display: flex;
    gap: 2.5rem;
}
.bd-left {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.bd-right {
    flex: 1;
    min-width: 0;
}

/* 3D Cover */
.bd-cover-wrapper {
    perspective: 800px;
    margin-bottom: 1.25rem;
}
.bd-cover-3d {
    position: relative;
    width: 220px;
    height: 310px;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}
.bd-cover-wrapper:hover .bd-cover-3d {
    transform: rotateY(-15deg);
}
.bd-cover-3d img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 3px 10px 10px 3px;
    box-shadow:
        8px 8px 25px rgba(0,0,0,0.3),
        2px 2px 5px rgba(0,0,0,0.15);
    z-index: 2;
    backface-visibility: hidden;
}
.bd-cover-3d::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 18px; height: 100%;
    background: linear-gradient(90deg, #3a3226 0%, #5a4d3e 40%, #4a3f32 100%);
    border-radius: 3px 0 0 3px;
    z-index: 3;
    box-shadow: inset -3px 0 5px rgba(0,0,0,0.3);
}
.bd-cover-3d::after {
    content: '';
    position: absolute;
    top: 4px; right: -4px;
    width: 8px;
    height: calc(100% - 8px);
    background: linear-gradient(90deg, #e8e4dc 0%, #f5f2ec 30%, #ece8e0 50%, #f2efe8 70%, #e0dcd4 100%);
    border-radius: 0 3px 3px 0;
    z-index: 1;
    box-shadow: 3px 2px 6px rgba(0,0,0,0.12);
}
.bd-cover-placeholder {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e9e5dd, #d8d3ca);
    border-radius: 3px 10px 10px 3px;
    box-shadow: 8px 8px 25px rgba(0,0,0,0.3);
    z-index: 2;
}
.bd-cover-placeholder i { font-size: 3rem; color: #bbb; }

/* Action Buttons */
.bd-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.bd-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}
.bd-btn-read {
    background: var(--navy);
    color: #fff;
    box-shadow: 0 3px 12px rgba(13,56,128,0.25);
}
.bd-btn-read:hover {
    background: var(--navy-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 5px 20px rgba(13,56,128,0.35);
}
.bd-btn-download {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--border);
}
.bd-btn-download:hover {
    border-color: var(--turquoise);
    color: var(--turquoise);
    background: rgba(0,175,203,0.04);
}

/* Category badge */
.bd-category {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: rgba(0,175,203,0.1);
    color: var(--turquoise);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 50px;
    text-decoration: none;
    margin-bottom: 0.75rem;
    transition: background 0.2s;
}
.bd-category:hover {
    background: rgba(0,175,203,0.18);
    color: var(--turquoise);
}

/* Title */
.bd-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy-dark);
    line-height: 1.3;
    margin: 0 0 0.5rem;
}

/* Authors */
.bd-authors {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.bd-authors i {
    color: var(--turquoise);
    font-size: 0.95rem;
}
.bd-authors a {
    color: var(--navy);
    text-decoration: none;
    font-weight: 500;
}
.bd-authors a:hover {
    color: var(--turquoise);
    text-decoration: underline;
}

/* Description */
.bd-desc {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

/* Content */
.bd-content {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 1.5rem;
}

/* Meta Grid */
.bd-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.bd-meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--light-blue-secondary);
    border-radius: 10px;
    transition: background 0.2s;
}
.bd-meta-item:hover {
    background: var(--light-blue);
}
.bd-meta-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.bd-meta-icon i {
    font-size: 1rem;
    color: var(--navy);
}
.bd-meta-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.2;
}
.bd-meta-value {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--navy-dark);
    line-height: 1.3;
}

/* Tags */
.bd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.bd-tag {
    padding: 0.25rem 0.65rem;
    background: var(--light-blue-secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 767.98px) {
    .bd-card { padding: 1.25rem; }
    .bd-layout {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    .bd-left { flex: none; width: 100%; max-width: 260px; }
    .bd-cover-3d { width: 180px; height: 255px; margin: 0 auto; }
    .bd-right { text-align: left; }
    .bd-title { font-size: 1.3rem; }
    .bd-meta-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- Section titles ---- */
.lib-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy-dark);
    margin-bottom: 1.25rem;
    padding-bottom: .6rem;
    border-bottom: 2px solid var(--turquoise);
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    text-transform: uppercase;
    letter-spacing: .02em;
}

/* ---- Flipbook (library overrides) ---- */
/* Base styles come from front.css; only library-specific tweaks here */
.lib-page-header-compact + .bikodbook-section {
    padding-top: 0.75rem;
}

/* ---- Search Page ---- */
.lib-search-form {
    max-width: 600px;
}

/* Search Hero */
.lib-search-hero {
    background: #0b2d6e;
    color: #fff;
    padding: 2.5rem 0 2rem;
    margin-top: -2rem;
    margin-bottom: 0;
    border-bottom: 4px solid var(--turquoise);
}
.lib-search-hero-inner {
    max-width: 680px;
}
.lib-search-hero h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.lib-search-hero h1 i {
    font-size: 1.2rem;
    color: var(--turquoise);
}
.lib-search-hero .breadcrumb {
    margin-bottom: 1.25rem;
    font-size: 0.78rem;
}
.lib-search-hero .breadcrumb-item a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
}
.lib-search-hero .breadcrumb-item a:hover {
    color: #fff;
}
.lib-search-hero .breadcrumb-item.active {
    color: rgba(255,255,255,0.35);
}
.lib-search-hero .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.2);
}

/* Search input inside hero */
.lib-search-hero-form {
    max-width: 580px;
}
.lib-search-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 0.4rem 0.4rem 0.4rem 1.1rem;
    transition: border-color 0.2s, background 0.2s;
}
.lib-search-input-wrap:focus-within {
    border-color: var(--turquoise);
    background: rgba(255,255,255,0.12);
}
.lib-search-input-wrap > i {
    color: rgba(255,255,255,0.35);
    font-size: 1.1rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}
.lib-search-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.95rem;
    padding: 0.55rem 0;
    min-width: 0;
}
.lib-search-input-wrap input::placeholder {
    color: rgba(255,255,255,0.28);
}
.lib-search-input-wrap button {
    background: var(--turquoise);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 0.6rem 1.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.lib-search-input-wrap button:hover {
    background: #00c4e3;
}

/* Results bar */
.lib-search-result-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    background: var(--light-blue-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.lib-search-result-info {
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.lib-search-result-label {
    font-weight: 500;
}
.lib-search-result-keyword {
    font-weight: 700;
    color: var(--navy-dark);
}
.lib-search-result-count {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--navy);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.3rem 0.85rem;
}
.lib-search-result-count i {
    font-size: 0.75rem;
    color: var(--turquoise);
}

/* Search result cards — horizontal layout */
.lib-search-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.1rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.25s, border-color 0.25s;
    height: 100%;
}
.lib-search-card:hover {
    box-shadow: 0 6px 24px rgba(13,56,128,0.08);
    border-color: rgba(13,56,128,0.12);
    color: var(--text);
}

/* Cover */
.lib-search-card-cover {
    position: relative;
    flex: 0 0 110px;
    height: 155px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 4px 4px 14px rgba(0,0,0,0.15);
}
.lib-search-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lib-search-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
}
.lib-search-card-placeholder i {
    font-size: 2rem;
    color: #bbb;
}
.lib-search-card-star {
    position: absolute;
    top: 6px;
    right: 6px;
    color: #ffc107;
    font-size: 0.7rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Body */
.lib-search-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0;
}
.lib-search-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy-dark);
    margin: 0 0 0.4rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.lib-search-card:hover .lib-search-card-title {
    color: var(--turquoise);
}
.lib-search-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0 0 auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lib-search-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 0.75rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.lib-search-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.lib-search-card-meta i {
    font-size: 0.72rem;
    color: var(--navy);
    opacity: 0.5;
}

/* Empty state */
.lib-search-empty {
    text-align: center;
    padding: 4rem 1rem;
}
.lib-search-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--light-blue-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}
.lib-search-empty-icon i {
    font-size: 2rem;
    color: var(--text-muted);
}
.lib-search-empty h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy-dark);
    margin: 0 0 0.4rem;
}
.lib-search-empty p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0 0 1.25rem;
}
.lib-search-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.25rem;
    background: var(--navy);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.2s;
}
.lib-search-empty-btn:hover {
    background: var(--navy-dark);
    color: #fff;
}

/* Responsive search */
@media (max-width: 575.98px) {
    .lib-search-hero { padding: 2rem 0 1.5rem; }
    .lib-search-hero h1 { font-size: 1.25rem; }
    .lib-search-card { flex-direction: column; gap: 0.75rem; }
    .lib-search-card-cover { flex: none; width: 100%; height: 180px; }
    .lib-search-result-bar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

/* ---- Pagination ---- */
.lib-pagination .page-link {
    color: var(--navy);
    border-color: var(--border);
    border-radius: 6px;
    margin: 0 2px;
    font-weight: 500;
    font-size: .85rem;
    transition: all .2s;
}
.lib-pagination .page-link:hover {
    background: var(--light-blue-secondary);
    border-color: var(--navy);
    color: var(--navy);
}
.lib-pagination .page-item.active .page-link {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13,56,128,0.25);
}

/* ---- Hero ---- */
.lib-hero {
    background: #0b2d6e;
    color: #fff;
    padding: 4rem 0 3.5rem;
    margin-top: -2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

/* Decorative line accent */
.lib-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--turquoise);
}

/* Background shapes — subtle solid circles */
.lib-hero-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.lib-hero-shape {
    position: absolute;
    border-radius: 50%;
}
.lib-hero-shape-1 {
    width: 450px;
    height: 450px;
    top: -200px;
    right: -80px;
    background: rgba(0,175,203,0.06);
}
.lib-hero-shape-2 {
    width: 250px;
    height: 250px;
    bottom: -80px;
    left: -40px;
    background: rgba(255,255,255,0.03);
}
.lib-hero-shape-3 {
    width: 180px;
    height: 180px;
    top: 50%;
    left: 45%;
    background: rgba(0,175,203,0.03);
}

/* Hero layout: left text + right books */
.lib-hero-layout {
    display: flex;
    align-items: center;
    gap: 3rem;
    position: relative;
    z-index: 1;
}
.lib-hero-content {
    flex: 1;
    min-width: 0;
}
.lib-hero-books {
    flex: 0 0 320px;
    position: relative;
    height: 320px;
}

/* Badge */
.lib-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.85rem;
    background: rgba(0,175,203,0.15);
    border: 1px solid rgba(0,175,203,0.3);
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--turquoise);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}
.lib-hero-badge i { font-size: 0.85rem; }

/* Title + subtitle */
.lib-hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 0.6rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
}
.lib-hero-subtitle {
    font-size: 1rem;
    color: rgba(255,255,255,0.55);
    margin: 0 0 1.5rem;
    line-height: 1.6;
    max-width: 420px;
}

/* Search box */
.lib-hero-search { margin-bottom: 1.75rem; }
.lib-search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 0.35rem 0.35rem 0.35rem 1rem;
    max-width: 480px;
    transition: border-color 0.2s, background 0.2s;
}
.lib-search-box:focus-within {
    border-color: var(--turquoise);
    background: rgba(255,255,255,0.12);
}
.lib-search-box > i {
    color: rgba(255,255,255,0.4);
    font-size: 1rem;
    margin-right: 0.65rem;
    flex-shrink: 0;
}
.lib-search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    min-width: 0;
}
.lib-search-box input::placeholder {
    color: rgba(255,255,255,0.3);
}
.lib-search-box button {
    background: var(--turquoise);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.55rem 1.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.lib-search-box button:hover {
    background: #00c4e3;
}

/* Stats row */
.lib-hero-stats {
    display: flex;
    align-items: center;
    gap: 0;
}
.lib-hero-stat {
    display: flex;
    flex-direction: column;
    padding: 0.6rem 1.5rem;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0;
    background: rgba(255,255,255,0.04);
}
.lib-hero-stat:first-child {
    border-radius: 8px 0 0 8px;
}
.lib-hero-stat:last-child {
    border-radius: 0 8px 8px 0;
}
.lib-hero-stat + .lib-hero-stat-divider + .lib-hero-stat {
    border-left: none;
}
.lib-hero-stat strong {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.lib-hero-stat span {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin-top: 0.15rem;
}
.lib-hero-stat-divider {
    display: none;
}

/* Floating book covers */
.lib-hero-book {
    position: absolute;
    border-radius: 4px 8px 8px 4px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    transition: transform 0.4s ease;
}
.lib-hero-book img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Book 1: front-center, largest */
.lib-hero-book-1 {
    width: 160px;
    height: 230px;
    top: 40px;
    left: 80px;
    z-index: 3;
    transform: rotate(-3deg);
}
.lib-hero-book-1:hover { transform: rotate(-3deg) translateY(-8px); }

/* Book 2: behind-right */
.lib-hero-book-2 {
    width: 140px;
    height: 200px;
    top: 20px;
    left: 190px;
    z-index: 2;
    transform: rotate(5deg);
    opacity: 0.85;
}
.lib-hero-book-2:hover { transform: rotate(5deg) translateY(-6px); }

/* Book 3: behind-left */
.lib-hero-book-3 {
    width: 130px;
    height: 190px;
    top: 60px;
    left: 0;
    z-index: 1;
    transform: rotate(-8deg);
    opacity: 0.7;
}
.lib-hero-book-3:hover { transform: rotate(-8deg) translateY(-6px); }

/* Spine effect on hero books — solid shadow */
.lib-hero-book::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    height: 100%;
    background: rgba(0,0,0,0.25);
    z-index: 2;
}

/* Responsive hero */
@media (max-width: 991.98px) {
    .lib-hero-layout {
        flex-direction: column;
        text-align: center;
    }
    .lib-hero-subtitle { margin-left: auto; margin-right: auto; }
    .lib-search-box { margin: 0 auto; }
    .lib-hero-stats { justify-content: center; }
    .lib-hero-books {
        flex: none;
        width: 320px;
        height: 260px;
        margin: 0 auto;
    }
    .lib-hero-book-1 { left: 80px; top: 20px; width: 140px; height: 200px; }
    .lib-hero-book-2 { left: 170px; top: 5px; width: 120px; height: 175px; }
    .lib-hero-book-3 { left: 10px; top: 35px; width: 110px; height: 165px; }
}
@media (max-width: 575.98px) {
    .lib-hero { padding: 2.5rem 0 2rem; }
    .lib-hero-title { font-size: 1.6rem; }
    .lib-hero-books {
        width: 260px;
        height: 220px;
    }
    .lib-hero-book-1 { left: 60px; width: 120px; height: 175px; }
    .lib-hero-book-2 { left: 140px; width: 100px; height: 150px; }
    .lib-hero-book-3 { left: 0; width: 95px; height: 140px; }
    .lib-hero-stat { padding: 0.5rem 1rem; }
    .lib-hero-stat strong { font-size: 1.2rem; }
}

/* ---- Sections ---- */
.lib-section {
    padding: 2.5rem 0;
}
.lib-section-alt {
    background: var(--light-blue-secondary);
    padding: 2.5rem 0;
    position: relative;
}
.lib-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    padding-bottom: .85rem;
    border-bottom: 2px solid var(--border);
}
.lib-section-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.lib-section-header h2 i {
    font-size: 1rem;
    color: var(--turquoise);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,175,203,0.1);
    border-radius: 8px;
}
.lib-section-more {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--navy);
    text-decoration: none;
    white-space: nowrap;
    padding: .4rem .9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all .2s;
}
.lib-section-more:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
    text-decoration: none;
}

/* ---- Category Banners (Home) ---- */
.lib-cats-section {
    padding: 0;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}
.lib-cats-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.lib-cat-banner {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.5rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.lib-cat-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--cat-color, var(--navy));
    border-radius: 4px 0 0 4px;
    transition: width 0.3s;
}
.lib-cat-banner:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.10);
    border-color: transparent;
    color: var(--text);
}
.lib-cat-banner:hover::before {
    width: 6px;
}
.lib-cat-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--cat-color, var(--navy)) 10%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}
.lib-cat-banner-icon i {
    font-size: 1.25rem;
    color: var(--cat-color, var(--navy));
    transition: color 0.3s;
}
.lib-cat-banner:hover .lib-cat-banner-icon {
    background: var(--cat-color, var(--navy));
}
.lib-cat-banner:hover .lib-cat-banner-icon i {
    color: #fff;
}
.lib-cat-banner-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.lib-cat-banner-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--navy-dark);
    line-height: 1.3;
}
.lib-cat-banner-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.15rem;
    transition: color 0.3s;
}
.lib-cat-banner:hover .lib-cat-banner-count {
    color: var(--cat-color, var(--navy));
}

/* ---- Latest Additions — Shelf (Home) ---- */
.lib-latest-section {
    padding: 2.5rem 0 0;
    background: var(--light-blue-secondary);
    border-top: 1px solid var(--border);
}
.lib-latest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.lib-latest-header > div {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.lib-latest-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}
.lib-latest-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--navy-dark);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.lib-latest-more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--navy);
    text-decoration: none;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
}
.lib-latest-more:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

/* Shelf grid */
.lib-shelf {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.75rem 1.25rem;
    padding-bottom: 2rem;
}
.lib-shelf-book {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    perspective: 500px;
}
.lib-shelf-book:hover {
    color: var(--text);
}

/* Shelf cover — 3D */
.lib-shelf-cover {
    position: relative;
    width: 140px;
    height: 200px;
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
    margin-bottom: 0.5rem;
}
.lib-shelf-book:hover .lib-shelf-cover {
    transform: rotateY(-15deg) translateY(-6px);
}
.lib-shelf-cover img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 2px 6px 6px 2px;
    box-shadow:
        5px 5px 15px rgba(0,0,0,0.22),
        1px 1px 3px rgba(0,0,0,0.12);
    z-index: 2;
    backface-visibility: hidden;
    transition: box-shadow 0.4s;
}
.lib-shelf-book:hover .lib-shelf-cover img {
    box-shadow:
        8px 8px 25px rgba(0,0,0,0.30),
        2px 2px 5px rgba(0,0,0,0.15);
}
.lib-shelf-cover::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 12px; height: 100%;
    background: linear-gradient(90deg, #3a3226, #5a4d3e 40%, #4a3f32);
    border-radius: 2px 0 0 2px;
    z-index: 3;
    box-shadow: inset -2px 0 3px rgba(0,0,0,0.3);
}
.lib-shelf-cover::after {
    content: '';
    position: absolute;
    top: 3px; right: -3px;
    width: 5px;
    height: calc(100% - 6px);
    background: linear-gradient(90deg, #e8e4dc, #f5f2ec 40%, #e0dcd4);
    border-radius: 0 2px 2px 0;
    z-index: 1;
    box-shadow: 2px 1px 3px rgba(0,0,0,0.08);
}
.lib-shelf-placeholder {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e9e5dd, #d8d3ca);
    border-radius: 2px 6px 6px 2px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.22);
    z-index: 2;
}
.lib-shelf-placeholder i { font-size: 2rem; color: #bbb; }
.lib-shelf-star {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
    color: #ffc107;
    font-size: 0.7rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Shelf book text */
.lib-shelf-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    line-height: 1.3;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.2s;
}
.lib-shelf-book:hover .lib-shelf-title {
    color: var(--navy);
}
.lib-shelf-year {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Shelf edge — wooden shelf look */
.lib-shelf-edge {
    height: 8px;
    background: linear-gradient(180deg, #c4a882 0%, #b89b75 40%, #a88d68 100%);
    border-radius: 0 0 4px 4px;
    box-shadow:
        0 4px 8px rgba(0,0,0,0.12),
        inset 0 1px 0 rgba(255,255,255,0.15);
    margin: 0 -1rem;
}

@media (max-width: 767.98px) {
    .lib-cats-section { margin-top: -1rem; }
    .lib-cats-grid { flex-direction: column; }
    .lib-cat-banner { min-width: auto; }
    .lib-shelf {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem 1rem;
    }
    .lib-shelf-cover { width: 120px; height: 170px; }
    .lib-shelf-title { max-width: 120px; font-size: 0.72rem; }
}

/* ---- Book card variants ---- */
.book-card-sm .book-card-img {
    max-width: 140px;
}
.book-card-sm .book-card-body {
    max-width: 140px;
    padding: .4rem .15rem .15rem;
}
.book-card-sm .book-card-title { font-size: .78rem; }
.book-card-placeholder {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e9e5dd, #d8d3ca);
    border-radius: 2px 8px 8px 2px;
    box-shadow:
        6px 6px 18px rgba(0,0,0,0.25),
        1px 1px 3px rgba(0,0,0,0.15);
    z-index: 2;
}
.book-card-placeholder i { font-size: 2.5rem; color: #bbb; }

/* ---- Author detail ---- */
.author-detail-photo {
    width: 120px; height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}
.author-detail-placeholder {
    width: 120px; height: 120px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}
.author-detail-placeholder i { font-size: 3rem; color: #bbb; }

/* ---- Empty state ---- */
.lib-empty {
    text-align: center;
    padding: 3rem 1rem;
}

/* ---- Filter bar ---- */
.lib-filter .nav-pills .nav-link {
    font-size: .8125rem;
    padding: .35rem .75rem;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: .375rem;
}
.lib-filter .nav-pills .nav-link.active,
.lib-filter .nav-pills .nav-link:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

/* ---- Responsive ---- */
@media (max-width: 767.98px) {
    .lib-page-header-compact + .bikodbook-section { padding-top: 0; }
}
@media (max-width: 575.98px) {
    .book-detail { padding: 1rem; }
    .book-detail-cover { max-width: 200px; }
    .book-card-img { max-width: 130px; }
    .book-card-body { max-width: 130px; }
    .book-card-sm .book-card-img { max-width: 110px; }
    .book-card-sm .book-card-body { max-width: 110px; }
}
