/* ============================================================
   صفحات التوظيف: القائمة، التفاصيل، نموذج التقديم الديناميكي
   ============================================================ */

/* ---------- بطاقة الوظيفة في القائمة ---------- */
.job-card { position: relative; }

.job-card .card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
}

/* ملصق الإدارة أسفل المسمى (كان بلا تنسيق) */
.card-subtitle {
    font-size: 0.8rem;
    color: #8a97a3;
    margin: -6px 0 10px;
}

.job-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.job-badge-urgent { background: #fff4e0; color: #a06000; }
.job-badge-closed { background: #fdecec; color: #b33; }

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-bottom: 12px;
}
.job-meta-item {
    font-size: 0.75rem;
    color: #667684;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.job-meta-item i { color: var(--dark-green); font-size: 0.7rem; }

/* قصّ الوصف حتى لا يكسر ارتفاع الشبكة */
.job-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.job-card-actions {
    margin-top: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.job-details-link {
    font-size: 0.85rem;
    color: var(--dark-green);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.job-details-link:hover { opacity: 0.8; color: var(--dark-green); }

.job-apply-btn {
    display: block;
    text-align: center;
    text-decoration: none;
}
.job-apply-btn:hover { color: #fff; opacity: 0.92; }
.job-apply-btn.is-disabled {
    background-color: #c4ccd3;
    cursor: not-allowed;
    pointer-events: none;
}

.jobs-flash { margin-bottom: 24px; }

/* ---------- الحالة الفارغة ---------- */
.jobs-empty {
    text-align: center;
    padding: 60px 20px;
    border: 2px dashed #dde5ec;
    border-radius: 12px;
    max-width: 520px;
    margin: 0 auto;
}
.jobs-empty > i { font-size: 42px; color: #c4ccd3; margin-bottom: 14px; }
.jobs-empty-title { font-size: 1.15rem; font-weight: 700; color: #333; margin-bottom: 6px; }
.jobs-empty-text { font-size: 0.9rem; color: #8a97a3; margin-bottom: 18px; }
.jobs-empty .details-button { display: inline-block; text-decoration: none; }

/* ---------- صفحة تفاصيل الوظيفة ---------- */
.job-section { margin-bottom: 28px; }
.job-section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--dark-green);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.job-prose {
    font-size: 0.95rem;
    color: #4a5560;
    line-height: 1.9;
    white-space: pre-line; /* يحافظ على أسطر النص القادمة من لوحة التحكم */
}
.job-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.job-list li {
    position: relative;
    padding-right: 22px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #4a5560;
    line-height: 1.7;
}
.job-list li::before {
    content: "";
    position: absolute;
    right: 0;
    top: 0.55em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dark-green);
}

.job-summary-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 16px;
}
.job-summary-title {
    font-size: 1rem;
    font-weight: 800;
    color: #333;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eef4f8;
}
.job-summary-list { list-style: none; padding: 0; margin: 0 0 16px; }
.job-summary-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px dashed #edf1f5;
    font-size: 0.85rem;
}
.job-summary-list li:last-child { border-bottom: none; }
.job-summary-list li i { color: var(--dark-green); width: 18px; text-align: center; }
.job-summary-list li span { color: #8a97a3; }
.job-summary-list li b { margin-right: auto; color: #333; text-align: left; }

.job-deadline-note {
    background: #fff4e0;
    color: #a06000;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.job-closed-note {
    background: #fdecec;
    color: #b33;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.job-apply-lg {
    width: 100%;
    font-size: 1rem;
    padding: 13px;
}

/* ---------- نموذج التقديم ---------- */
.job-apply-container { max-width: 720px; }

.job-apply-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-right: 4px solid var(--dark-green);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 24px;
}
.job-apply-head-label { font-size: 0.75rem; color: #8a97a3; margin-bottom: 2px; }
.job-apply-head-title { font-size: 1.15rem; font-weight: 800; color: #333; }
.job-apply-head-dept { font-size: 0.8rem; color: #8a97a3; }

.job-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}
.job-form-grid .field.is-full,
.job-form-grid .job-form-section { grid-column: 1 / -1; }
.job-form-grid .field.is-half { grid-column: span 1; }

.job-form-section {
    font-size: 1rem;
    font-weight: 800;
    color: var(--dark-green);
    border-bottom: 2px solid #eef4f8;
    padding-bottom: 8px;
    margin: 14px 0 16px;
}

.job-req { color: #d33; }

.job-choice-group { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 4px; }
.job-choice { font-size: 0.9rem; margin: 0 !important; }
.job-choice input { margin-left: 6px; }

.job-file .file-cta { background: var(--dark-green); color: #fff; border: none; }
.job-file .file-name { max-width: none; flex-grow: 1; }
.job-file.is-danger .file-cta { background: #d33; }

.job-submit-btn { background-color: var(--button-bg, #007497); }

/* ---------- تجاوب ---------- */
@media (max-width: 768px) {
    .job-form-grid { grid-template-columns: 1fr; }
    .job-form-grid .field.is-half { grid-column: 1 / -1; }
    .job-apply-head { flex-direction: column; align-items: flex-start; }
    .job-summary-card { position: static; }
}
