/* Blog Page Specific Styles */

/* إعادة ضبط كاملة */
* {
    box-sizing: border-box;
}

/* نظام سلايدر مسطح وموحد بدون سكرول */
.articles-slider-section {
    padding: 60px 0;
    background: white;
    position: relative;
    width: 100%;
}

/* رأس القسم - بسيط */
.slider-section-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.slider-section-header .section-tag {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 6px 20px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.slider-section-header h2 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

.slider-subtitle {
    color: #666;
    font-size: 1rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* الحاوية الرئيسية - بدون سكرول */
.slider-main-container {
    width: 100%;
    position: relative;
    padding: 0 15px;
    overflow: hidden;
}

/* المسار - كل البطاقات على نفس المستوى بدون سكرول */
.slider-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    padding: 10px 0;
    direction: rtl;
}

/* بطاقة المقال - تصميم موحد */
.slider-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #eaeaea;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    height: 100%;
}

.slider-card:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* صورة المقال */
.slider-card-image {
    height: 200px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.slider-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.slider-card:hover .slider-card-image img {
    transform: scale(1.05);
}

/* شارة التصنيف */
.card-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--secondary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

/* محتوى البطاقة */
.slider-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 200px);
}

.slider-card-content h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
    text-align: right;
    flex-grow: 1;
}

.slider-card-content p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-align: right;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* معلومات المقال */
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
    color: #888;
    font-size: 0.8rem;
    margin-top: auto;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    direction: rtl;
}

.card-meta i {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* منطقة أزرار الإجراءات */
.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* زر قراءة المقال الأساسي */
.read-full-btn {
    flex: 1;
    min-width: 120px;
    background: var(--secondary-color);
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.read-full-btn:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* أزرار الإجراءات الإضافية */
.action-btn {
    flex: 0 0 auto;
    background: #f8f9fa;
    color: var(--primary-color);
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 45px;
}

.action-btn:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

.action-btn.save-btn:hover {
    background: #4CAF50;
    border-color: #4CAF50;
}

.action-btn.share-btn:hover {
    background: #2196F3;
    border-color: #2196F3;
}

/* زر العرض السريع */
.quick-view-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(5px);
    z-index: 3;
}

.slider-card:hover .quick-view-btn {
    opacity: 1;
    transform: translateY(0);
}

.quick-view-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: scale(1.1);
}

/* الإحصائيات */
.slider-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    color: #666;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.slider-stats span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

.slider-stats span i {
    color: var(--secondary-color);
}

/* مودال المقال - بسيط */
.article-detail-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
    direction: rtl;
}

.article-detail-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-wrapper {
    background: white;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--secondary-color);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    background: var(--primary-color);
    transform: rotate(90deg);
}

.modal-image-container {
    height: 300px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-content-area {
    padding: 25px;
}

.modal-content-area h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 700;
    text-align: right;
}

.modal-meta-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    color: #666;
    flex-wrap: wrap;
    text-align: right;
}

.modal-meta-info span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.modal-meta-info span i {
    color: var(--secondary-color);
}

.modal-article-content {
    line-height: 1.7;
    color: #444;
    font-size: 1rem;
    text-align: right;
}

.modal-article-content p {
    margin-bottom: 20px;
}

.modal-article-content h2,
.modal-article-content h3 {
    color: var(--primary-color);
    margin: 25px 0 15px;
    font-size: 1.3rem;
}

.modal-article-content ul,
.modal-article-content ol {
    margin: 15px 0;
    padding-right: 20px;
}

.modal-article-content li {
    margin-bottom: 8px;
}

/* أزرار التنقل في المودال */
.modal-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    gap: 10px;
}

.modal-navigation button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.modal-navigation button:hover {
    background: var(--primary-color);
}

.modal-navigation button.prev-article {
    flex-direction: row-reverse;
}

/* تحسينات التجاوب */
@media (max-width: 1200px) {
    .slider-track {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 992px) {
    .slider-track {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .slider-card-image {
        height: 180px;
    }

    .slider-section-header h2 {
        font-size: 1.7rem;
    }

    .modal-image-container {
        height: 250px;
    }

    .modal-content-area h1 {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .articles-slider-section {
        padding: 40px 0;
    }

    .slider-track {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 15px;
    }

    .slider-card-image {
        height: 160px;
    }

    .slider-card-content {
        padding: 15px;
    }

    .slider-card-content h3 {
        font-size: 1.1rem;
    }

    .slider-card-content p {
        -webkit-line-clamp: 2;
    }

    .slider-section-header h2 {
        font-size: 1.5rem;
    }

    .modal-content-area {
        padding: 20px;
    }

    .modal-image-container {
        height: 200px;
    }

    .modal-content-area h1 {
        font-size: 1.4rem;
    }

    .modal-meta-info {
        gap: 10px;
        font-size: 0.85rem;
    }

    .modal-navigation {
        flex-direction: column;
    }

    .modal-navigation button {
        width: 100%;
        justify-content: center;
    }

    .card-actions {
        flex-direction: column;
    }

    .action-btn {
        min-width: 100%;
    }
}

@media (max-width: 576px) {
    .slider-track {
        grid-template-columns: 1fr;
        max-width: 350px;
        margin: 0 auto;
    }

    .slider-card-image {
        height: 200px;
    }

    .slider-stats {
        flex-direction: column;
        gap: 10px;
    }
}

/* إصلاحات بصرية */
.slider-card:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* تحسين تجربة اللمس */
@media (hover: none) {
    .slider-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .read-full-btn:hover,
    .action-btn:hover,
    .quick-view-btn:hover {
        transform: none;
    }
}

/* ===== أنماط قسم الفلتر ===== */
.blog-filter-section {
    padding: 30px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    direction: rtl;
}

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.filter-title {
    text-align: center;
    margin-bottom: 25px;
}

.filter-title h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.filter-title p {
    color: #666;
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.filter-btn {
    background: white;
    color: var(--primary-color);
    padding: 10px 25px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.filter-btn:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
    background: var(--gold-color);
    color: white;
    border-color: var(--gold-color);
}

.filter-search {
    display: flex;
    gap: 10px;
    min-width: 300px;
}

.filter-search input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
    color: #333;
}

.filter-search input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.filter-search button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.filter-search button:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sort-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.sort-controls label {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.sort-controls select {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    background: white;
    color: #333;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

.sort-controls select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.filter-stats {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 0.9rem;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

/* تأثيرات التصفية */
.slider-card.filtered-out {
    display: none;
    animation: fadeOut 0.3s ease;
}

.slider-card.filtered-in {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* تحسينات تجاوبية للفلتر */
@media (max-width: 992px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-search {
        min-width: 100%;
    }

    .filter-categories {
        justify-content: center;
    }

    .filter-btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .blog-filter-section {
        padding: 25px 0;
    }

    .filter-title h2 {
        font-size: 1.6rem;
    }

    .filter-search input {
        padding: 10px 15px;
    }

    .filter-search button {
        padding: 10px 20px;
    }

    .sort-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .sort-controls select {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .filter-categories {
        gap: 8px;
        justify-content: center;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .filter-title h2 {
        font-size: 1.4rem;
    }
}