/* ============================================
   RECOMMENDED BOOKS PAGE — books-style.css
   ============================================ */

/* Page wrapper — same 3-column grid as other pages */
.books-page-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 100px 60px 40px;
    display: grid;
    grid-template-columns: 240px 1fr 320px;
    gap: 50px;
    align-items: start;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.books-main {
    padding: 0 30px;
    min-width: 0; /* prevent grid blowout */
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
}

.page-title {
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.page-subtitle {
    font-size: 18px;
    color: #94a3b8;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================
   FILTERS
   ============================================ */
.filter-section {
    margin-bottom: 16px;
}

.search-bar {
    width: 100%;
    padding: 16px 24px;
    background: rgba(15, 20, 25, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    color: #ffffff;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
    margin-bottom: 20px;
    font-family: inherit;
}

.search-bar:focus {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.search-bar::placeholder {
    color: #64748b;
}

/* Category buttons */
.category-buttons-container {
    margin-top: 20px;
    margin-bottom: 12px;
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-btn {
    background: linear-gradient(135deg, rgba(20, 15, 50, 0.8) 0%, rgba(30, 20, 70, 0.7) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 10px 18px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: inherit;
}

.category-btn:hover {
    background: linear-gradient(135deg, rgba(20, 15, 50, 0.9) 0%, rgba(30, 20, 70, 0.8) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

.category-btn.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(124, 58, 237, 0.3) 100%);
    border-color: rgba(102, 126, 234, 0.6);
}

.category-btn.view-more {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
    border-color: rgba(102, 126, 234, 0.4);
}

.category-btn.hidden {
    display: none;
}

/* ============================================
   AFFILIATE DISCLAIMER
   ============================================ */
.books-disclaimer {
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    margin-bottom: 20px;
}

.books-disclaimer p {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Books count */
.books-count {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 30px;
}

.books-count span {
    color: #8b5cf6;
    font-weight: 600;
}

/* ============================================
   BOOK CARDS
   ============================================ */
.book-grid {
    display: grid;
    gap: 24px;
}

.book-card {
    background: rgba(15, 20, 25, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 32px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 28px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.4), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.book-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.15);
}

.book-card:hover::before {
    opacity: 1;
}

/* Book cover/spine */
.book-spine {
    width: 110px;
    min-width: 110px;
    height: 160px;
    border-radius: 2px 10px 10px 2px;
    position: relative;
    box-shadow: -5px 5px 18px rgba(0, 0, 0, 0.6);
    flex-shrink: 0;
    align-self: center;
    overflow: hidden;
    background: #1a1d29;
}

.book-spine img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px 8px 8px 2px;
    display: block;
}

.book-spine.no-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #2d1b69, #6366f1);
}

.book-spine.no-cover svg {
    width: 44px;
    height: 44px;
    fill: none;
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Book content */
.book-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.book-number {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.book-title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
}

.book-author {
    font-size: 14px;
    color: #64748b;
    font-style: italic;
}

.book-divider {
    height: 1px;
    background: rgba(99, 102, 241, 0.15);
    margin: 4px 0;
}

/* Article source block */
.book-article-link {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 10px;
}

.book-article-link-icon {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-top: 2px;
}

.book-article-link-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #6366f1;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.book-article-link-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.book-article-label {
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.book-article-label a {
    color: #6366f1;
    text-decoration: none;
    transition: color 0.2s;
}

.book-article-label a:hover {
    color: #a78bfa;
}

.book-article-title {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
}

/* Why read */
.book-why {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.75;
}

/* Buy button row */
.book-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 4px;
}

.book-buy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 10px;
    padding: 10px 20px;
    color: #a78bfa;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.book-buy-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(99, 102, 241, 0.25));
    border-color: rgba(139, 92, 246, 0.7);
    color: #c4b5fd;
    transform: translateY(-1px);
}

.book-buy-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s;
}

.book-buy-btn:hover svg {
    transform: translateX(2px);
}

/* ============================================
   NO RESULTS
   ============================================ */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #475569;
    display: none;
}

.no-results svg {
    width: 48px;
    height: 48px;
    stroke: #475569;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-bottom: 16px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.no-results p {
    font-size: 15px;
}

/* ============================================
   LOADING STATE (AJAX)
   ============================================ */
.books-loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
    display: none;
}

.books-loading.active {
    display: block;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media ( max-width: 1200px ) {
    .books-page-wrapper {
        grid-template-columns: 200px 1fr 280px;
        gap: 30px;
        padding: 100px 30px 40px;
    }
}

@media ( max-width: 1024px ) {
    .books-page-wrapper {
        grid-template-columns: 1fr;
        padding: 90px 20px 40px;
    }

    .books-page-wrapper .sidebar-left,
    .books-page-wrapper .sidebar-right {
        display: none;
    }

    .books-main {
        padding: 0;
    }

    .page-title {
        font-size: 36px;
    }

    .page-subtitle {
        font-size: 15px;
    }
}

@media ( max-width: 640px ) {
    .book-card {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .book-spine {
        width: 90px;
        height: 130px;
        margin: 0 auto;
    }

    .book-title {
        font-size: 18px;
    }

    .books-page-wrapper {
        padding: 80px 16px 30px;
    }
}