/* ---- Filter bar ---- */
.books-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 24px;
    align-items: flex-end;
    margin-bottom: 20px;
}
.books-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.books-filter-group label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #555;
}
.books-filter-group select,
#bt-search {
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    color: #222;
    background: #fff;
    outline: none;
    transition: border-color .2s;
}
.books-filter-group select:focus,
#bt-search:focus {
    border-color: #4a9d8f;
}
.books-filter-group select { min-width: 170px; cursor: pointer; }
.bt-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
#bt-search { width: 280px; padding-right: 36px; }
#bt-search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #999;
    padding: 0;
    line-height: 1;
    display: none;
}
#bt-search-clear:hover { color: #333; }

/* ---- Table ---- */
.books-table-wrapper { overflow-x: auto; }
.books-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.books-table thead tr {
    background: #2c7a6e;
    color: #fff;
}
.books-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
.books-table tbody tr {
    border-bottom: 1px solid #e8e8e8;
    transition: background .15s;
}
.books-table tbody tr:hover { background: #f0faf8; }
.books-table td {
    padding: 12px 14px;
    vertical-align: middle;
    color: #333;
}
.book-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.book-title img {
    width: 44px;
    height: 60px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.title-text { line-height: 1.4; font-weight: 500; }

/* ---- Download buttons ---- */
.download-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.download-btn:hover { opacity: .8; }
.pdf-btn {
    background: #2c7a6e;
    color: #fff;
}
.info-btn {
    background: #f0f0f0;
    color: #444;
    border: 1px solid #ccc;
}

/* ---- Reset button ---- */
#bt-reset-btn {
    height: 40px;
    padding: 0 16px;
    border: 1.5px solid #2c7a6e;
    border-radius: 6px;
    background: #fff;
    color: #2c7a6e;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .03em;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
#bt-reset-btn:hover {
    background: #2c7a6e;
    color: #fff;
}
#bt-reset-btn:disabled {
    opacity: .35;
    cursor: default;
    pointer-events: none;
}

/* ---- Loader ---- */
#bt-loader {
    padding: 40px 20px;
    text-align: center;
}
.bt-loader-inner {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #f0faf8;
    border: 1.5px solid #c0e0da;
    border-radius: 8px;
    padding: 14px 28px;
    color: #2c7a6e;
    font-size: 14px;
    font-weight: 600;
}
.bt-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #b2ddd6;
    border-top-color: #2c7a6e;
    border-radius: 50%;
    animation: bt-spin .65s linear infinite;
    flex-shrink: 0;
}
@keyframes bt-spin {
    to { transform: rotate(360deg); }
}

/* ---- No results ---- */
.bt-no-results-msg {
    text-align: center;
    padding: 40px 20px;
    color: #777;
    font-size: 15px;
    border: 1.5px dashed #ddd;
    border-radius: 8px;
    margin: 0;
}

/* ---- Pagination ---- */
.bt-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
}
.bt-pagination button {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1.5px solid #d0d0d0;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
}
.bt-pagination button.is-active {
    background: #2c7a6e;
    border-color: #2c7a6e;
    color: #fff;
    font-weight: 700;
}
.bt-pagination button:disabled {
    opacity: .35;
    cursor: default;
}

/* ---- Intro text ---- */
.books-intro { margin-bottom: 20px; }

/* ---- Download-request popup ---- */
.gdb-bt-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
}
.gdb-bt-popup {
    position: relative;
    background: #fff;
    border-radius: 10px;
    padding: 32px;
    max-width: 460px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}
.gdb-bt-popup h3 {
    margin: 0 0 6px;
    color: #2c7a6e;
}
.gdb-bt-popup-book-title {
    font-style: italic;
    color: #666;
    margin: 0 0 16px;
}
.gdb-bt-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #888;
}
.gdb-bt-popup form p { margin: 0 0 14px; display: flex; flex-direction: column; gap: 5px; }
.gdb-bt-popup form label { font-size: 13px; font-weight: 600; color: #444; }
.gdb-bt-popup form input,
.gdb-bt-popup form textarea {
    padding: 10px 12px;
    border: 1.5px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}
.gdb-bt-popup-submit { width: 100%; justify-content: center; padding: 10px; font-size: 14px; }
.gdb-bt-popup-message { font-size: 13px; padding: 10px; border-radius: 6px; }
.gdb-bt-popup-message.is-error { background: #fdecea; color: #b3261e; }
.gdb-bt-popup-message.is-success { background: #eaf7f2; color: #1e6b52; }

@media (max-width: 600px) {
    #bt-search { width: 100%; }
    .books-filter-bar { flex-direction: column; }
    .book-title { flex-direction: column; align-items: flex-start; }
}
