/* ============================================
   إعادة تعيين وتصميم جديد كامل
   ============================================ */

.isfm-section-container {
    margin: 50px auto;
    padding: 40px 30px;
    background: #ffffff;
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.08);
    max-width: 1400px;
    position: relative;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

/* تأثير خلفي جميل */
.isfm-section-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(102, 126, 234, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(118, 75, 162, 0.03) 0%, transparent 50%);
    z-index: 0;
}

/* العنوان الجديد */
.isfm-section-title {
    margin: 0 0 40px 0;
    font-size: 36px;
    font-weight: 700;
    color: #2c3e50;
    position: relative;
    padding-bottom: 20px;
    text-align: center;
    z-index: 1;
}

.isfm-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.isfm-section-title .dashicons {
    display: none; /* إخفاء الأيقونة القديمة */
}

.isfm-files-count {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    margin-right: 15px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* ============================================
   تصميم جديد كامل لشبكة البطاقات
   ============================================ */

.isfm-files-grid {
    display: grid;
    gap: 30px;
    margin-top: 40px;
    z-index: 1;
    position: relative;
}

/* تصميم متجاوب متطور */
@media (min-width: 1400px) {
    .isfm-files-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1100px) and (max-width: 1399px) {
    .isfm-files-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1099px) {
    .isfm-files-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 767px) {
    .isfm-files-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ============================================
   تصميم البطاقة الجديد بالكامل
   ============================================ */

.isfm-file-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    border: 1px solid #f5f5f5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.isfm-file-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 30px 60px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
}

/* شريط لوني أعلى البطاقة */
.isfm-file-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

/* ============================================
   رأس البطاقة الجديد
   ============================================ */

.isfm-file-header {
    padding: 25px 25px 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    position: relative;
}

.isfm-file-icon {
    font-size: 42px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.isfm-file-type {
    position: absolute;
    top: 20px;
    left: 20px;
    background: white;
    color: #667eea;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

/* ============================================
   جسم البطاقة الجديد
   ============================================ */

.isfm-file-body {
    padding: 0 25px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.isfm-file-name {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    min-height: 56px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.isfm-file-description {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   معلومات الملف الجديدة
   ============================================ */

.isfm-file-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.isfm-file-date, .isfm-file-size {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #7f8c8d;
}

.isfm-file-date .dashicons, .isfm-file-size .dashicons {
    color: #667eea;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ============================================
   تذييل البطاقة الجديد
   ============================================ */

.isfm-file-footer {
    padding: 0 25px 25px;
}

.isfm-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 25px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.isfm-download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
    z-index: -1;
}

.isfm-download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.3);
    color: white;
}

.isfm-download-btn:hover::before {
    left: 100%;
}

.isfm-download-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.isfm-download-btn:hover .dashicons {
    transform: translateY(-2px);
}

/* ============================================
   تأثيرات خاصة لأنواع الملفات
   ============================================ */

.isfm-file-card[data-file-type="pdf"] .isfm-file-icon {
    color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(192, 57, 43, 0.1));
}

.isfm-file-card[data-file-type="doc"] .isfm-file-icon,
.isfm-file-card[data-file-type="docx"] .isfm-file-icon {
    color: #3498db;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.1));
}

/* ============================================
   حالة عدم وجود ملفات
   ============================================ */

.isfm-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 30px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 20px;
    color: #7f8c8d;
    border: 2px dashed #dee2e6;
}

.isfm-empty::before {
    content: '📄';
    font-size: 60px;
    display: block;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* ============================================
   تصميم للأجهزة الصغيرة جداً
   ============================================ */

@media (max-width: 480px) {
    .isfm-section-container {
        padding: 25px 20px;
        margin: 30px 15px;
        border-radius: 20px;
    }
    
    .isfm-section-title {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    .isfm-file-header {
        padding: 20px 20px 10px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .isfm-file-icon {
        width: 60px;
        height: 60px;
        font-size: 36px;
    }
    
    .isfm-file-type {
        position: static;
        margin-bottom: 10px;
        align-self: center;
    }
    
    .isfm-file-body {
        padding: 0 20px 15px;
    }
    
    .isfm-file-name {
        font-size: 18px;
        text-align: center;
    }
    
    .isfm-file-description {
        text-align: center;
        font-size: 14px;
    }
    
    .isfm-file-meta {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .isfm-file-footer {
        padding: 0 20px 20px;
    }
    
    .isfm-download-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* ============================================
   تأثيرات حركية
   ============================================ */

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

.isfm-file-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

/* تأخير متدرج للبطاقات */
.isfm-files-grid .isfm-file-card:nth-child(1) { animation-delay: 0.1s; }
.isfm-files-grid .isfm-file-card:nth-child(2) { animation-delay: 0.2s; }
.isfm-files-grid .isfm-file-card:nth-child(3) { animation-delay: 0.3s; }
.isfm-files-grid .isfm-file-card:nth-child(4) { animation-delay: 0.4s; }
.isfm-files-grid .isfm-file-card:nth-child(5) { animation-delay: 0.5s; }
.isfm-files-grid .isfm-file-card:nth-child(6) { animation-delay: 0.6s; }

/* ============================================
   تحسينات للوضع المظلم
   ============================================ */

@media (prefers-color-scheme: dark) {
    .isfm-section-container {
        background: #1a1a1a;
        border-color: #333;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    }
    
    .isfm-file-card {
        background: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }
    
    .isfm-file-name {
        color: #ffffff;
    }
    
    .isfm-file-description {
        color: #b0b0b0;
    }
    
    .isfm-file-meta {
        border-top-color: #404040;
    }
    
    .isfm-file-date, .isfm-file-size {
        color: #a0a0a0;
    }
    
    .isfm-file-icon {
        background: linear-gradient(135deg, #333, #404040);
    }
    
    .isfm-empty {
        background: linear-gradient(135deg, #2d2d2d, #333);
        border-color: #404040;
        color: #a0a0a0;
    }
}











/* ============================================
   مكونات جديدة للتصميم المحسن
   ============================================ */

.isfm-section-header {
    text-align: center;
    margin-bottom: 40px;
}

.isfm-section-icon {
    display: inline-block;
    font-size: 40px;
    margin-left: 15px;
    vertical-align: middle;
}

.isfm-section-description {
    color: #7f8c8d;
    font-size: 18px;
    margin-top: 10px;
    opacity: 0.8;
}

.isfm-file-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.isfm-file-private {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.isfm-file-main-info {
    flex-grow: 1;
}

.isfm-file-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 8px;
    font-size: 13px;
    color: #7f8c8d;
}

.isfm-file-upload-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.isfm-file-upload-date .dashicons {
    font-size: 14px;
    color: #667eea;
}

.isfm-file-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.isfm-file-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.isfm-preview-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f8f9fa;
    color: #667eea;
    padding: 14px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.isfm-preview-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.isfm-preview-btn .dashicons {
    font-size: 18px;
}

.isfm-download-btn {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.isfm-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    color: white;
}

.isfm-section-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.isfm-total-files {
    color: #7f8c8d;
    font-size: 15px;
    display: inline-block;
    background: #f8f9fa;
    padding: 10px 25px;
    border-radius: 25px;
}

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

.isfm-file-card:hover .isfm-file-name {
    color: #667eea;
}

.isfm-file-card:hover .isfm-file-type {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

/* ============================================
   تحسينات للأجهزة اللوحية
   ============================================ */

@media (max-width: 768px) {
    .isfm-file-actions {
        flex-direction: column;
    }
    
    .isfm-preview-btn, .isfm-download-btn {
        width: 100%;
        justify-content: center;
    }
    
    .isfm-file-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .isfm-section-icon {
        font-size: 32px;
        margin-left: 10px;
    }
    
    .isfm-section-title {
        font-size: 30px;
    }
}

/* ============================================
   تحسينات للهواتف الصغيرة
   ============================================ */

@media (max-width: 480px) {
    .isfm-section-container {
        padding: 25px 15px;
        margin: 20px 10px;
    }
    
    .isfm-section-title {
        font-size: 24px;
        flex-direction: column;
        gap: 10px;
    }
    
    .isfm-files-count {
        margin-right: 0;
        margin-top: 10px;
    }
    
    .isfm-file-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .isfm-file-badge {
        position: static;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .isfm-file-details {
        justify-content: center;
    }
}