/* تعيين خط عربي */
body {
    font-family: 'Tajawal', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 20px 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    direction: rtl; /* هام لضبط الاتجاه من اليمين لليسار */
}

/* الترويسة */
header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 15px;
}

header h1 {
    color: #007bff; /* لون أزرق جذاب */
    font-weight: 700;
    font-size: 2.2em;
}

header p {
    color: #6c757d;
    font-size: 1.1em;
}

/* مجموعات الحقول */
fieldset {
    border: 1px solid #ccc;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

fieldset:hover {
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.2);
}

legend {
    font-size: 1.4em;
    font-weight: 700;
    color: #007bff;
    padding: 0 10px;
    margin-right: -10px; /* لضبط التباعد في RTL */
}

/* مجموعة النموذج العامة */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: #495057;
}

/* حقول الإدخال والنصوص */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="file"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.3s;
    text-align: right; /* لضمان ظهور الكتابة من اليمين */
}

input:focus,
textarea:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

textarea {
    resize: vertical;
}

.inline-input {
    width: 50%;
    display: inline-block;
}

/* خيارات الاختيار (مربعات وراديو) */
.checkbox-group,
.radio-group {
    padding: 10px 0;
    border-right: 3px solid #007bff;
    padding-right: 15px;
}

.checkbox-options label,
.radio-options label {
    display: block;
    margin-bottom: 5px;
    cursor: pointer;
}

.checkbox-options input[type="checkbox"],
.radio-options input[type="radio"] {
    margin-left: 10px; /* تباعد الأزرار عن النص في RTL */
}

/* ملاحظات */
.note {
    font-size: 0.9em;
    color: #dc3545;
    margin-top: -10px;
    margin-bottom: 20px;
    padding-right: 5px;
}

.notes-box {
    background-color: #e9f7ff;
    border-right: 5px solid #007bff;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

.notes-box p {
    font-weight: bold;
    color: #007bff;
    margin-top: 0;
}

.list-rtl {
    list-style-type: arabic-indic; /* أو square حسب الرغبة */
    padding-right: 20px;
    margin-top: 5px;
}

/* جدول المعارض */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    text-align: right;
}

.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 10px;
}

.data-table th {
    background-color: #007bff;
    color: white;
    font-weight: 400;
}

.data-table td input {
    border: none;
    padding: 5px;
}

/* زر الإرسال */
button[type="submit"] {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #28a745; /* لون أخضر للإرسال */
    color: white;
    font-size: 1.2em;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 30px;
}

button[type="submit"]:hover {
    background-color: #218838;
}
/* Styling for error messages */
.error-message {
    color: #dc3545; /* Red color */
    background-color: #f8d7da;
    border-right: 3px solid #dc3545;
    padding: 8px 10px;
    margin-top: 5px;
    border-radius: 4px;
    font-size: 0.9em;
    display: none; /* Initially hidden */
    text-align: right;
}

/* Highlight the input field with an error */
.input-error {
    border-color: #dc3545 !important;
}