/* =========================================
   قسم المدونات - Blog Section
   ========================================= */

.blog-section {
    padding: 100px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    overflow: hidden;
}

.blog-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(52, 152, 219, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(155, 89, 182, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* عنوان القسم */
.blog-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.blog-section .section-title {
    font-size: 3rem;
    font-weight: 900;
    color: #2c3e50;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.blog-section .section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #9b59b6);
    border-radius: 2px;
}

.blog-section .section-description {
    font-size: 1.2rem;
    color: #555;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

/* شبكة المدونات */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 35px;
    margin-top: 50px;
    position: relative;
    z-index: 1;
}

/* بطاقة المدونة */
.blog-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 50px rgba(52, 152, 219, 0.3);
}

/* صورة المدونة */
.blog-image-wrapper {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.blog-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.blog-card:hover .blog-image {
    transform: scale(1.15);
}

/* تصنيف المدونة */
.blog-category {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    z-index: 2;
}

/* للصفحة العربية */
html[dir="rtl"] .blog-category {
    right: auto;
    left: 20px;
}

/* طبقة التدرج */
.blog-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    pointer-events: none;
}

/* محتوى البطاقة */
.blog-content {
    padding: 25px;
}

/* عنوان المدونة */
.blog-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.4;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card:hover .blog-title {
    color: #3498db;
}

/* مقتطف المدونة */
.blog-excerpt {
    font-size: 1rem;
    color: #666;
    line-height: 1.7;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* معلومات المدونة */
.blog-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
    font-size: 0.9rem;
    color: #888;
}

.blog-date {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-date i {
    color: #3498db;
    font-size: 1rem;
}

.blog-read-time {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-read-time i {
    color: #9b59b6;
    font-size: 1rem;
}

/* زر قراءة المزيد */
.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding: 12px 25px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.blog-read-more:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    transform: translateX(5px);
    box-shadow: 0 7px 20px rgba(52, 152, 219, 0.4);
}

html[dir="rtl"] .blog-read-more:hover {
    transform: translateX(-5px);
}

.blog-read-more i {
    transition: transform 0.3s ease;
}

.blog-read-more:hover i {
    transform: translateX(5px);
}

html[dir="rtl"] .blog-read-more:hover i {
    transform: translateX(-5px);
}

/* شارة جديد */
.blog-badge-new {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    z-index: 2;
    animation: pulse-badge 2s infinite;
}

html[dir="rtl"] .blog-badge-new {
    left: auto;
    right: 20px;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* أيقونات المؤلف */
.blog-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.blog-author-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #3498db;
}

.blog-author-name {
    font-size: 0.9rem;
    color: #555;
    font-weight: 600;
}

/* =========================================
   التصميم المتجاوب
   ========================================= */

/* Tablet */
@media (max-width: 991px) {
    .blog-section {
        padding: 80px 0;
    }
    
    .blog-section .section-title {
        font-size: 2.5rem;
    }
    
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .blog-image-wrapper {
        height: 220px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .blog-section {
        padding: 60px 0;
    }
    
    .blog-section .section-title {
        font-size: 2rem;
    }
    
    .blog-section .section-description {
        font-size: 1rem;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .blog-image-wrapper {
        height: 200px;
    }
    
    .blog-content {
        padding: 20px;
    }
    
    .blog-title {
        font-size: 1.3rem;
    }
    
    .blog-excerpt {
        font-size: 0.95rem;
    }
    
    .blog-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Mobile Small */
@media (max-width: 576px) {
    .blog-section {
        padding: 50px 0;
    }
    
    .blog-section .section-title {
        font-size: 1.7rem;
    }
    
    .blog-header {
        margin-bottom: 40px;
    }
    
    .blog-image-wrapper {
        height: 180px;
    }
    
    .blog-category {
        font-size: 0.75rem;
        padding: 6px 12px;
        top: 15px;
        right: 15px;
    }
    
    html[dir="rtl"] .blog-category {
        right: auto;
        left: 15px;
    }
    
    .blog-badge-new {
        font-size: 0.7rem;
        padding: 5px 12px;
        top: 15px;
        left: 15px;
    }
    
    html[dir="rtl"] .blog-badge-new {
        left: auto;
        right: 15px;
    }
    
    .blog-content {
        padding: 18px;
    }
    
    .blog-title {
        font-size: 1.2rem;
    }
    
    .blog-read-more {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* =========================================
   تأثيرات إضافية
   ========================================= */

/* تأثير التحميل */
.blog-card {
    animation: fadeInUp 0.6s ease-out;
}

.blog-card:nth-child(1) {
    animation-delay: 0.1s;
}

.blog-card:nth-child(2) {
    animation-delay: 0.2s;
}

.blog-card:nth-child(3) {
    animation-delay: 0.3s;
}

.blog-card:nth-child(4) {
    animation-delay: 0.4s;
}

.blog-card:nth-child(5) {
    animation-delay: 0.5s;
}

.blog-card:nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تأثير الحدود المتوهجة */
.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, #3498db, #9b59b6);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-card:hover::before {
    opacity: 1;
}

/* =========================================
   قسم التعليقات والأسئلة
   ========================================= */

.blog-comment-section {
    margin-top: 80px;
    padding: 40px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.blog-comment-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #3498db, #9b59b6, #3498db);
    background-size: 200% 100%;
    animation: gradient-flow 3s ease infinite;
}

@keyframes gradient-flow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.comment-header {
    text-align: center;
    margin-bottom: 35px;
}

.comment-title {
    font-size: 2rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
}

.comment-subtitle {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
}

.comment-form {
    max-width: 800px;
    margin: 0 auto;
}

.comment-textarea {
    width: 100%;
    min-height: 150px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: #f9f9f9;
    box-sizing: border-box;
    line-height: 1.6;
}

.comment-textarea:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

.comment-textarea::placeholder {
    color: #999;
}

.comment-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.3);
}

.comment-submit-btn:hover {
    background: linear-gradient(135deg, #128C7E, #25D366);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.comment-submit-btn:active {
    transform: translateY(-1px);
}

.comment-submit-btn i {
    font-size: 1.3rem;
}

/* =========================================
   تجاوب قسم التعليقات
   ========================================= */

@media (max-width: 768px) {
    .blog-comment-section {
        margin-top: 50px;
        padding: 30px 20px;
        border-radius: 20px;
    }
    
    .comment-header {
        margin-bottom: 25px;
    }
    
    .comment-title {
        font-size: 1.5rem;
    }
    
    .comment-subtitle {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .comment-textarea {
        min-height: 130px;
        padding: 16px;
        font-size: 0.95rem;
        border-radius: 12px;
    }
    
    .comment-submit-btn {
        width: 100%;
        justify-content: center;
        padding: 15px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .blog-comment-section {
        margin-top: 40px;
        padding: 20px 15px;
        border-radius: 15px;
    }
    
    .comment-header {
        margin-bottom: 20px;
    }
    
    .comment-title {
        font-size: 1.3rem;
        line-height: 1.3;
    }
    
    .comment-subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .comment-textarea {
        min-height: 110px;
        padding: 14px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .comment-submit-btn {
        padding: 14px 25px;
        font-size: 0.95rem;
    }
    
    .comment-submit-btn i {
        font-size: 1.2rem;
    }
}

/* شاشات صغيرة جداً */
@media (max-width: 400px) {
    .blog-comment-section {
        margin-top: 35px;
        padding: 18px 12px;
        border-radius: 12px;
    }
    
    .comment-header {
        margin-bottom: 18px;
    }
    
    .comment-title {
        font-size: 1.2rem;
        line-height: 1.3;
    }
    
    .comment-subtitle {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .comment-textarea {
        min-height: 100px;
        padding: 12px;
        font-size: 0.88rem;
    }
    
    .comment-submit-btn {
        padding: 13px 20px;
        font-size: 0.9rem;
        gap: 8px;
    }
    
    .comment-submit-btn i {
        font-size: 1.1rem;
    }
}
