/* =========================================
   تنسيقات صفحة المستندات الاحترافية (documents.css)
   ========================================= */

/* شريط الأدوات (البحث والتصنيفات) */
.documents-toolbar {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04);
    margin-bottom: 40px;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* البحث */
.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-wrapper .search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 1.1rem;
}

.search-wrapper input {
    width: 100%;
    padding: 15px 20px 15px 45px; /* مسافة للأيقونة يمين */
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fdfdfd;
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color, #1a5276);
    box-shadow: 0 0 0 4px rgba(26, 82, 118, 0.1);
    background: #fff;
}

/* أزرار التصنيفات (Filters) */
.categories-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.filter-btn {
    background: #f1f3f5;
    color: #555;
    border: 1px solid transparent;
    padding: 10px 22px;
    border-radius: 30px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #e2e8f0;
    color: #333;
}

.filter-btn.active {
    background: var(--primary-color, #1a5276);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(26, 82, 118, 0.3);
}

/* ================= شبكة المستندات ================= */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

/* بطاقة المستند (Card) */
.document-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.document-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: #ccc; /* لون افتراضي يتغير بالـ JS */
    transition: width 0.3s ease;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* أيقونة الملف */
.doc-icon {
    width: 65px;
    height: 65px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    flex-shrink: 0;
}

/* معلومات المستند */
.doc-info {
    flex: 1;
    overflow: hidden;
}

.doc-category-badge {
    background: #f1f2f6;
    color: #555;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: inline-block;
}

.doc-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.15rem;
    color: #2c3e50;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.doc-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* زر التحميل */
.doc-action-btn {
    background: rgba(26, 82, 118, 0.08);
    color: var(--primary-color, #1a5276);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.doc-action-btn:hover {
    background: var(--primary-color, #1a5276);
    color: #ffffff;
    transform: scale(1.1);
}

/* ================= الدليل التوضيحي (خطوات) ================= */
.application-process {
    background: #f8f9fc;
    padding: 50px 30px;
    border-radius: 15px;
    margin-top: 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color, #1a5276);
    font-size: 1.8rem;
    font-weight: 800;
}

.process-guide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.process-step {
    background: #ffffff;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    transition: transform 0.3s ease;
}

.process-step:hover { transform: translateY(-5px); }

.step-icon {
    width: 70px;
    height: 70px;
    background: rgba(230, 126, 34, 0.1);
    color: var(--secondary-color, #e67e22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 20px;
}

.process-step h4 { font-size: 1.2rem; color: #333; margin-bottom: 10px; }
.process-step p { font-size: 0.95rem; color: #666; line-height: 1.6; margin: 0; }

/* ================= شاشات الموبايل ================= */
@media (max-width: 768px) {
    .documents-grid { grid-template-columns: 1fr; }
    .document-card {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }
    .doc-info h3 { white-space: normal; }
    .doc-meta { justify-content: center; }
    .doc-action-btn { width: 100%; border-radius: 8px; height: 45px; }
    .doc-action-btn::after { content: ' تحميل المستند'; margin-right: 8px; font-weight: bold; font-family: 'Cairo'; font-size: 1rem; }
    .document-card::before { width: 100%; height: 4px; top: 0; right: 0; }
}