/* ====== Search and Filter Container ====== */
.search-filter-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    align-items: stretch;
}

/* ====== Search Box ====== */
.search-box {
    flex: 2;
    position: relative;
    min-width: 0;
}

/* ====== Search Form ====== */
.search-form {
    display: flex;
    align-items: center;
    width: 100%;
    background: #ffffff;
    border: 2px solid #e8ecef;
    border-radius: 12px;
    padding: 4px;
    gap: 6px;
    transition: all 0.3s ease;
    height: 54px;
}

.search-form:focus-within {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.search-input {
    flex: 1;
    min-width: 0;
    padding: 0 1rem;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    outline: none;
    color: #2c3e50;
}

.search-input::placeholder {
    color: #95a5a6;
}

.search-button {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.search-button:active {
    transform: translateY(0);
}

.search-button i {
    font-size: 1.1rem;
}

/* ====== Search Results Dropdown ====== */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
.search-results-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-results-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.search-results-dropdown::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 10px;
}

.search-results-dropdown::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}

/* Result Item */
.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: #f8fdf9;
    padding-left: 1.3rem;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-cover {
    width: 50px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-result-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-cover-small {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0, #f8f8f8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #aaa;
    text-align: center;
}

.search-result-info h4 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 600;
}

.search-result-author {
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* ====== Category Filter ====== */
.category-filter {
    flex: 1;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e8ecef;
    border-radius: 12px;
    padding: 4px;
    gap: 6px;
    transition: all 0.3s ease;
    height: 54px;
    min-width: 0;
}

.category-filter:focus-within {
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.category-select {
    flex: 1;
    min-width: 0;
    padding: 0 1rem;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    color: #2c3e50;
}

.category-select:focus {
    outline: none;
}

.filter-button {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #2196F3 0%, #42A5F5 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.filter-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.filter-button:active {
    transform: translateY(0);
}

.filter-button i {
    font-size: 1.1rem;
}

/* ====== No Results ====== */
.no-results {
    padding: 1.5rem;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* ====== Books Grid ====== */
.books-by-category {
    margin: 2rem 0;
}

.category-section {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #4CAF50;
    color: #2c3e50;
    font-weight: 700;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.book-card-link {
    text-decoration: none;
    color: inherit;
}

.book-card {
    border: 1px solid #e8ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #4CAF50;
}

.book-cover {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    overflow: hidden;
}

.book-cover img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.08);
}

.no-cover {
    color: #bdc3c7;
    font-style: italic;
    font-size: 0.9rem;
}

.book-info {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.book-info h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: #2c3e50;
    font-weight: 600;
    line-height: 1.4;
}

.book-author {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin: 0 0 0.7rem;
}

.book-description {
    color: #5a6c7d;
    font-size: 0.88rem;
    margin: 0 0 1rem;
    flex-grow: 1;
    line-height: 1.5;
}

.book-prices {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    flex-wrap: wrap;
}

.price-tag {
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.price-tag.pdf {
    background-color: #e3f2fd;
    color: #1976d2;
}

.price-tag.print {
    background-color: #e8f5e9;
    color: #388e3c;
}

.no-books {
    text-align: center;
    padding: 3rem;
    color: #95a5a6;
    grid-column: 1 / -1;
    font-size: 1.1rem;
}

/* قسم عدد المشاهدات */
.book-views {
    display: flex;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
    color: #7f8c8d;
    font-size: 0.85rem;
}

.book-views i {
    color: #4CAF50;
    margin-right: 5px;
}

.view-count {
    font-weight: 600;
    color: #2c3e50;
}

/* ====== Recent Comments Section ====== */
.recent-comments-section {
    margin: 60px 0;
    padding: 40px 0;
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.section-header p {
    color: #7f8c8d;
    font-size: 1.05rem;
}

.comments-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 40px;
}

.comment-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.comment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 12px;
    overflow: hidden;
    border: 2px solid #f0f0f0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-user-info h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 600;
}

.comment-date {
    display: block;
    font-size: 0.8rem;
    color: #95a5a6;
    margin-top: 3px;
}

.comment-book {
    margin-bottom: 12px;
}

.comment-book a {
    color: #4CAF50;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}

.comment-book a:hover {
    text-decoration: underline;
}

.comment-text {
    margin: 12px 0;
    line-height: 1.6;
    color: #5a6c7d;
    font-size: 0.92rem;
}

.comment-image-container {
    margin-top: 15px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.comment-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s;
}

.comment-image:hover {
    transform: scale(1.03);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    grid-column: 1 / -1;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(76, 175, 80, 0.2);
    border-radius: 50%;
    border-top-color: #4CAF50;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.load-more-container {
    text-align: center;
    margin-top: 30px;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.3);
}

.load-more-btn:active {
    transform: translateY(0);
}

.load-more-btn i {
    font-size: 0.9rem;
}

/* ====== Modal ====== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.92);
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-content {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    display: block;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: -45px;
    right: 0;
    color: #ffffff;
    font-size: 32px;
    font-weight: bold;
    transition: all 0.3s;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.6);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.close-modal:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* ====== Responsive Design ====== */
@media (max-width: 992px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .comments-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .search-filter-container {
        flex-direction: column;
        padding: 1rem;
        gap: 0.8rem;
    }

    .search-box,
    .category-filter {
        width: 100%;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .comments-container {
        grid-template-columns: 1fr;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .category-title {
        font-size: 1.3rem;
    }

    .book-cover {
        height: 180px;
    }

    .book-info {
        padding: 1rem;
    }

    .book-info h3 {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .search-filter-container {
        padding: 0.8rem;
    }

    .search-form,
    .category-filter {
        height: 50px;
    }

    .search-input,
    .category-select {
        font-size: 0.9rem;
        padding: 0 0.8rem;
    }

    .search-button,
    .filter-button {
        width: 42px;
        height: 42px;
    }

    .search-button i,
    .filter-button i {
        font-size: 1rem;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.8rem;
    }

    .book-cover {
        height: 160px;
    }

    .book-info {
        padding: 0.8rem;
    }

    .book-info h3 {
        font-size: 0.9rem;
    }

    .book-author {
        font-size: 0.85rem;
    }

    .book-description {
        font-size: 0.82rem;
    }

    .comment-card {
        padding: 1.2rem;
    }

    .modal-content {
        max-height: 80vh;
    }

    .close-modal {
        top: -38px;
        font-size: 28px;
        width: 36px;
        height: 36px;
    }

    .section-header h2 {
        font-size: 1.4rem;
    }

    .section-header p {
        font-size: 0.95rem;
    }
}

@media (max-width: 360px) {
    .books-grid {
        grid-template-columns: 1fr;
    }

    .search-filter-container {
        padding: 0.7rem;
    }
}

















