/**
 * Template 2 — Books & Monographs Stylesheet
 * Matches the reference design with dark blue hero banner, stat pills,
 * real-time search, and clean white horizontal book cards.
 */

:root {
    --navy-darkest: #03142a;
    --navy-darker: #041a38;
    --navy-dark: #06234b;
    --navy-blue: #0a3164;
    --teal-bright: #00d2c4;
    --teal-primary: #0d9488;
    --teal-hover: #0f766e;
    --teal-pill-bg: rgba(6, 48, 77, 0.75);
    --teal-pill-border: rgba(0, 210, 196, 0.45);
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --text-dark: #0f172a;
    --text-title: #1e3a8a;
    --text-body: #334155;
    --text-muted: #64748b;
    --border-card: #e2e8f0;
    --red-cart: #ef4444;
    --red-cart-hover: #dc2626;
    --shadow-card: 0 2px 10px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.08);
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   1. HERO BANNER
   ========================================================================== */
.books-hero-banner {
    position: relative;
    min-height: 230px;
    background-color: var(--navy-dark);
    background-image:
        linear-gradient(to right, rgba(3, 20, 42, 0.95) 0%, rgba(4, 26, 56, 0.88) 55%, rgba(6, 35, 75, 0.45) 100%),
        url('../images/books_banner.jpg');
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    padding: 42px 0 48px;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.books-hero-content {
    position: relative;
    z-index: 2;
}

.books-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
}

.books-breadcrumb a {
    color: var(--teal-bright);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.books-breadcrumb a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.books-hero-title {
    font-family: 'Outfit', 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 8px;
}

.books-hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 24px;
    font-weight: 300;
    max-width: 720px;
}

/* Stat Pills matching screenshot */
.books-stats-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.books-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--teal-pill-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--teal-pill-border);
    border-radius: 999px;
    padding: 7px 18px;
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 500;
    transition: all 0.25s ease;
}

.books-stat-pill:hover {
    background: rgba(0, 210, 196, 0.25);
    border-color: var(--teal-bright);
    transform: translateY(-2px);
}

.books-stat-pill i {
    color: var(--teal-bright);
    font-size: 0.95rem;
}

.books-stat-pill strong {
    color: var(--teal-bright);
    font-weight: 700;
}

/* ==========================================================================
   2. MAIN SECTION & TOP BAR
   ========================================================================== */
.books-main-section {
    padding: 38px 0 75px;
}

.books-topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.books-topbar-info h2 {
    font-family: 'Outfit', 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 4px;
}

.books-topbar-info p {
    font-size: 0.92rem;
    color: var(--text-muted);
}

/* Search Box Pill */
.books-search-box {
    position: relative;
    width: 100%;
    max-width: 420px;
}

.books-search-box .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
}

.books-search-input {
    width: 100%;
    height: 46px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 0 42px 0 46px;
    font-size: 0.9rem;
    color: var(--text-dark);
    font-family: inherit;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.books-search-input:focus {
    outline: none;
    border-color: var(--teal-primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}

.books-search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.05rem;
    cursor: pointer;
    display: none;
    padding: 4px;
    border-radius: 50%;
    line-height: 1;
    transition: color 0.2s;
}

.books-search-clear:hover {
    color: #475569;
}

.books-search-clear.visible {
    display: block;
}

/* ==========================================================================
   3. BOOKS LIST & CARD DESIGN
   ========================================================================== */
.books-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.book-card {
    background: var(--card-bg);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

/* Left: Book Cover Thumbnail (UNCROPPED) */
.book-thumb-wrapper {
    flex-shrink: 0;
    width: 125px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.book-thumb-img {
    max-width: 125px;
    max-height: 165px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover .book-thumb-img {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Fallback CSS Book Cover */
.book-thumb-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #093b58 0%, #031e33 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
    position: relative;
}

.book-thumb-fallback .fallback-icon {
    font-size: 1.8rem;
    color: var(--teal-bright);
    margin-bottom: 6px;
}

.book-thumb-fallback .fallback-text {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #cbd5e1;
}

/* Middle: Info Block */
.book-info {
    flex: 1;
    min-width: 0;
}

.book-title {
    font-family: 'Outfit', 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-title);
    line-height: 1.4;
    margin-bottom: 10px;
    text-decoration: none;
    display: block;
    transition: color 0.2s;
}

.book-title:hover {
    color: var(--teal-primary);
}

.book-meta-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.book-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.45;
}

.book-meta-icon {
    width: 16px;
    color: #64748b;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 3px;
    text-align: center;
}

.book-meta-text {
    word-break: break-word;
}

.book-meta-text strong {
    color: #1e293b;
    font-weight: 600;
}

/* Right: Action Area */
.book-action {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    padding-left: 20px;
    border-left: 1px solid #f1f5f9;
    min-width: 140px;
}

.book-buy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--red-cart);
    font-weight: 700;
    font-size: 0.96rem;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    background: transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.book-buy-btn i {
    font-size: 0.95rem;
    transition: transform 0.2s;
}

.book-buy-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    color: var(--red-cart-hover);
    transform: translateX(2px);
}

.book-buy-btn:hover i {
    transform: scale(1.15);
}

/* Optional Download Resource Button */
.book-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--teal-primary);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(13, 148, 136, 0.25);
    background: var(--teal-subtle);
    transition: all 0.2s ease;
}

.book-dl-btn:hover {
    background: var(--teal-primary);
    color: #ffffff;
}

/* ==========================================================================
   4. NO RESULTS / EMPTY STATE
   ========================================================================== */
.books-no-results {
    display: none;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    color: var(--text-muted);
}

.books-no-results.visible {
    display: block;
}

.books-no-results i {
    font-size: 2.8rem;
    color: #94a3b8;
    margin-bottom: 14px;
}

.books-no-results h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.books-no-results p {
    font-size: 0.92rem;
    margin-bottom: 16px;
}

.books-reset-btn {
    background: var(--teal-primary);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 8px 20px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.books-reset-btn:hover {
    background: var(--teal-hover);
}

/* ==========================================================================
   5. RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 992px) {
    .books-hero-title {
        font-size: 2.2rem;
    }

    .books-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .books-search-box {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .books-hero-banner {
        padding: 32px 0 38px;
    }

    .books-hero-title {
        font-size: 1.85rem;
    }

    .books-hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 18px;
    }

    .books-stats-pills {
        gap: 8px;
    }

    .books-stat-pill {
        font-size: 0.8rem;
        padding: 6px 14px;
    }

    .book-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 18px 20px;
    }

    .book-thumb-wrapper {
        width: 130px;
    }

    .book-thumb-img {
        max-width: 130px;
        max-height: 165px;
    }

    .book-action {
        width: 100%;
        border-left: none;
        border-top: 1px solid #f1f5f9;
        padding-left: 0;
        padding-top: 14px;
        flex-direction: row;
        justify-content: flex-start;
    }

    .book-buy-btn {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .books-hero-title {
        font-size: 1.6rem;
    }

    .book-thumb-wrapper {
        width: 95px;
    }

    .book-thumb-img {
        max-width: 95px;
        max-height: 130px;
    }

    .book-title {
        font-size: 1.05rem;
    }
}