/* Book Manager - Frontend Nature-Inspired Mobile-First Styles */
:root {
    --bm-green-50: #f0fdf4;
    --bm-green-100: #dcfce7;
    --bm-green-200: #bbf7d0;
    --bm-green-300: #86efac;
    --bm-green-500: #22c55e;
    --bm-green-600: #16a34a;
    --bm-green-700: #15803d;
    --bm-blue-50: #f0f9ff;
    --bm-blue-100: #e0f2fe;
    --bm-blue-500: #0ea5e9;
    --bm-blue-600: #0284c7;
    --bm-blue-700: #0369a1;
    --bm-slate-50: #f8fafc;
    --bm-slate-100: #f1f5f9;
    --bm-slate-200: #e2e8f0;
    --bm-slate-300: #cbd5e1;
    --bm-slate-500: #64748b;
    --bm-slate-600: #475569;
    --bm-slate-700: #334155;
    --bm-slate-800: #1e293b;
    --bm-slate-900: #0f172a;
    --bm-font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --bm-font-heading: 'Poppins', var(--bm-font-main);
    --bm-radius: 14px;
    --bm-radius-sm: 8px;
    --bm-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    --bm-shadow-hover: 0 10px 25px -3px rgba(0, 0, 0, 0.08);
}

.bm-catalog-container, .bm-detail-container {
    font-family: var(--bm-font-main);
    color: var(--bm-slate-800);
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    box-sizing: border-box;
}

/* Hero Banner */
.bm-hero-banner {
    background: linear-gradient(135deg, var(--bm-blue-100) 0%, var(--bm-green-100) 100%);
    border-radius: var(--bm-radius);
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 25px;
    border: 1px solid var(--bm-green-200);
}

.bm-hero-title {
    font-family: var(--bm-font-heading);
    font-size: 26px;
    font-weight: 700;
    color: #064e3b;
    margin: 0 0 8px 0;
}

.bm-hero-subtitle {
    font-size: 14px;
    color: #065f46;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* Search Box */
.bm-search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.bm-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--bm-green-600);
}

.bm-search-box input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    border-radius: 9999px;
    border: 1px solid var(--bm-green-200);
    background: #ffffff;
    font-size: 14px;
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bm-search-box input:focus {
    border-color: var(--bm-green-600);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.bm-search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: var(--bm-slate-600);
    cursor: pointer;
}

/* Recommended Books Showcase (Nature-Inspired & Mobile-First) */
.bm-recommended-showcase {
    margin-bottom: 28px;
    background: linear-gradient(135deg, rgba(240, 253, 244, 0.65) 0%, rgba(240, 249, 255, 0.75) 100%);
    border: 1px solid var(--bm-slate-200);
    border-radius: var(--bm-radius-lg, 16px);
    padding: 20px 20px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
    position: relative;
}

.bm-recommended-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.bm-recommended-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bm-recommended-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: var(--bm-green-600);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.12);
}

.bm-recommended-icon-box .bm-icon-star {
    color: #eab308;
}

.bm-recommended-title {
    font-family: var(--bm-font-heading);
    font-size: 17px;
    font-weight: 600;
    color: var(--bm-slate-800);
    margin: 0;
    line-height: 1.25;
}

.bm-recommended-subtitle {
    font-size: 12px;
    color: var(--bm-slate-600);
    display: block;
    margin-top: 2px;
}

.bm-recommended-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bm-rec-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--bm-slate-200);
    background: #ffffff;
    color: var(--bm-slate-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.bm-rec-nav-btn:hover {
    background: var(--bm-green-50, #f0fdf4);
    color: var(--bm-green-600);
    border-color: var(--bm-green-500);
    transform: scale(1.05);
}

.bm-rec-nav-btn:active {
    transform: scale(0.95);
}

.bm-recommended-track-wrap {
    position: relative;
    overflow: hidden;
}

.bm-recommended-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 4px 4px 12px 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--bm-green-200) transparent;
}

.bm-recommended-track::-webkit-scrollbar {
    height: 4px;
}

.bm-recommended-track::-webkit-scrollbar-track {
    background: transparent;
}

.bm-recommended-track::-webkit-scrollbar-thumb {
    background: var(--bm-green-200);
    border-radius: 9999px;
}

/* ==========================================================================
   Recommended Books Module (Adaptive: Covers-Only vs Extended/Default)
   ========================================================================== */

/* Base Card structure in carousel */
.bm-recommended-card {
    scroll-snap-align: start;
    box-sizing: border-box;
    transition: flex-basis 0.25s ease, max-width 0.25s ease;
}

/* --------------------------------------------------------------------------
   1. Template: Doar Coperți (Covers Only)
   Matches the minimalist gallery of covers in the main content
   -------------------------------------------------------------------------- */
.bm-catalog-container[data-template="covers"] .bm-recommended-card,
.bm-recommended-showcase.bm-rec-template-covers .bm-recommended-card {
    flex: 0 0 135px;
    max-width: 148px;
}

@media (min-width: 640px) {
    .bm-catalog-container[data-template="covers"] .bm-recommended-card,
    .bm-recommended-showcase.bm-rec-template-covers .bm-recommended-card {
        flex: 0 0 155px;
        max-width: 170px;
    }
}

@media (min-width: 1024px) {
    .bm-catalog-container[data-template="covers"] .bm-recommended-card,
    .bm-recommended-showcase.bm-rec-template-covers .bm-recommended-card {
        flex: 0 0 170px;
        max-width: 185px;
    }
}

.bm-catalog-container[data-template="covers"] .bm-rec-card-inner,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-card-inner {
    display: block;
    height: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
}

.bm-catalog-container[data-template="covers"] .bm-rec-cover-link,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-cover-link {
    display: block;
    position: relative;
    border-radius: var(--bm-radius, 10px);
    overflow: hidden;
    background: var(--bm-slate-100);
    border: 1px solid var(--bm-slate-200);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.bm-catalog-container[data-template="covers"] .bm-rec-cover-link:hover,
.bm-catalog-container[data-template="covers"] .bm-rec-cover-link:focus-within,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-cover-link:hover,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-cover-link:focus-within {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--bm-shadow-hover, 0 12px 28px rgba(0, 0, 0, 0.12));
    border-color: var(--bm-green-300, #86efac);
}

.bm-catalog-container[data-template="covers"] .bm-rec-cover-box,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-cover-box {
    position: relative;
    width: 100%;
    padding-top: 142%; /* Optimized aspect ratio matching book covers */
    overflow: hidden;
    background: var(--bm-slate-100, #f1f5f9);
}

.bm-catalog-container[data-template="covers"] .bm-rec-cover-img,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-cover-img,
.bm-rec-cover-box img {
    position: absolute !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: top center !important;
    display: block !important;
    transition: transform 0.35s ease;
}

.bm-catalog-container[data-template="covers"] .bm-rec-cover-link:hover .bm-rec-cover-img,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-cover-link:hover .bm-rec-cover-img {
    transform: scale(1.05);
}

/* Hide external bottom info box in covers mode */
.bm-catalog-container[data-template="covers"] .bm-rec-info,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-info {
    display: none !important;
}

/* Covers Mode Overlay */
.bm-catalog-container[data-template="covers"] .bm-rec-cover-overlay,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.94) 0%, rgba(15, 23, 42, 0.65) 55%, rgba(15, 23, 42, 0.2) 80%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 3;
}

.bm-catalog-container[data-template="covers"] .bm-rec-cover-link:hover .bm-rec-cover-overlay,
.bm-catalog-container[data-template="covers"] .bm-rec-cover-link:focus-within .bm-rec-cover-overlay,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-cover-link:hover .bm-rec-cover-overlay,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-cover-link:focus-within .bm-rec-cover-overlay {
    opacity: 1;
    pointer-events: auto;
}

.bm-catalog-container[data-template="covers"] .bm-rec-cover-meta,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-cover-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    transform: translateY(6px);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.bm-catalog-container[data-template="covers"] .bm-rec-cover-link:hover .bm-rec-cover-meta,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-cover-link:hover .bm-rec-cover-meta {
    transform: translateY(0);
}

.bm-catalog-container[data-template="covers"] .bm-rec-cover-title,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-cover-title {
    font-family: var(--bm-font-heading);
    font-size: 12.5px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.25;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.bm-catalog-container[data-template="covers"] .bm-rec-cover-author,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-cover-author {
    font-size: 11px;
    color: #a7f3d0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.bm-catalog-container[data-template="covers"] .bm-rec-cover-actions,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-cover-actions {
    display: flex;
    gap: 5px;
    margin-top: 6px;
    align-items: center;
}

.bm-catalog-container[data-template="covers"] .bm-rec-btn-details-pill,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-btn-details-pill {
    background: rgba(255, 255, 255, 0.92);
    color: var(--bm-slate-800);
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 9999px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bm-catalog-container[data-template="covers"] .bm-rec-btn-details-pill:hover,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-btn-details-pill:hover {
    background: #ffffff;
    color: var(--bm-green-700);
    transform: translateY(-1px);
}

.bm-catalog-container[data-template="covers"] .bm-rec-btn-read-pill,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-btn-read-pill {
    background: #16a34a;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 9999px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bm-catalog-container[data-template="covers"] .bm-rec-btn-read-pill:hover,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-btn-read-pill:hover {
    background: #15803d;
    transform: translateY(-1px);
}

.bm-catalog-container[data-template="covers"] .bm-rec-overlay-btn-extended,
.bm-recommended-showcase.bm-rec-template-covers .bm-rec-overlay-btn-extended {
    display: none !important;
}

/* --------------------------------------------------------------------------
   2. Template: Extins / Standard Cards (Default)
   Matches the rich cards with title, author, meta pills, desc snippet & action bar
   -------------------------------------------------------------------------- */
.bm-catalog-container[data-template="default"] .bm-recommended-card,
.bm-recommended-showcase.bm-rec-template-default .bm-recommended-card {
    flex: 0 0 190px;
    max-width: 215px;
}

@media (min-width: 768px) {
    .bm-catalog-container[data-template="default"] .bm-recommended-card,
    .bm-recommended-showcase.bm-rec-template-default .bm-recommended-card {
        flex: 0 0 220px;
        max-width: 245px;
    }
}

.bm-catalog-container[data-template="default"] .bm-rec-card-inner,
.bm-recommended-showcase.bm-rec-template-default .bm-rec-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border-radius: var(--bm-radius, 10px);
    border: 1px solid var(--bm-slate-200);
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.bm-catalog-container[data-template="default"] .bm-rec-card-inner:hover,
.bm-recommended-showcase.bm-rec-template-default .bm-rec-card-inner:hover {
    transform: translateY(-4px);
    border-color: #86efac;
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.12);
}

.bm-catalog-container[data-template="default"] .bm-rec-cover-link,
.bm-recommended-showcase.bm-rec-template-default .bm-rec-cover-link {
    display: block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    background: var(--bm-slate-100, #f1f5f9);
}

.bm-catalog-container[data-template="default"] .bm-rec-cover-box,
.bm-recommended-showcase.bm-rec-template-default .bm-rec-cover-box {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.42;
    overflow: hidden;
    background: var(--bm-slate-100, #f1f5f9);
}

.bm-catalog-container[data-template="default"] .bm-rec-cover-img,
.bm-recommended-showcase.bm-rec-template-default .bm-rec-cover-img {
    position: absolute !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: top center !important;
    display: block !important;
    transition: transform 0.35s ease;
}

.bm-catalog-container[data-template="default"] .bm-rec-card-inner:hover .bm-rec-cover-img,
.bm-recommended-showcase.bm-rec-template-default .bm-rec-card-inner:hover .bm-rec-cover-img {
    transform: scale(1.05);
}

/* Hide in-cover full meta in extended mode */
.bm-catalog-container[data-template="default"] .bm-rec-cover-meta,
.bm-recommended-showcase.bm-rec-template-default .bm-rec-cover-meta {
    display: none !important;
}

.bm-catalog-container[data-template="default"] .bm-rec-cover-overlay,
.bm-recommended-showcase.bm-rec-template-default .bm-rec-cover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bm-catalog-container[data-template="default"] .bm-rec-card-inner:hover .bm-rec-cover-overlay,
.bm-recommended-showcase.bm-rec-template-default .bm-rec-card-inner:hover .bm-rec-cover-overlay {
    opacity: 1;
}

.bm-catalog-container[data-template="default"] .bm-rec-overlay-btn-extended,
.bm-recommended-showcase.bm-rec-template-default .bm-rec-overlay-btn-extended {
    background: rgba(255, 255, 255, 0.95);
    color: var(--bm-slate-800);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(4px);
    transition: transform 0.2s ease;
    display: inline-block;
}

.bm-catalog-container[data-template="default"] .bm-rec-card-inner:hover .bm-rec-overlay-btn-extended,
.bm-recommended-showcase.bm-rec-template-default .bm-rec-card-inner:hover .bm-rec-overlay-btn-extended {
    transform: translateY(0);
}

/* Extended Info Body */
.bm-catalog-container[data-template="default"] .bm-rec-info,
.bm-recommended-showcase.bm-rec-template-default .bm-rec-info {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
    background: #ffffff;
}

.bm-rec-meta-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.bm-rec-badge-format {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1.5px 6px;
    border-radius: 4px;
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.bm-rec-year {
    font-size: 11px;
    color: var(--bm-slate-600);
    font-weight: 500;
}

.bm-rec-title {
    font-family: var(--bm-font-heading);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bm-rec-title a {
    color: var(--bm-slate-800);
    text-decoration: none;
    transition: color 0.15s ease;
}

.bm-rec-title a:hover {
    color: var(--bm-green-600);
}

.bm-rec-author {
    font-size: 11.5px;
    color: var(--bm-slate-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 6px;
}

.bm-rec-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bm-rec-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--bm-slate-100);
}

.bm-rec-link-details {
    font-size: 12px;
    color: #16a34a;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.bm-rec-link-details:hover {
    color: #15803d;
    text-decoration: underline;
}

.bm-rec-btn-read {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 10px;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.bm-rec-btn-read:hover {
    background: #dcfce7;
    border-color: #86efac;
    color: #14532d;
    transform: translateY(-1px);
}

/* Badges shared between templates */
.bm-rec-badge-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #facc15;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    z-index: 2;
}

.bm-rec-badge-featured {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    z-index: 2;
}

/* ==========================================================================
   Collections & Categories Showcase (Modern, Nature-Inspired, Mobile-First)
   ========================================================================== */
.bm-collections-showcase {
    margin-bottom: 24px;
    position: relative;
}

.bm-collections-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.bm-collections-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bla-cat-header-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ecfdf5 0%, #e0f2fe 100%);
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.1);
}

.bm-collections-title {
    font-family: var(--bm-font-heading, 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.25;
}

.bm-collections-count {
    font-size: 11.5px;
    font-weight: 600;
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 3px 9px;
    border-radius: 9999px;
    white-space: nowrap;
}

.bm-cat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Quick-Filter Input */
.bm-cat-filter-wrap {
    position: relative;
    display: none;
    align-items: center;
}

.bm-collections-showcase.bm-is-grid .bm-cat-filter-wrap,
.bm-cat-filter-wrap.is-visible {
    display: inline-flex;
}

.bm-cat-filter-icon {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    pointer-events: none;
}

.bm-cat-filter-input {
    height: 32px;
    width: 155px;
    padding: 0 26px 0 30px;
    font-size: 12px;
    font-family: inherit;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    background: #ffffff;
    color: #1e293b;
    outline: none;
    transition: all 0.2s ease;
}

.bm-cat-filter-input:focus {
    width: 185px;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.bm-cat-filter-clear {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.bm-cat-filter-clear:hover {
    color: #475569;
}

/* View Mode Switcher: Carousel vs Grid */
.bm-cat-toggle-view {
    height: 32px;
    padding: 0 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bm-cat-toggle-view:hover {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.1);
}

.bm-cat-toggle-view:active {
    transform: translateY(0);
}

/* Desktop Scroll Arrows */
.bm-cat-header-nav {
    display: none;
    align-items: center;
    gap: 6px;
}

@media (min-width: 640px) {
    .bm-cat-header-nav {
        display: inline-flex;
    }
    .bm-collections-showcase.bm-is-grid .bm-cat-header-nav {
        display: none;
    }
}

.bm-cat-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bm-cat-nav-btn:hover {
    background: #f0fdf4;
    border-color: #86efac;
    color: #059669;
    transform: scale(1.05);
}

.bm-cat-nav-btn:active {
    transform: scale(0.95);
}

/* Track & Scroll Wrapper with Smooth Fade Edges */
.bm-cat-track-wrapper {
    position: relative;
    margin: 0 -4px;
    padding: 2px 4px;
}

.bm-cat-fade-mask {
    position: absolute;
    top: 2px;
    bottom: 8px;
    width: 28px;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.25s ease;
}

.bm-cat-fade-mask.bm-fade-left {
    left: 0;
    background: linear-gradient(90deg, #ffffff 10%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
}

.bm-cat-fade-mask.bm-fade-right {
    right: 0;
    background: linear-gradient(270deg, #ffffff 10%, rgba(255, 255, 255, 0) 100%);
    opacity: 1;
}

.bm-cat-track-wrapper.has-scroll-left .bm-fade-left {
    opacity: 1;
}

.bm-cat-track-wrapper.is-scroll-end .bm-fade-right {
    opacity: 0;
}

.bm-collections-showcase.bm-is-grid .bm-cat-fade-mask {
    display: none;
}

/* Categories Track (Default Horizontal Mode) */
.bm-collections-cards-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding: 3px 2px 10px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    margin: 0;
}

.bm-collections-cards-grid::-webkit-scrollbar {
    display: none;
}

.bm-collections-cards-grid.is-dragging {
    cursor: grabbing !important;
    cursor: -webkit-grabbing !important;
    user-select: none;
    scroll-snap-type: none;
}

/* Grid View Mode */
.bm-collections-showcase.bm-is-grid .bm-collections-cards-grid,
.bm-collections-cards-grid.bm-is-grid-view {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 12px !important;
    overflow-x: visible !important;
    scroll-snap-type: none !important;
    cursor: default !important;
    padding-bottom: 4px !important;
}

/* Modern Nature-Inspired Category Card */
.bm-collection-card {
    flex: 0 0 auto;
    min-width: 175px;
    max-width: 260px;
    height: 54px;
    scroll-snap-align: start;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    outline: none;
    position: relative;
}

.bm-collections-showcase.bm-is-grid .bm-collection-card,
.bm-collections-cards-grid.bm-is-grid-view .bm-collection-card {
    flex: initial !important;
    width: 100% !important;
    max-width: none !important;
    height: 56px !important;
}

.bm-collection-card:hover {
    border-color: #38bdf8;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.14);
}

.bm-collection-card:active {
    transform: scale(0.98);
}

/* Active State */
.bm-collection-card.active,
.bm-collection-card.is-active {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%) !important;
    border-color: #10b981 !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.18) !important;
}

/* Squircle Icon Wrap */
.bm-col-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bm-collection-card:hover .bm-col-card-icon {
    transform: scale(1.08);
}

/* Nature Palette Tones */
.bm-col-tone-all,
.bm-col-tone-sky,
.bla-cat-tone-sky {
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.bm-col-tone-mint,
.bla-cat-tone-mint {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.bm-col-tone-teal,
.bla-cat-tone-teal {
    background: #f0fdfa;
    color: #0d9488;
    border: 1px solid #99f6e4;
}

.bm-col-tone-emerald,
.bla-cat-tone-emerald {
    background: #e8f5e9;
    color: #15803d;
    border: 1px solid #a5d6a7;
}

.bm-col-tone-sage,
.bla-cat-tone-sage {
    background: #f4f7f4;
    color: #2d6a4f;
    border: 1px solid #d1e0d3;
}

.bm-col-tone-warm,
.bla-cat-tone-warm {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

/* Card Details */
.bm-col-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.bm-col-card-name {
    font-family: var(--bm-font-heading, 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-collections-showcase.bm-is-grid .bm-col-card-name,
.bm-collections-cards-grid.bm-is-grid-view .bm-col-card-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.bm-collection-card.active .bm-col-card-name,
.bm-collection-card.is-active .bm-col-card-name {
    color: #064e3b;
    font-weight: 700;
}

.bm-col-card-badge {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    padding: 1px 7px;
    border-radius: 9999px;
    width: fit-content;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.bm-collection-card.active .bm-col-card-badge,
.bm-collection-card.is-active .bm-col-card-badge {
    background: #dcfce7;
    color: #166534;
    font-weight: 600;
}

/* Active Indicator Check Circle */
.bm-col-card-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bm-collection-card.active .bm-col-card-check,
.bm-collection-card.is-active .bm-col-card-check {
    opacity: 1;
    transform: scale(1);
}

/* No Results Notice */
.bm-cat-no-results {
    padding: 18px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    margin-top: 8px;
}

/* Dark Theme Support */
body.bla-theme-dark .bm-collections-showcase .bla-cat-header-icon {
    background: #1e293b;
    color: #34d399;
    box-shadow: none;
}

body.bla-theme-dark .bm-collections-showcase .bm-collections-title {
    color: #f8fafc;
}

body.bla-theme-dark .bm-collections-showcase .bm-collections-count {
    background: #064e3b;
    border-color: #047857;
    color: #6ee7b7;
}

body.bla-theme-dark .bm-collections-showcase .bm-cat-toggle-view,
body.bla-theme-dark .bm-collections-showcase .bm-cat-nav-btn {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

body.bla-theme-dark .bm-collections-showcase .bm-cat-toggle-view:hover,
body.bla-theme-dark .bm-collections-showcase .bm-cat-nav-btn:hover {
    background: #0f172a;
    border-color: #38bdf8;
    color: #38bdf8;
}

body.bla-theme-dark .bm-collections-showcase .bm-cat-filter-input {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

body.bla-theme-dark .bm-collections-showcase .bm-fade-left {
    background: linear-gradient(90deg, #0f172a 10%, rgba(15, 23, 42, 0) 100%);
}

body.bla-theme-dark .bm-collections-showcase .bm-fade-right {
    background: linear-gradient(270deg, #0f172a 10%, rgba(15, 23, 42, 0) 100%);
}

body.bla-theme-dark .bm-collections-showcase .bm-collection-card {
    background: #1e293b;
    border-color: #334155;
}

body.bla-theme-dark .bm-collections-showcase .bm-collection-card:hover {
    border-color: #38bdf8;
    background: #243248;
}

body.bla-theme-dark .bm-collections-showcase .bm-collection-card.active,
body.bla-theme-dark .bm-collections-showcase .bm-collection-card.is-active {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%) !important;
    border-color: #10b981 !important;
}

body.bla-theme-dark .bm-collections-showcase .bm-col-card-name {
    color: #f8fafc;
}

body.bla-theme-dark .bm-collections-showcase .bm-collection-card.active .bm-col-card-name,
body.bla-theme-dark .bm-collections-showcase .bm-collection-card.is-active .bm-col-card-name {
    color: #a7f3d0;
}

body.bla-theme-dark .bm-collections-showcase .bm-col-card-badge {
    background: #334155;
    color: #94a3b8;
}

body.bla-theme-dark .bm-collections-showcase .bm-collection-card.active .bm-col-card-badge,
body.bla-theme-dark .bm-collections-showcase .bm-collection-card.is-active .bm-col-card-badge {
    background: #047857;
    color: #ecfdf5;
}

/* Controls Bar */
.bm-controls-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 25px;
}

.bm-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.bm-select {
    height: 38px;
    padding: 0 12px;
    border-radius: var(--bm-radius-sm);
    border: 1px solid var(--bm-slate-200);
    background-color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    color: var(--bm-slate-800);
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;

    /* Constrain width so long options never break layout */
    max-width: 220px;
    min-width: 120px;
    width: auto;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.bm-select:hover {
    border-color: var(--bm-slate-300);
}

.bm-select:focus {
    border-color: var(--bm-blue-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

#bm-filter-collection {
    max-width: 180px;
}

#bm-filter-author {
    max-width: 210px;
}

#bm-filter-format {
    max-width: 140px;
    min-width: 110px;
}

#bm-filter-sort {
    max-width: 175px;
    min-width: 135px;
}

.bm-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .bm-controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .bm-filter-group {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 8px;
        width: 100%;
    }

    .bm-select,
    #bm-filter-collection,
    #bm-filter-author,
    #bm-filter-format,
    #bm-filter-sort {
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }

    .bm-toolbar-actions {
        justify-content: space-between;
        width: 100%;
    }
}

.bm-template-switch {
    display: inline-flex;
    gap: 3px;
    background: var(--bm-slate-100);
    padding: 3px;
    border-radius: var(--bm-radius-sm);
}

.bm-template-btn {
    background: none;
    border: none;
    padding: 6px 11px;
    border-radius: 6px;
    color: var(--bm-slate-600);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    line-height: 1;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.bm-template-btn:hover {
    color: var(--bm-slate-900);
}

.bm-template-btn.active {
    background: #ffffff;
    color: var(--bm-green-700);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

@media (max-width: 520px) {
    .bm-template-btn-label {
        display: none;
    }
    .bm-template-btn {
        padding: 6px 8px;
    }
}

.bm-view-switch {
    display: flex;
    gap: 4px;
    background: var(--bm-slate-100);
    padding: 3px;
    border-radius: var(--bm-radius-sm);
}

.bm-view-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 6px;
    color: var(--bm-slate-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bm-view-btn.active {
    background: #ffffff;
    color: var(--bm-green-700);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Hide grid/list switcher when in covers-only template mode */
.bm-template-covers ~ .bm-controls-bar .bm-view-switch,
#bm-catalog-app[data-template="covers"] .bm-view-switch {
    display: none !important;
}

/* Books Grid (Mobile First) */
.bm-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
    gap: 16px;
}

@media (min-width: 640px) {
    .bm-hero-title { font-size: 32px; }
    .bm-hero-subtitle { font-size: 16px; }
    .bm-books-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr));
        gap: 24px;
    }
}

/* Dedicated Theme Desktop 4 Full Rows Responsive Grid */
body.bm-dedicated-theme-active .bm-books-grid,
body.theme-book-library-app .bm-books-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 640px) {
    body.bm-dedicated-theme-active .bm-books-grid,
    body.theme-book-library-app .bm-books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 960px) {
    body.bm-dedicated-theme-active .bm-books-grid,
    body.theme-book-library-app .bm-books-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 22px;
    }
}

@media (min-width: 1260px) {
    body.bm-dedicated-theme-active .bm-books-grid,
    body.theme-book-library-app .bm-books-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 24px;
    }
}

@media (min-width: 1600px) {
    body.bm-dedicated-theme-active .bm-books-grid,
    body.theme-book-library-app .bm-books-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 24px;
    }
}

@media (min-width: 1980px) {
    body.bm-dedicated-theme-active .bm-books-grid,
    body.theme-book-library-app .bm-books-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 26px;
    }
}

/* Dedicated Theme Covers-Only Grid */
body.bm-dedicated-theme-active .bm-template-covers.bm-books-grid,
body.theme-book-library-app .bm-template-covers.bm-books-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (min-width: 640px) {
    body.bm-dedicated-theme-active .bm-template-covers.bm-books-grid,
    body.theme-book-library-app .bm-template-covers.bm-books-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

@media (min-width: 960px) {
    body.bm-dedicated-theme-active .bm-template-covers.bm-books-grid,
    body.theme-book-library-app .bm-template-covers.bm-books-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 18px;
    }
}

@media (min-width: 1260px) {
    body.bm-dedicated-theme-active .bm-template-covers.bm-books-grid,
    body.theme-book-library-app .bm-template-covers.bm-books-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1600px) {
    body.bm-dedicated-theme-active .bm-template-covers.bm-books-grid,
    body.theme-book-library-app .bm-template-covers.bm-books-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 22px;
    }
}

@media (min-width: 1980px) {
    body.bm-dedicated-theme-active .bm-template-covers.bm-books-grid,
    body.theme-book-library-app .bm-template-covers.bm-books-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 24px;
    }
}

/* Suppress Hero Banner when dedicated theme is active */
body.bm-dedicated-theme-active .bm-hero-banner,
body.theme-book-library-app .bm-hero-banner {
    display: none !important;
}

/* Book Card */
.bm-card-book {
    background: #ffffff;
    border-radius: var(--bm-radius);
    overflow: hidden;
    border: 1px solid var(--bm-slate-200);
    box-shadow: var(--bm-shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

.bm-card-book:hover {
    transform: translateY(-4px);
    box-shadow: var(--bm-shadow-hover);
    border-color: var(--bm-green-200);
}

.bm-card-cover-wrap {
    position: relative;
    width: 100%;
    padding-top: 142%; /* Balanced aspect ratio matching book covers */
    background: var(--bm-slate-100, #f1f5f9);
    overflow: hidden;
}

.bm-card-cover-wrap img,
.bm-card-cover-wrap .bm-card-cover-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: top center !important;
    display: block !important;
    transition: transform 0.3s ease;
}

.bm-card-book:hover .bm-card-cover-wrap img {
    transform: scale(1.03);
}

.bm-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 9999px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2;
}

.bm-card-body {
    min-width: 0;
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.bm-card-title {
    overflow-wrap: anywhere;
    font-family: var(--bm-font-heading);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bm-card-author {
    font-size: 12px;
    color: var(--bm-slate-600);
    margin: 0 0 10px 0;
}

.bm-card-footer {
    flex-wrap: wrap;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--bm-slate-100);
}

.bm-btn-read-now {
    background: var(--bm-green-50);
    color: var(--bm-green-700);
    border: 1px solid var(--bm-green-200);
    padding: 5px 10px;
    border-radius: var(--bm-radius-sm);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s, color 0.2s;
}

.bm-btn-read-now:hover {
    background: var(--bm-green-600);
    color: #ffffff;
    border-color: var(--bm-green-600);
}

.bm-btn-read-now.bm-btn-locked {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.bm-btn-read-now.bm-btn-locked:hover {
    background: #f1f5f9;
    color: #334155;
    border-color: #94a3b8;
}

.bm-btn-read-now.bm-btn-download-direct {
    background: #f0fdf4;
    color: #15803d;
    border-color: #86efac;
}

.bm-btn-read-now.bm-btn-download-direct:hover {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}

/* List View */
.bm-books-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.bm-books-list .bm-card-book {
    flex-direction: row;
    min-height: 140px;
}
.bm-books-list .bm-card-cover-wrap {
    width: 100px;
    min-width: 100px;
    padding-top: 0;
    height: 140px;
}

/* ==========================================================================
   Covers-Only Template (Galerie Coperți Minimalistă)
   ========================================================================== */
.bm-template-covers.bm-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr));
    gap: 14px;
}

@media (min-width: 640px) {
    .bm-template-covers.bm-books-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
        gap: 18px;
    }
}

@media (min-width: 1024px) {
    .bm-template-covers.bm-books-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 22px;
    }
}

/* Cover Card Item */
.bm-cover-book {
    position: relative;
    border-radius: var(--bm-radius);
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--bm-shadow);
    border: 1px solid var(--bm-slate-200);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.bm-cover-book:hover,
.bm-cover-book:focus-within {
    transform: translateY(-4px) scale(1.015);
    box-shadow: var(--bm-shadow-hover);
    border-color: var(--bm-green-300);
}

.bm-cover-wrap {
    display: block;
    position: relative;
    width: 100%;
    padding-top: 142%; /* Balanced aspect ratio matching book covers */
    background: var(--bm-slate-100, #f1f5f9);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.bm-cover-wrap img,
.bm-cover-wrap .bm-cover-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: top center !important;
    display: block !important;
    transition: transform 0.4s ease;
}

.bm-cover-book:hover .bm-cover-wrap img {
    transform: scale(1.06);
}

/* Star Rating Badge */
.bm-cover-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fbbf24;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9999px;
    z-index: 2;
    line-height: 1.3;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Hover/Focus Info Overlay */
.bm-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(15, 23, 42, 0.94) 0%,
        rgba(15, 23, 42, 0.72) 48%,
        rgba(15, 23, 42, 0.15) 80%,
        rgba(15, 23, 42, 0) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px 12px;
    opacity: 0;
    transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 3;
    pointer-events: none;
}

.bm-cover-book:hover .bm-cover-overlay,
.bm-cover-book:focus-within .bm-cover-overlay {
    opacity: 1;
    pointer-events: auto;
}

.bm-cover-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    transform: translateY(6px);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.bm-cover-book:hover .bm-cover-meta,
.bm-cover-book:focus-within .bm-cover-meta {
    transform: translateY(0);
}

.bm-cover-title {
    font-family: var(--bm-font-heading);
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.bm-cover-author {
    font-size: 11px;
    color: var(--bm-slate-300);
    margin: 0 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-cover-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.bm-cover-btn-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 9px;
    border-radius: var(--bm-radius-sm);
    text-decoration: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.15s ease;
}

.bm-cover-btn-details:hover {
    background: rgba(255, 255, 255, 0.35);
}

.bm-cover-btn-read {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    background: var(--bm-green-600);
    padding: 4px 9px;
    border-radius: var(--bm-radius-sm);
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: background 0.15s ease, transform 0.15s ease;
}

.bm-cover-btn-read:hover {
    background: var(--bm-green-500);
    transform: translateY(-1px);
}

.bm-cover-btn-read.bm-cover-btn-download {
    background: #0284c7;
}

.bm-cover-btn-read.bm-cover-btn-download:hover {
    background: #0369a1;
}

.bm-cover-btn-read.bm-btn-locked {
    background: rgba(255, 255, 255, 0.18);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.bm-cover-btn-read.bm-btn-locked:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

/* Mobile Touch Support for Covers Overlay */
@media (hover: none) {
    .bm-cover-overlay {
        opacity: 0.95;
        background: linear-gradient(
            to top,
            rgba(15, 23, 42, 0.92) 0%,
            rgba(15, 23, 42, 0.6) 40%,
            rgba(15, 23, 42, 0) 100%
        );
        pointer-events: auto;
        padding: 8px;
    }
    .bm-cover-meta {
        transform: translateY(0);
    }
    .bm-cover-title {
        font-size: 11px;
        -webkit-line-clamp: 1;
    }
    .bm-cover-author {
        display: none;
    }
    .bm-cover-actions {
        margin-top: 2px;
    }
    .bm-cover-btn-details,
    .bm-cover-btn-read {
        padding: 3px 6px;
        font-size: 10px;
    }
}

/* ==========================================================================
   Book Detail Page (Modern Nature-Inspired 2-Column Template)
   ========================================================================== */

/* Suppress redundant theme page title (e.g. "Biblioteca Digitală") on single book view */
body.bm-viewing-book div.column-content > h1:first-child,
body.bm-viewing-book div.column-content > h1:first-of-type,
body.bm-viewing-book .single > h1:first-child,
body.bm-viewing-book .entry-title,
body.bm-viewing-book .page-title {
    display: none !important;
}

.bm-detail-container {
    width: 100%;
    margin: 0 0 35px 0;
    font-family: var(--bm-font-main);
    color: var(--bm-slate-800);
}

/* Breadcrumbs */
.bm-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    font-size: 13px;
    color: var(--bm-slate-500);
    flex-wrap: wrap;
}

.bm-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--bm-blue-600);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.bm-back-link:hover {
    color: var(--bm-blue-700);
    text-decoration: underline;
}

.bm-crumb-sep {
    color: var(--bm-slate-300);
    user-select: none;
}

.bm-crumb-current {
    color: var(--bm-slate-600);
    font-weight: 500;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 2-Column Responsive Layout */
.bm-book-layout {
    display: flex;
    flex-direction: column;
    gap: 28px;
    align-items: stretch;
}

@media (min-width: 768px) {
    .bm-book-layout {
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 30px;
        align-items: start;
    }
}

/* LEFT COLUMN: Cover, Actions, Specs */
.bm-book-left-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 768px) {
    .bm-book-left-col {
        position: sticky;
        top: 25px;
    }
}

/* Cover Card */
.bm-cover-card {
    background: #ffffff;
    border-radius: var(--bm-radius);
    overflow: hidden;
    box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
    border: 1px solid var(--bm-slate-200);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bm-cover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px -6px rgba(15, 23, 42, 0.16);
}

.bm-cover-image,
.bm-cover-card img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: 1 / 1.42;
    object-fit: cover !important;
    object-position: top center !important;
    display: block !important;
}

/* Primary Action Buttons */
.bm-primary-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.bm-btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--bm-radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    flex-wrap: wrap;
}

.bm-btn-action-read {
    background: #10b981;
    color: #ffffff !important;
    border: 1px solid #059669;
}

.bm-btn-action-read:hover {
    background: #059669;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
}

.bm-btn-action-download {
    background: #f0fdf4;
    color: #065f46 !important;
    border: 1px solid #bbf7d0;
}

.bm-btn-action-download:hover {
    background: #dcfce7;
    border-color: #86efac;
    color: #047857 !important;
    transform: translateY(-1px);
}

.bm-action-sub {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.1);
    letter-spacing: 0.02em;
}

.bm-btn-action-download .bm-action-sub {
    background: rgba(4, 120, 87, 0.12);
}

.bm-btn-action.bm-btn-locked {
    background: #f8fafc;
    color: #475569 !important;
    border: 1px solid #cbd5e1;
}

.bm-btn-action.bm-btn-locked:hover {
    background: #f1f5f9;
    color: #1e293b !important;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.bm-btn-action.bm-btn-locked .bm-action-sub {
    background: rgba(100, 116, 139, 0.15);
    color: #475569;
}

/* Technical Specifications Panel */
.bm-specs-panel {
    background: #f8fafc;
    border: 1px solid var(--bm-slate-200);
    border-radius: var(--bm-radius-sm);
    padding: 14px 16px;
}

.bm-specs-heading {
    font-family: var(--bm-font-heading);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bm-slate-500);
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--bm-slate-200);
}

.bm-specs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 12px;
}

.bm-specs-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-bottom: 1px dashed #f1f5f9;
    padding-bottom: 5px;
}

.bm-specs-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.bm-spec-label {
    color: var(--bm-slate-500);
}

.bm-spec-value {
    color: var(--bm-slate-800);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.bm-spec-tag {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* RIGHT COLUMN: Book Details & Description */
.bm-book-right-col {
    background: #ffffff;
    border-radius: var(--bm-radius);
    border: 1px solid var(--bm-slate-200);
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04);
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 600px) {
    .bm-book-right-col {
        padding: 18px;
    }
}

.bm-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.bm-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.02em;
}

.bm-pill-lang {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.bm-pill-genre {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.bm-pill-rating {
    background: #fefce8;
    color: #a16207;
    border: 1px solid #fef08a;
}

.bm-book-title {
    font-family: var(--bm-font-heading);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
    margin: 0 0 6px 0;
}

@media (max-width: 600px) {
    .bm-book-title {
        font-size: 22px;
    }
}

.bm-book-subtitle {
    font-size: 15px;
    font-weight: 400;
    color: var(--bm-slate-500);
    margin: 0 0 10px 0;
}

.bm-book-author-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: var(--bm-slate-600);
    margin-top: 4px;
}

.bm-book-author-line svg {
    color: #10b981;
}

.bm-author-name {
    color: #059669;
    font-weight: 600;
}

/* Description Section */
.bm-book-desc-section {
    border-top: 1px solid #f1f5f9;
    padding-top: 18px;
}

.bm-desc-title {
    font-family: var(--bm-font-heading);
    font-size: 17px;
    font-weight: 600;
    color: var(--bm-slate-800);
    margin: 0 0 12px 0;
}

.bm-desc-body {
    font-size: 15px;
    line-height: 1.8;
    color: #334155;
}

.bm-desc-body p {
    margin: 0 0 16px 0;
}

.bm-desc-body p:last-child {
    margin-bottom: 0;
}

/* Other Files Grid */
.bm-other-files-section {
    border-top: 1px solid #f1f5f9;
    padding-top: 18px;
}

.bm-other-files-heading {
    font-family: var(--bm-font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--bm-slate-700);
    margin: 0 0 10px 0;
}

.bm-other-files-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bm-file-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid var(--bm-slate-200);
    border-radius: var(--bm-radius-sm);
    padding: 8px 12px;
}

.bm-file-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bm-file-card-size {
    font-size: 12px;
    color: var(--bm-slate-500);
}

.bm-file-card-actions {
    display: flex;
    gap: 6px;
}

.bm-btn-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease;
}

.bm-btn-mini-read {
    background: #ecfdf5;
    color: #047857 !important;
    border: 1px solid #a7f3d0;
}

.bm-btn-mini-read:hover {
    background: #d1fae5;
}

.bm-btn-mini-download {
    background: #f0f9ff;
    color: #0369a1 !important;
    border: 1px solid #bae6fd;
}

.bm-btn-mini-download:hover {
    background: #e0f2fe;
}

.bm-btn-mini.bm-btn-locked {
    background: #f8fafc;
    color: #64748b !important;
    border: 1px solid #cbd5e1;
}

.bm-btn-mini.bm-btn-locked:hover {
    background: #f1f5f9;
    color: #334155 !important;
    border-color: #94a3b8;
}

/* Books Wrapper & Smooth Loading */
#bm-books-wrapper {
    position: relative;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#bm-books-wrapper.bm-is-loading {
    opacity: 0.55;
    pointer-events: none;
    user-select: none;
}

.bm-loading-bar {
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #bbf7d0 0%, #38bdf8 50%, #22c55e 100%);
    background-size: 200% 100%;
    border-radius: 9999px;
    animation: bm-bar-slide 1.2s infinite ease-in-out;
    z-index: 10;
}

@keyframes bm-bar-slide {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.bm-card-book {
    animation: bmCardFade 0.25s ease-out;
}

@keyframes bmCardFade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner */
.bm-loading-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}
.bm-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--bm-green-100);
    border-top-color: var(--bm-green-600);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: bm-spin 0.8s linear infinite;
}
@keyframes bm-spin {
    to { transform: rotate(360deg); }
}

/* Pagination - Nature Minimalist Styling */
.bm-pagination {
    margin-top: 35px;
    padding: 20px 0 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--bm-slate-200);
}

.bm-pagination-info {
    font-size: 13px;
    color: var(--bm-slate-600);
    font-weight: 500;
}

.bm-pagination-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.bm-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: var(--bm-radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--bm-slate-800);
    background: #ffffff;
    border: 1px solid var(--bm-slate-200);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    user-select: none;
    font-family: var(--bm-font-main);
}

.bm-page-link:hover:not(.disabled):not(.active) {
    background: var(--bm-green-50);
    color: var(--bm-green-700);
    border-color: var(--bm-green-200);
    transform: translateY(-1px);
}

.bm-page-link.active {
    background: var(--bm-green-600);
    color: #ffffff;
    border-color: var(--bm-green-600);
    font-weight: 600;
    cursor: default;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.bm-page-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bm-slate-50);
    border-color: var(--bm-slate-200);
    color: var(--bm-slate-600);
}

.bm-page-prev, .bm-page-next {
    padding: 0 14px;
    font-weight: 500;
}

.bm-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 38px;
    color: var(--bm-slate-600);
    font-size: 14px;
    user-select: none;
}

@media (max-width: 600px) {
    .bm-pagination {
        margin-top: 25px;
        padding: 15px 0 5px;
    }
    .bm-page-link {
        min-width: 34px;
        height: 34px;
        font-size: 12.5px;
        padding: 0 8px;
    }
    .bm-page-prev, .bm-page-next {
        padding: 0 10px;
    }
}

/* ==========================================================================
   IMMUNITY AGAINST THEME CSS OVERRIDES (e.g. #content div img { height: auto })
   ========================================================================== */
#content .bm-cover-wrap,
#content .bm-card-cover-wrap,
#content .bm-rec-cover-box {
    background: var(--bm-slate-100, #f1f5f9) !important;
}

#content .bm-cover-wrap img,
#content .bm-card-cover-wrap img,
#content .bm-rec-cover-box img,
.entry-content .bm-cover-wrap img,
.entry-content .bm-card-cover-wrap img,
.entry-content .bm-rec-cover-box img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: top center !important;
    display: block !important;
}

/* ==========================================================================
   Issue Reporting Modal & Buttons (Nature-inspired, Mobile-first)
   ========================================================================== */
.bm-specs-report-action {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    text-align: center;
}

.bm-btn-report-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 12px;
    color: #64748b;
    font-size: 12px;
    font-family: var(--bm-font-sans, 'Inter', sans-serif);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.bm-btn-report-trigger:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0284c7;
}

.bm-btn-report-trigger svg {
    color: #94a3b8;
    transition: color 0.2s ease;
}

.bm-btn-report-trigger:hover svg {
    color: #0284c7;
}

/* Modal Overlay */
.bm-report-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.bm-report-modal-dialog {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    font-family: var(--bm-font-sans, 'Inter', sans-serif);
    animation: bmModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bmModalPop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bm-report-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f1f5f9;
}

.bm-report-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bm-report-header-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #e0f2fe;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bm-report-modal-title {
    font-family: var(--bm-font-heading, 'Poppins', sans-serif);
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.bm-report-modal-subtitle {
    font-size: 12px;
    color: #64748b;
    margin: 3px 0 0;
    line-height: 1.4;
}

.bm-report-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.bm-report-modal-close:hover {
    color: #334155;
    background: #f1f5f9;
}

.bm-report-book-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    padding: 10px 20px;
}

.bm-report-book-icon {
    font-size: 18px;
}

.bm-report-book-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bm-report-book-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-report-book-author {
    font-size: 12px;
    color: #64748b;
}

.bm-report-form {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bm-report-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bm-report-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin: 0;
}

.bm-required {
    color: #ef4444;
}

/* Radio Cards */
.bm-report-radio-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bm-report-radio-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.bm-report-radio-card input[type="radio"] {
    margin-top: 3px;
    cursor: pointer;
    accent-color: #0284c7;
}

.bm-report-radio-card:hover {
    border-color: #cbd5e1;
    background: #fafafa;
}

.bm-report-radio-card:has(input[type="radio"]:checked) {
    border-color: #0284c7;
    background: #f0f9ff;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.08);
}

.bm-radio-card-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bm-radio-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.bm-radio-card-title svg {
    color: #0284c7;
    flex-shrink: 0;
}

.bm-radio-card-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}

/* Form Controls */
.bm-report-select,
.bm-report-input,
.bm-report-textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bm-report-select:focus,
.bm-report-input:focus,
.bm-report-textarea:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.bm-report-textarea {
    resize: vertical;
    min-height: 72px;
    line-height: 1.5;
}

.bm-report-logged-user {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bm-report-user-email {
    color: #94a3b8;
}

.bm-report-inputs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 480px) {
    .bm-report-inputs-row {
        grid-template-columns: 1fr;
    }
}

.bm-report-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Notice Box */
.bm-report-notice {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.bm-report-notice.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.bm-report-notice.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Modal Footer */
.bm-report-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.bm-btn-report-cancel {
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bm-btn-report-cancel:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.bm-btn-report-submit {
    background: #059669;
    border: 1px solid #047857;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2);
}

.bm-btn-report-submit:hover {
    background: #047857;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3);
}

.bm-btn-report-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.bm-spin-icon {
    animation: bmSpin 1s linear infinite;
}

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

/* Keep the catalog usable inside narrow WordPress columns and on touch screens. */
.bm-catalog-container *, .bm-detail-container * {
    box-sizing: border-box;
}

#bm-books-wrapper > *, .bm-filter-group, .bm-book-left-col, .bm-book-right-col {
    min-width: 0;
}

.bm-catalog-container .bm-select {
    max-width: 100%;
    min-width: 0;
    text-overflow: ellipsis;
}

/* Book covers contain text: preserve the whole image instead of cropping it. */
.bm-catalog-container .bm-card-cover-wrap img,
.bm-catalog-container .bm-cover-wrap img,
.bm-detail-container .bm-cover-image {
    object-fit: contain !important;
    object-position: center !important;
    background: var(--bm-slate-50);
}

.bm-card-author, .bm-book-title, .bm-book-subtitle, .bm-author-name,
.bm-spec-value, .bm-desc-body, .bm-file-card-meta {
    overflow-wrap: anywhere;
}

.bm-book-author-line, .bm-file-card, .bm-file-card-meta, .bm-file-card-actions {
    flex-wrap: wrap;
}

.bm-book-author-line svg, .bm-btn-read-now svg {
    flex-shrink: 0;
}

.bm-desc-body img, .bm-desc-body video, .bm-desc-body iframe {
    max-width: 100%;
}

.bm-desc-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.bm-desc-body pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.bm-books-list .bm-card-body {
    padding: 12px;
}

.bm-books-list .bm-card-cover-wrap {
    align-self: flex-start;
    flex-shrink: 0;
}

.bm-loading-state {
    grid-column: 1 / -1;
    width: 100%;
}

.bm-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.bm-catalog-container :is(a, button, input, select):focus-visible,
.bm-detail-container :is(a, button):focus-visible {
    outline: 3px solid var(--bm-blue-600);
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .bm-detail-container .bm-cover-card {
        width: min(100%, 220px);
        align-self: center;
    }
    .bm-book-left-col {
        position: static;
    }
    .bm-detail-container .bm-primary-actions {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .bm-catalog-container .bm-filter-group {
        width: 100%;
        flex-wrap: wrap;
    }
    .bm-catalog-container .bm-select {
        flex: 1 1 140px;
        width: 100%;
        min-height: 44px;
        font-size: 16px;
    }
    .bm-search-box input {
        min-height: 44px;
        font-size: 16px;
    }
    .bm-card-footer > div {
        width: 100%;
    }
    .bm-card-footer .bm-btn-read-now {
        justify-content: center;
        min-height: 40px;
        flex: 1 1 auto;
    }
    .bm-catalog-container .bm-page-link,
    .bm-catalog-container .bm-view-btn,
    .bm-catalog-container .bm-template-btn {
        min-width: 44px;
        min-height: 44px;
    }
    .bm-books-list .bm-card-cover-wrap {
        width: 80px;
        min-width: 80px;
        height: 114px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bm-catalog-container *, .bm-detail-container * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

