/* صفحة الكتب العصرية - CSS */

/* قسم البحث العصري */
.modern-search-section {
    background: var(--gradient-secondary);
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.modern-search-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%2360A9A9" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.search-hero {
    text-align: center;
    position: relative;
    z-index: 2;
}

.search-title {
    font-size: 3rem;
    font-weight: 900;
    color: var(--heading);
    margin-bottom: 20px;
    line-height: 1.2;
}

.search-subtitle {
    font-size: 1.3rem;
    color: var(--border-text);
    margin-bottom: 40px;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.modern-search-box {
    max-width: 800px;
    margin: 0 auto 60px;
}

.search-input-container {
    position: relative;
    display: flex;
    background: var(--white);
    border-radius: 50px;
    box-shadow: 0 10px 40px var(--shadow);
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-input-container:focus-within {
    border-color: var(--interactive);
    box-shadow: 0 15px 50px var(--shadow-hover);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--border-text);
    opacity: 0.5;
    z-index: 2;
}

.modern-search-input {
    flex: 1;
    padding: 20px 60px 20px 20px;
    border: none;
    outline: none;
    font-size: 1.1rem;
    font-family: inherit;
    background: transparent;
    color: var(--border-text);
}

.modern-search-input::placeholder {
    color: var(--border-text);
    opacity: 0.6;
}

.modern-search-btn {
    padding: 20px 30px;
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modern-search-btn:hover {
    background: var(--heading);
    transform: translateX(-3px);
}

/* الفلاتر العصرية */
.modern-filters {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 30px var(--shadow);
    margin-top: -30px;
    position: relative;
    z-index: 3;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(152, 216, 216, 0.1);
}

.filters-header h3 {
    color: var(--heading);
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.clear-filters-btn {
    background: none;
    border: 2px solid var(--interactive);
    color: var(--interactive);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.clear-filters-btn:hover {
    background: var(--interactive);
    color: var(--white);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.filter-card {
    background: var(--gradient-secondary);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(152, 216, 216, 0.2);
    transition: all 0.3s ease;
}

.filter-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow);
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--heading);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1rem;
}

.filter-label i {
    color: var(--interactive);
    width: 20px;
}

.modern-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(152, 216, 216, 0.3);
    border-radius: 10px;
    background: var(--white);
    color: var(--border-text);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-select:focus {
    outline: none;
    border-color: var(--interactive);
    box-shadow: 0 0 0 3px rgba(152, 216, 216, 0.2);
}

/* قسم الكتب العصري */
.modern-books-section {
    padding: 60px 0;
    background: var(--white);
}

.books-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(152, 216, 216, 0.1);
}

.books-info {
    flex: 1;
}

.books-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 10px;
}

.books-stats {
    display: flex;
    gap: 30px;
    align-items: center;
}

.books-count {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--border-text);
    font-weight: 500;
}

.books-count i {
    color: var(--interactive);
}

.results-info {
    color: var(--border-text);
    opacity: 0.7;
    font-size: 0.9rem;
}

.view-options {
    display: flex;
    gap: 10px;
    background: var(--gradient-secondary);
    padding: 5px;
    border-radius: 12px;
}

.view-btn {
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: var(--border-text);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn.active,
.view-btn:hover {
    background: var(--interactive);
    color: var(--white);
}

/* حالات التحميل والأخطاء */
.loading-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--border-text);
}

.loading-spinner {
    font-size: 3rem;
    color: var(--interactive);
    margin-bottom: 20px;
}

.no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--border-text);
}

.no-results-icon {
    font-size: 4rem;
    color: var(--interactive);
    opacity: 0.5;
    margin-bottom: 20px;
}

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

.no-results p {
    opacity: 0.7;
    margin-bottom: 30px;
}

/* ترقيم الصفحات العصري */
.modern-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 60px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 12px 18px;
    border: 2px solid rgba(152, 216, 216, 0.3);
    background: var(--white);
    color: var(--border-text);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

.pagination-btn:hover {
    border-color: var(--interactive);
    background: var(--interactive);
    color: var(--white);
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: var(--gradient-primary);
    color: var(--white);
    border-color: var(--interactive);
    box-shadow: 0 4px 15px var(--shadow);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pagination-dots {
    color: var(--border-text);
    opacity: 0.5;
    padding: 12px 8px;
}

/* كروت الكتب */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.books-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.book-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
}

.book-card.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px var(--shadow-hover);
}

.book-cover {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: var(--gradient-secondary);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.default-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--interactive);
    opacity: 0.5;
}

.book-card:hover .book-cover img {
    transform: scale(1.1);
}

.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(46, 117, 117, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card:hover .book-overlay {
    opacity: 1;
}

.book-info {
    padding: 20px;
}

.book-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    color: var(--border-text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.book-description {
    color: var(--border-text);
    opacity: 0.8;
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.book-category {
    background: var(--interactive);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.book-type {
    color: var(--interactive);
    font-size: 1.2rem;
}

/* عرض القائمة */
.books-list .book-card {
    display: flex;
    flex-direction: row;
    height: 200px;
}

.books-list .book-cover {
    width: 150px;
    height: 100%;
    flex-shrink: 0;
}

.books-list .book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* حالة الخطأ */
.error-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--border-text);
    grid-column: 1 / -1;
}

.error-icon {
    font-size: 4rem;
    color: #e74c3c;
    margin-bottom: 20px;
}

.error-state h3 {
    font-size: 1.5rem;
    color: var(--heading);
    margin-bottom: 10px;
}

.error-state p {
    opacity: 0.7;
    margin-bottom: 30px;
}

/* التجاوب */
@media (max-width: 1024px) {
    .filters-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .books-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .books-stats {
        justify-content: center;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .modern-search-section {
        padding: 100px 0 60px;
    }

    .search-title {
        font-size: 2rem;
    }

    .search-subtitle {
        font-size: 1.1rem;
    }

    .search-input-container {
        flex-direction: column;
        border-radius: 15px;
    }

    .modern-search-input {
        padding: 15px 20px;
        font-size: 1rem;
        border-radius: 15px 15px 0 0;
    }

    .modern-search-btn {
        padding: 15px 20px;
        font-size: 1rem;
        border-radius: 0 0 15px 15px;
        justify-content: center;
    }

    .search-icon {
        display: none;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .filters-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .books-stats {
        flex-direction: column;
        gap: 15px;
    }

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

    .books-list .book-card {
        flex-direction: column;
        height: auto;
    }

    .books-list .book-cover {
        width: 100%;
        height: 200px;
    }

    .modern-pagination {
        gap: 5px;
    }

    .pagination-btn {
        padding: 10px 14px;
        min-width: 40px;
        font-size: 0.9rem;
    }

    .view-options {
        order: -1;
        margin-bottom: 20px;
    }
}
