﻿/* --- قسم البحث --- */
.search-section {
    padding: 15px 20px 10px;
    background-color: var(--bg-color);
}

.search-box {
    display: flex;
    align-items: center;
    background-color: #e9ecef;
    border-radius: 20px;
    padding: 8px 15px;
}

    .search-box i {
        color: var(--text-muted);
        margin-left: 10px;
    }

    .search-box input {
        border: none;
        background: transparent;
        width: 100%;
        font-family: 'Tajawal', sans-serif;
        font-size: 14px;
        outline: none;
    }

/* --- شريط التصنيفات --- */
.categories-filter {
    display: flex;
    overflow-x: auto;
    padding: 0 20px 15px;
    gap: 15px;
    background-color: var(--bg-color);
    scrollbar-width: none; /* إخفاء شريط التمرير */
}

    .categories-filter::-webkit-scrollbar {
        display: none;
    }

.filter-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    padding: 5px 0;
}

    .filter-btn.active {
        color: var(--text-dark);
        font-weight: 700;
    }

    .filter-btn i {
        font-size: 18px;
    }

/* --- شبكة الاستكشاف (Grid) --- */
.explore-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 أعمدة متساوية دائماً */
    gap: 10px; /* المسافة بين الصور */
    padding: 0 15px 15px;
}

.grid-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 3 / 4; /* يجعل الصورة أطول قليلاً من المربع لتشبه أغلفة الكتب */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

    .grid-item img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* لقص الصورة بذكاء دون تشويه */
        display: block;
    }

/* الأيقونات فوق الصورة */
.top-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    color: white;
    font-size: 14px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.bottom-badges {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.rating-badge {
    background-color: white;
    color: var(--text-dark);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

    .rating-badge i {
        color: #f39c12; /* لون النجمة الذهبي */
        font-size: 10px;
    }

.action-icon {
    color: white;
    font-size: 14px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

/*review  details*/

 
/* الإعدادات العامة للصفحة */
body {
    font-family: 'Cairo', sans-serif;
    background-color: #f8fafc; /* خلفية أفتح قليلاً وأكثر عصرية */
    margin: 0;
    color: #2d3748;
}

/* === قسم البحث (Search Section) === */
.search-section {
    padding: 15px 20px;
    position: sticky;
    top: 0;
    background-color: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(10px); /* تأثير زجاجي خفيف */
    z-index: 100;
    border-bottom: 1px solid #edf2f7;
}

.search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 20px;
    padding: 12px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

    .search-box:focus-within {
        border-color: #3498db;
        box-shadow: 0 4px 20px rgba(52, 152, 219, 0.1);
    }

    .search-box i {
        color: #a0aec0;
        font-size: 1.2rem;
        margin-left: 12px;
    }

    .search-box input {
        border: none;
        outline: none;
        background: transparent;
        width: 100%;
        font-family: inherit;
        font-size: 1rem;
        color: #2d3748;
    }

        .search-box input::placeholder {
            color: #cbd5e0;
        }

/* === قسم الفلاتر (Categories Filter) === */
.categories-filter {
    display: flex;
    overflow-x: auto;
    padding: 15px 20px;
    gap: 12px;
    scrollbar-width: none;
}

    .categories-filter::-webkit-scrollbar {
        display: none;
    }

.filter-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    padding: 10px 20px;
    white-space: nowrap;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

    .filter-btn.active {
        background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
        color: #ffffff;
        border-color: transparent;
        box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    }

    .filter-btn:hover:not(.active) {
        background: #f1f5f9;
        border-color: #cbd5e0;
    }

/* === العناوين الرئيسية للأقسام === */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 10px 20px;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #2c3e50;
    margin: 0;
}

.view-all-link {
    color: #3498db;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s;
}

    .view-all-link:hover {
        color: #2980b9;
    }

/* === قسم الكتب الرائجة (العرض العمودي) === */
.trending-books-container {
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr; /* عمود واحد للموبايل */
    gap: 15px;
}

@media (min-width: 768px) {
    .trending-books-container {
        grid-template-columns: repeat(2, 1fr); /* عمودين للتابلت */
    }
}

@media (min-width: 1024px) {
    .trending-books-container {
        grid-template-columns: repeat(3, 1fr); /* ثلاثة أعمدة للشاشات الكبيرة */
    }
}

.book-card-vertical {
    display: flex;
    background: #ffffff;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    align-items: center;
    gap: 15px;
}

    .book-card-vertical:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    }

.book-cover {
    width: 80px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 5px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.85rem;
    color: #718096;
    margin: 0 0 10px 0;
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
}

    .book-rating i {
        color: #f1c40f;
    }

/* === قسم المراجعات المميزة === */
.reviews-container {
    padding: 0 20px 20px 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .reviews-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.review-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.reviewer-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.reviewer-details h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2d3748;
}

.reviewer-details p {
    margin: 0;
    font-size: 0.8rem;
    color: #a0aec0;
}

.review-text {
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.review-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #718096;
    font-size: 0.9rem;
    font-weight: 600;
}

    .review-stats i {
        color: #e74c3c; /* لون قلب الإعجاب */
    }

/* === لافتة التصويت === */
.ks-poll-promo-container {
    direction: rtl;
    margin: 20px;
}

.ks-poll-promo-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* تدرج لوني جديد جذاب */
    color: #ffffff;
    text-decoration: none;
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(118, 75, 162, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .ks-poll-promo-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 15px 25px rgba(118, 75, 162, 0.3);
        color: #ffffff;
    }

.ks-poll-promo-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ks-poll-promo-icon {
    font-size: 1.8rem;
    background: rgba(255,255,255,0.2);
    padding: 10px;
    border-radius: 12px;
}

.ks-poll-promo-text {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

.ks-poll-promo-action {
    font-size: 0.9rem;
    font-weight: 800;
    background: #ffffff;
    color: #764ba2;
    padding: 8px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: background 0.3s ease;
}

.ks-poll-promo-btn:hover .ks-poll-promo-action {
    background: #f8fafc;
}

@media (max-width: 640px) {
    .ks-poll-promo-btn {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }

    .ks-poll-promo-content {
        flex-direction: column;
    }

    .ks-poll-promo-icon {
        margin-bottom: 10px;
    }
}

/* === شبكة العرض الأساسية (للبحث والبيانات العادية) === */
.explore-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 0 20px 20px 20px;
}

@media (min-width: 768px) {
    .explore-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .explore-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

 

.ks-top-review-container {
    direction: rtl;
    padding: 20px 15px;
    background-color: #f5f3ff;
    border-radius: 12px;
    font-family: 'Tajawal', 'Cairo', sans-serif;
    margin-top: 30px;
}

.ks-top-review-header {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2e1065;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}


.ks-top-review-scroll-area {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 15px 5px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

    .ks-top-review-scroll-area::-webkit-scrollbar {
        display: none;
    }

.ks-top-review-scroll-area {
    -ms-overflow-style: none;
    scrollbar-width: none;
}


.ks-top-review-link {
    text-decoration: none;
    scroll-snap-align: start;
    flex-shrink: 0;
}


.ks-top-review-card {
    position: relative;
    width: 260px;
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #ede9fe;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .ks-top-review-card:hover {
        transform: translateY(-5px);
        border-color: #8b5cf6;
        box-shadow: 0 8px 15px rgba(139, 92, 246, 0.15);
    }

.ks-top-review-likes {
    position: absolute;
    top: -12px;
    left: 15px;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(225, 29, 72, 0.4);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}


.ks-top-review-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ks-top-review-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #e2e8f0;
    flex-shrink: 0;
}

    .ks-top-review-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.ks-top-review-username {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.ks-top-review-book {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e8f0;
}

    .ks-top-review-book span {
        font-weight: 600;
        color: #8b5cf6;
    }


.ks-top-review-text {
    font-size: 13px;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 12px 0;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}


.ks-top-review-stars {
    font-size: 12px;
    margin-top: auto;
}


 
/* الحاوية الرئيسية للقسم الجديد */
.ks-new-container {
    direction: rtl;
    padding: 20px 15px;
    background-color: #f8fafc; /* لون خلفية مائل للأزرق الفاتح جداً لتمييزه عن القسم السابق */
    border-radius: 12px;
    font-family: 'Tajawal', 'Cairo', sans-serif;
    margin-top: 30px; /* مسافة عن القسم الذي قبله */
}

/* عنوان القسم */
.ks-new-header {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ks-new-icon {
    font-size: 1.4rem;
}

/* منطقة التمرير الأفقي */
.ks-new-scroll-area {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 10px 5px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

    /* إخفاء شريط التمرير الافتراضي */
    .ks-new-scroll-area::-webkit-scrollbar {
        display: none;
    }

.ks-new-scroll-area {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* الرابط المحيط بالبطاقة */
.ks-new-link {
    text-decoration: none;
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* تصميم بطاقة الكتاب الحديث */
.ks-new-card {
    position: relative;
    width: 140px;
    background: #ffffff;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid #e2e8f0; /* إضافة حدود خفيفة جداً للبطاقة */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

    .ks-new-card:hover {
        transform: translateY(-5px);
        border-color: #10b981; /* تغيير لون الحدود عند التمرير */
        box-shadow: 0 8px 15px rgba(16, 185, 129, 0.15); /* ظل أخضر خفيف */
    }

/* شارة "جديد" */
.ks-new-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #10b981, #059669); /* تدرج أخضر زمردي */
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
    z-index: 2;
}

/* حاوية الغلاف */
.ks-new-cover-box {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f1f5f9;
    margin-bottom: 12px;
}

    .ks-new-cover-box img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

.ks-new-card:hover .ks-new-cover-box img {
    transform: scale(1.05);
}

/* النصوص السفلية (العنوان والمؤلف) */
.ks-new-details {
    text-align: right;
}

.ks-new-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ks-new-author {
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* الحاوية الرئيسية */
.ks-botd-container {
    direction: rtl;
    padding: 20px 15px;
    background: linear-gradient(135deg, #fffbeb, #fef3c7); /* خلفية ذهبية/صفراء فاتحة جداً تعطي إحساساً بالتميز */
    border-radius: 12px;
    font-family: 'Tajawal', 'Cairo', sans-serif;
    margin-top: 30px;
    border: 1px solid #fde68a;
}

/* عنوان القسم */
.ks-botd-header {
    font-size: 1.5rem;
    font-weight: 700;
    color: #92400e; /* لون بني داكن متناسق مع الذهبي */
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* بطاقة الكتاب - تعتمد على Flexbox لعرض الصورة بجوار النص */
.ks-botd-card {
    display: flex;
    gap: 20px;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(217, 119, 6, 0.1);
}

/* غلاف الكتاب */
.ks-botd-cover {
    flex-shrink: 0;
    width: 150px; /* عرض الغلاف للكمبيوتر */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

    .ks-botd-cover img {
        width: 100%;
        height: auto;
        display: block;
        aspect-ratio: 2 / 3;
        object-fit: cover;
    }

/* حاوية التفاصيل */
.ks-botd-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

/* التصنيف */
.ks-botd-category {
    align-self: flex-start;
    background-color: #fef08a;
    color: #854d0e;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 12px;
}

/* العنوان */
.ks-botd-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 8px 0;
}


.ks-botd-author {
    font-size: 1rem;
    color: #475569;
    margin: 0 0 16px 0;
}

    .ks-botd-author strong {
        color: #0f172a;
    }


.ks-botd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.ks-botd-tag {
    background-color: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

/* زر عرض التفاصيل */
.ks-botd-action {
    margin-top: auto; /* يدفع الزر لأسفل الحاوية */
}

.ks-botd-btn {
    display: inline-block;
    background: #d97706; /* لون برتقالي/ذهبي داكن */
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease, transform 0.2s ease;
}

    .ks-botd-btn:hover {
        background: #b45309;
        transform: translateY(-2px);
    }


@media (max-width: 640px) {
    .ks-botd-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .ks-botd-cover {
        width: 180px;
    }

    .ks-botd-category {
        align-self: center;
    }

    .ks-botd-tags {
        justify-content: center;
    }
}