﻿/* تنسيقات عامة */
.services-area {
    background: #f8f9fa;
}

/* Container للمحتوى */
.services-content-wrapper {
    background: var(--moif-white);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(13, 27, 62, 0.08);
    overflow: hidden;
    padding: 40px;
}

/* Section divider between content blocks */
.section-divider {
    margin-top: 10px;
    padding-top: 40px;
    border-top: 2px solid #f0f0f0;
}

/* Section title header */
.section-title-header {
    margin-bottom: 10px;
}

.section-title-header h3 {
    color: var(--moif-blue-dark);
    font-size: 32px;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--moif-gold);
    display: inline-block;
}

.service-content-section {
    /* All sections visible by default */
}

/* تنسيقات الهيدر مع الصورة */
.service-header-with-image {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 30px;
    flex-direction: row-reverse; /* Image on RIGHT, Text on LEFT */
}

/* تنسيقات الصورة المستطيلة المدورة على الجانب */
.service-rounded-image-side {
    position: relative;
    width: 380px;
    height: 280px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--moif-blue-dark) 0%, var(--moif-blue) 100%);
    box-shadow: 0 10px 30px rgba(13, 27, 62, 0.15);
}

.service-rounded-image-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.service-rounded-image-side.no-image img {
    display: none;
}

.image-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--moif-blue-dark) 0%, var(--moif-blue) 100%);
}

.service-rounded-image-side.no-image .image-fallback {
    display: flex;
}

.image-fallback i {
    font-size: 80px;
    color: var(--moif-gold);
    opacity: 0.6;
}

/* Wrapper للمحتوى على الجانب الآخر */
.service-content-wrapper-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

/* العنوان الثابت في الأعلى */
.service-title-fixed {
    color: var(--moif-blue-dark);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    margin-top:10px;
    border-bottom: 3px solid var(--moif-gold);
}

/* تنسيقات المحتوى بجانب الصورة */
.service-content-beside-image {
    flex: 1;
    display: flex;
    align-items: center;
}

.first-paragraph {
    color: var(--moif-blue);
    line-height: 1.9;
    margin: 0;
    font-size: 16px;
    text-align: justify;
    padding: 0 30px;
}

/* تنسيقات محتوى النص أسفل الصورة */
.service-text-content {
    clear: both;
    padding: 10px 30px 10px 30px;
}

.service-text-content p {
    color: var(--moif-blue);
    line-height: 1.9;
    margin-bottom: 20px;
    font-size: 16px;
    text-align: justify;
}

.service-text-content p:last-child {
    margin-bottom: 0;
}

/* إضافة بعض التنسيقات الإضافية */
.responsibility-item,
.objective-item,
.program-item,
.challenge-item,
.vision-item,
.expertise-item {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eaeaea;
}

.responsibility-item:last-child,
.objective-item:last-child,
.program-item:last-child,
.challenge-item:last-child,
.vision-item:last-child,
.expertise-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.responsibility-item ul,
.service-text-content ul {
    margin-top: 10px;
    margin-bottom: 15px;
    padding-left: 20px;
}

.responsibility-item li,
.service-text-content li {
    margin-bottom: 8px;
    color: var(--moif-blue);
    line-height: 1.7;
}

/* Text alignment follows language direction */
html[dir="rtl"] .section-title-header h3,
html[dir="rtl"] .service-title-fixed,
html[dir="rtl"] .first-paragraph,
html[dir="rtl"] .service-text-content p,
html[dir="rtl"] .responsibility-item h4,
html[dir="rtl"] .objective-item h4,
html[dir="rtl"] .program-item h4,
html[dir="rtl"] .challenge-item h4,
html[dir="rtl"] .vision-item h4,
html[dir="rtl"] .service-text-content strong,
html[dir="rtl"] .service-text-content ul {
    text-align: right;
}

html[dir="rtl"] .service-text-content ul {
    padding-right: 20px;
    padding-left: 0;
}

html[dir="ltr"] .section-title-header h3,
html[dir="ltr"] .service-title-fixed,
html[dir="ltr"] .first-paragraph,
html[dir="ltr"] .service-text-content p,
html[dir="ltr"] .responsibility-item h4,
html[dir="ltr"] .objective-item h4,
html[dir="ltr"] .program-item h4,
html[dir="ltr"] .challenge-item h4,
html[dir="ltr"] .vision-item h4,
html[dir="ltr"] .service-text-content strong,
html[dir="ltr"] .service-text-content ul {
    text-align: left;
}

html[dir="ltr"] .service-text-content ul {
    padding-left: 20px;
    padding-right: 0;
}

/* تنسيقات متجاوبة */
@media (max-width: 991px) {
    .service-rounded-image-side {
        width: 300px;
        height: 220px;
    }

    .service-content-beside-image {
        min-height: 220px;
    }

    .service-title-fixed {
        font-size: 24px;
    }

    .section-title-header h3 {
        font-size: 28px;
    }

    .services-content-wrapper {
        padding: 30px;
    }

    .section-divider {
        margin-top: 10px;
        padding-top: 30px;
    }
}

@media (max-width: 768px) {
    .service-header-with-image {
        flex-direction: column !important; /* Always stack on mobile: image above text */
        align-items: center;
        gap: 25px;
    }

    .service-rounded-image-side {
        width: 100%;
        max-width: 380px;
        height: 250px;
    }

    .service-content-wrapper-right {
        min-height: auto;
        width: 100%;
    }

    .service-title-fixed {
        font-size: 22px;
        margin-bottom: 15px;
        margin-top: 10px;
    }

    .section-title-header h3 {
        font-size: 24px;
    }

    .services-content-wrapper {
        padding: 25px 20px;
    }

    .first-paragraph,
    .service-text-content p {
        font-size: 15px;
        margin-bottom: 15px;
    }

    .section-divider {
        margin-top: 10px;
        padding-top: 25px;
    }
}

@media (max-width: 576px) {
    .service-rounded-image-side {
        height: 200px;
    }

    .service-title-fixed {
        font-size: 20px;
    }

    .section-title-header h3 {
        font-size: 22px;
    }

    .services-content-wrapper {
        padding: 20px 15px;
    }

    .service-header-with-image {
        gap: 20px;
        margin-bottom: 15px;
    }

    .section-divider {
        margin-top: 15px;
        padding-top: 20px;
    }
}

/* ============================================
   ATTACHMENTS SECTION - IMPROVED SPACING
   ============================================ */
.attachments-section {
    padding: 28px 0;
    margin-top: 24px;
}

.attachments-card {
    background: var(--moif-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.attachments-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.attachments-header i {
    font-size: 16px;
    color: var(--moif-gold);
}

.attachments-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--moif-blue-dark);
    margin: 0 !important;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f9f9f9;
    border: 1px solid #eaeaea;
    border-radius: 2px;
    margin-bottom: 10px;
}

.attachment-item:last-child {
    margin-bottom: 0;
}

.attachment-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.attachment-icon {
    width: 36px;
    height: 36px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attachment-icon i {
    font-size: 16px;
    color: #d63031;
}

.attachment-details h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--moif-blue-dark);
    margin: 0 0 3px 0 !important;
}

.attachment-details span {
    font-size: 11.5px;
    color: #666;
}

.download-btn {
    background: var(--moif-blue-dark) !important;
    color: white;
    border: none;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border-radius: 2px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.download-btn:hover {
    background: var(--moif-blue);
}