/**
 * article-attachments.css
 * تصميم قسم مرفقات المقال في صفحة المقال الأمامية
 *
 * يُحمَّل فقط لو فيه مرفقات (يُضاف في article.php شرطياً)
 * RTL-friendly — متوافق مع تصميم الموقع الحالي
 */

/* ===== قسم المرفقات ===== */
.article-attachments {
    margin: 36px 0 28px;
    border: 1.5px solid #E5E7EB;
    border-radius: 16px;
    overflow: hidden;
    background: #FAFBFF;
    box-shadow: 0 2px 16px rgba(37, 99, 235, 0.06);
    transition: box-shadow .3s;
}
.article-attachments:hover {
    box-shadow: 0 4px 24px rgba(37, 99, 235, 0.10);
}

/* رأس القسم */
.attachments-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
    color: #fff;
}
.attachments-icon {
    font-size: 18px;
    opacity: .9;
}
.attachments-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: #fff;
    letter-spacing: .3px;
}

/* قائمة المرفقات */
.attachments-list {
    list-style: none;
    margin: 0;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* عنصر مرفق */
.attachment-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    border: 1.5px solid #E5E7EB;
    border-radius: 12px;
    transition: all .25s ease;
    position: relative;
    overflow: hidden;
}
.attachment-item::before {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 4px;
    border-radius: 0 4px 4px 0;
    transition: width .25s;
}
.attachment-item:hover {
    border-color: #93C5FD;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.10);
    transform: translateY(-1px);
}
.attachment-item:hover::before { width: 4px; }

/* أيقونة الملف */
.attachment-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}
.attachment-emoji {
    font-size: 22px;
    line-height: 1;
    display: block;
}
.attachment-ext-badge {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .5px;
    margin-top: 2px;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.3;
}

/* ألوان حسب نوع الملف */
.attach-type-pdf   { background: #FEF2F2; }
.attach-type-pdf   .attachment-ext-badge { background: #DC2626; color: #fff; }

.attach-type-word  { background: #EFF6FF; }
.attach-type-word  .attachment-ext-badge { background: #2563EB; color: #fff; }

.attach-type-excel { background: #F0FDF4; }
.attach-type-excel .attachment-ext-badge { background: #16A34A; color: #fff; }

.attach-type-ppt   { background: #FFF7ED; }
.attach-type-ppt   .attachment-ext-badge { background: #EA580C; color: #fff; }

.attach-type-other { background: #F8FAFC; }
.attach-type-other .attachment-ext-badge { background: #64748B; color: #fff; }

/* الخط الجانبي الملوّن — يُطبّق على attachment-item عبر data-type */
.attachment-item[data-type="pdf"]   { border-right-color: #DC2626; }
.attachment-item[data-type="word"]  { border-right-color: #2563EB; }
.attachment-item[data-type="excel"] { border-right-color: #16A34A; }
.attachment-item[data-type="ppt"]   { border-right-color: #EA580C; }

/* معلومات الملف */
.attachment-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.attachment-name {
    font-size: 14px;
    font-weight: 700;
    color: #1E293B;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
.attachment-meta {
    font-size: 12px;
    color: #94A3B8;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* زر التحميل */
.attachment-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #1E40AF, #2563EB);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all .2s;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .25);
    border: none;
}
.attachment-download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
    background: linear-gradient(135deg, #1E3A8A, #1D4ED8);
    color: #fff !important;
}
.attachment-download-btn i {
    font-size: 12px;
}

/* رابط التحميل المضمّن في المحتوى (من الشورت كود) */
.inline-attach-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 6px;
    color: #1D4ED8;
    font-weight: 600;
    font-size: .9em;
    text-decoration: none;
    transition: all .2s;
}
.inline-attach-link:hover {
    background: #2563EB;
    border-color: #2563EB;
    color: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .attachment-item {
        gap: 10px;
        padding: 12px;
    }
    .attachment-icon-wrap {
        width: 40px;
        height: 40px;
    }
    .attachment-emoji { font-size: 18px; }
    .attachment-name  { font-size: 13px; }
    .attachment-download-btn {
        padding: 7px 12px;
        font-size: 12px;
    }
    .attachment-download-btn span { display: none; }
}
