/* attachments.css - تصميم مُحسّن مع أيقونة داخل زر التحميل */
.embedded-attachment {
    direction: rtl;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #fdfdff;
    border: 1px solid #e0e6ef;
    border-radius: 10px;
    padding: 12px 18px;
    margin: 15px 0;
    box-shadow: 0 4px 10px rgba(0, 20, 60, 0.06);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: "Tajawal", sans-serif;
    overflow: hidden;
}

.embedded-attachment:hover {
    border-color: #b8c2d0;
    box-shadow: 0 6px 18px rgba(0, 20, 60, 0.12);
    transform: translateY(-2px);
}

.embedded-attachment[contenteditable="false"] {
    cursor: default;
}

.attachment-details-main {
    flex-grow: 1;
    min-width: 0; 
    padding-left: 15px; 
}

.attachment-filename {
    display: block;
    font-weight: 500;
    font-size: 1.0em; 
    color: #333e4d;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.attachment-filesize {
    display: block;
    font-size: 0.75em;
    color: #828c9a;
    margin-bottom: 5px;
}

.attachment-item-description {
    font-size: 0.8em;
    color: #5a6678;
    margin: 0 0 5px 0; /* مسافة أسفل الوصف إذا وجد */
    line-height: 1.4;
    word-break: break-word;
    /* يمكن إضافة المزيد من التنسيقات للوصف هنا */
}

.attachment-action-area {
    flex-shrink: 0; 
}

.attachment-download-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(to bottom, #007bff, #0069d9);
    color: white !important;
    padding: 9px 16px;
    border-radius: 6px;
    text-decoration: none !important;
    font-size: 0.9em;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.25), inset 0 1px 0 rgba(255,255,255,0.15);
}

.attachment-download-link-button:hover {
    background-image: linear-gradient(to bottom, #0069d9, #005cbf);
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.1);
}
.attachment-download-link-button:active {
    transform: translateY(0px);
    background-image: linear-gradient(to bottom, #005cbf, #0050a7);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.25), inset 0 1px 0 rgba(0,0,0,0.1);
}

/* تنسيق الأيقونة داخل الزر */
.attachment-download-link-button .fa,
.attachment-download-link-button .fas,
.attachment-download-link-button .fab {
    margin-left: 8px; /* مسافة على يسار الأيقونة (للنص العربي) */
    font-size: 1em; 
    line-height: 1;
    vertical-align: -0.05em; 
}

.attachment-download-link-button .download-button-text {
    /* لا حاجة لتنسيقات خاصة هنا الآن */
}

/* تجاوب مع الشاشات الصغيرة */
@media (max-width: 480px) {
    .embedded-attachment {
        flex-direction: column; 
        align-items: stretch;  
        padding: 12px;
    }
    .attachment-details-main {
        padding-left: 0; 
        margin-bottom: 10px; 
        text-align: center; 
    }
     .attachment-filename {
        font-size: 0.95em; 
        white-space: normal; 
    }
    .attachment-filesize, .attachment-item-description {
        font-size: 0.75em;
    }
    .attachment-action-area {
       width: 100%; 
       margin-top: 5px; /* مسافة إضافية إذا كانت العناصر فوق بعضها */
    }
    .attachment-download-link-button {
        width: 100%; 
        padding: 10px 15px;
        font-size: 0.9em;
    }
}