/**
 * assets/css/job-platform.css
 * CSS الخاص بمنصة الوظائف (شامل دعم RTL والتجاوبية)
 */

/* ==================================== General Form Styling ==================================== */
.job-platform-submit-form {
    max-width: 700px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
}

.job-platform-submit-form fieldset {
    border: 1px solid #ccc;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 6px;
}

.job-platform-submit-form legend {
    font-size: 1.2em;
    font-weight: bold;
    padding: 0 10px;
    color: #0073aa; 
}

/* تنسيق الحقول النصية والقوائم المنسدلة */
.job-platform-submit-form input[type="text"],
.job-platform-submit-form input[type="email"],
.job-platform-submit-form input[type="password"],
.job-platform-submit-form input[type="tel"],
.job-platform-submit-form input[type="date"],
.job-platform-submit-form textarea,
.job-platform-submit-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    /* دعم RTL: محاذاة النص داخل الحقل */
    direction: rtl; 
    text-align: right;
}

.job-platform-submit-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

/* ==================================== RTL Adjustments for Forms (if theme is LTR) ==================================== */
/* هذا الجزء يضمن التنسيق الصحيح في بيئة RTL */
body.rtl .job-platform-submit-form input[type="text"],
body.rtl .job-platform-submit-form textarea {
    text-align: right;
}

/* ==================================== Dashboard Table Styling ==================================== */
.dashboard-job-list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    /* دعم RTL: محاذاة النص في الجداول */
    text-align: right;
}

.dashboard-job-list th,
.dashboard-job-list td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.dashboard-job-list th {
    background-color: #f5f5f5;
    font-weight: 700;
    color: #333;
}

/* أزرار لوحة التحكم */
.button-action {
    display: inline-block;
    padding: 5px 10px;
    margin: 2px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
}

/* ==================================== Single Job Page Styling ==================================== */
.job-listing-single .entry-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 15px;
}

.job-listing-single .job-featured-tag {
    display: inline-block;
    background-color: #ffc107;
    color: #333;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 10px;
}

.job-listing-single .job-image-container {
    /* دعم RTL: الصورة تطفو لليمين */
    float: right; 
    margin: 0 0 10px 20px; /* عكس الهامش: 0 أعلى، 0 يمين، 10 أسفل، 20 يسار */
    max-width: 200px;
    height: auto;
}

/* تنسيق قسم الاتصال */
.job-listing-single .job-contact-section {
    clear: both;
    margin-top: 30px;
    border-top: 1px dashed #ccc;
    padding-top: 20px;
    text-align: center;
}

.job-listing-single .contact-details-box p {
    text-align: right;
    margin-bottom: 8px;
}
.job-listing-single .contact-details-box strong {
    min-width: 150px;
    display: inline-block; /* لتنسيق المحاذاة في RTL */
}


/* أزرار الاتصال */
.job-listing-single .contact-buttons-wrapper a {
    text-decoration: none;
    padding: 12px 25px;
    margin: 5px;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 500;
    transition: background-color 0.3s;
}

.job-listing-single .email-btn { background-color: #dc3545; color: #fff; }
.job-listing-single .phone-btn { background-color: #007bff; color: #fff; }
.job-listing-single .whatsapp-btn { background-color: #28a745; color: #fff; }


/* ==================================== Responsive Adjustments (التجاوبية) ==================================== */

@media (max-width: 768px) {
    
    /* 1. الجداول (Dashboard) - تحويل الجدول إلى بطاقات مكدسة */
    .dashboard-job-list thead { display: none; } /* إخفاء رأس الجدول */
    .dashboard-job-list, .dashboard-job-list tbody, .dashboard-job-list tr, .dashboard-job-list td { 
        display: block; 
        width: 100%; 
    }
    .dashboard-job-list tr { 
        margin-bottom: 15px; 
        border: 1px solid #ddd; 
        display: flex; 
        flex-direction: column; 
        padding: 0;
        border-radius: 6px;
    }
    
    .dashboard-job-list td { 
        text-align: right; 
        padding: 10px 15px; 
        position: relative; 
        padding-right: 50%; /* مساحة لاسم العمود */
        border-bottom: 1px solid #eee; 
    }
    .dashboard-job-list td:last-child {
        border-bottom: none;
    }

    /* عرض اسم العمود كـ "Label" */
    .dashboard-job-list td:before { 
        position: absolute; 
        left: auto; /* إلغاء التعيين السابق */
        right: 6px; /* وضع الـ label لليمين */
        width: 45%; 
        padding-left: 10px; 
        white-space: nowrap; 
        font-weight: 700; 
        content: attr(data-label);
        text-align: left; /* محاذاة اسم العمود لليسار */
    }
    
    /* 2. صفحة الوظيفة الواحدة (Single Job) - إزالة الطفو */
    .job-listing-single .job-image-container {
        float: none;
        margin: 15px auto;
        display: block;
        max-width: 100%;
        text-align: center;
    }
    
    /* 3. أزرار الاتصال - عرض عمودي أو مرن */
    .job-listing-single .contact-buttons-wrapper {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    .job-listing-single .contact-buttons-wrapper a {
        width: 90%; 
        margin: 0;
    }
    
    /* 4. إزالة الهامش من النماذج */
    .job-platform-submit-form {
        margin: 0;
        padding: 10px;
        border-left: none;
        border-right: none;
    }
}

/* ==================================== Fix for Arabic (RTL) ==================================== */

/* ووردبريس تضيف body.rtl إذا كانت اللغة عربية */
body.rtl {
    /* ضمان أن كل شيء يبدأ من اليمين */
    text-align: right;
}