/* ===== أنماط صفحة المكتبة العلمية ===== */

.header-lib {
    background: var(--primary-gradient);
    color: white;
    padding: 28px 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.subtitle {
    font-size: 1.08rem;
    color: rgba(255,255,255,0.92);
    margin: 10px 0 0;
    line-height: 1.8;
}

.search-container {
    padding: 18px;
    margin-bottom: 24px;
}

.library-content-full {
    width: 100%;
}

.library-topbar {
    flex-wrap: wrap;
    gap: 10px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 22px;
}

.book-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.book-card:hover {
    transform: translateY(-7px);
}

.cover-container {
    height: 290px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
}

.cover-container img {
    width: auto;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    background: #ffffff;
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.12);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.book-card:hover .cover-container img {
    transform: scale(1.02);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.18);
}

.cover-container img[src^="data:image/svg+xml"] {
    object-fit: contain;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.cover-container::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-bottom: 1px solid rgba(15,23,42,.04);
}

.book-info {
    padding: 16px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.author-tag {
    font-size: 0.84rem;
    padding: 6px 12px;
    display: inline-block;
    align-self: center;
    line-height: 1.5;
    max-width: 100%;
    word-break: break-word;
    text-align: center;
}

.book-title {
    font-size: 1.08rem;
    margin: 0;
    line-height: 1.65;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.65em * 3);
}

.book-meta {
    font-size: 0.92rem;
    line-height: 1.8;
    margin-top: 2px;
    min-height: 48px;
    text-align: center;
}

.book-footer {
    padding-top: 10px;
}

.book-footer .btn {
    padding: 12px 18px;
    font-weight: 700;
    width: 100%;
    justify-content: center;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--border-light);
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.load-more-container {
    text-align: center;
    margin: 30px 0 10px;
}

.pagination-info {
    font-weight: 700;
    padding: 12px 18px;
}

.load-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 14px 24px;
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    text-decoration: none;
}

.load-more:hover {
    transform: translateY(-3px);
    color: white;
}

.load-more:active {
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.88rem;
}

@media (max-width: 992px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .cover-container {
        height: 270px;
    }
}

@media (max-width: 768px) {
    .header-lib {
        padding: 22px 18px;
    }

    .subtitle {
        font-size: 1rem;
    }

    .search-container {
        padding: 15px;
    }

    .books-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cover-container {
        height: 250px;
        padding: 8px 10px;
    }

    .cover-container img {
        padding: 4px;
        border-radius: 10px;
    }

    .book-info {
        padding: 15px 16px 18px;
    }

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

    .book-meta {
        font-size: 0.9rem;
        min-height: auto;
    }

    .pagination-info,
    .load-more {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 420px) {
    .cover-container {
        height: 235px;
    }

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

    .author-tag {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    .book-info {
        padding: 14px 14px 16px;
    }
}
