body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    direction: rtl; /* اتجاه النص من اليمين لليسار للعربية */
    text-align: right; /* محاذاة النص لليمين */
}

.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box; /* عشان الـ padding ما يزودش العرض */
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: calc(100% - 20px); /* 100% ناقص الـ padding */
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #0056b3;
}

.message {
    text-align: center;
    padding: 10px;
    margin-top: 15px;
    border-radius: 4px;
    display: none; /* مخفي مبدئياً */
    font-weight: bold;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.text-center {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.text-center a {
    color: #007bff;
    text-decoration: none;
}

.text-center a:hover {
    text-decoration: underline;
}

/* تنسيقات أزرار التبديل (تسجيل/دخول) */
.form-toggle {
    display: flex;
    margin-bottom: 25px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.form-toggle button {
    flex: 1;
    padding: 10px 0;
    border: none;
    background-color: #f0f0f0;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin-top: 0;
    border-radius: 0;
}

.form-toggle button.active {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

/* تنسيقات أقسام النموذج / لوحة التحكم / الملف الشخصي */
.form-section {
    transition: opacity 0.3s ease, height 0.3s ease, padding 0.3s ease;
    opacity: 1;
    transform: translateX(0);
    position: relative;
    padding-top: 15px;
    height: auto;
    box-sizing: border-box; /* للتأكد من أن الـ padding لا يسبب تجاوز للعرض */
}

.form-section.hidden {
    opacity: 0;
    height: 0;
    overflow: hidden;
    position: absolute;
    width: 100%; /* يجب أن تكون 100% لتناسب الحاوية */
    padding: 0; /* قم بإخفاء الـ padding أيضاً */
    pointer-events: none; /* لمنع التفاعل مع العناصر المخفية */
}

/* تنسيقات لوحة التحكم الرئيسية */
#dashboard-section h1 {
    color: #007bff;
    margin-bottom: 20px;
    text-align: center;
}
#dashboard-section p {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 15px;
    text-align: center;
}

.dashboard-links {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    gap: 10px; /* مسافة بين الأزرار */
}

.dashboard-nav-button {
    flex: 1; /* لتوزيع الأزرار بالتساوي */
    background-color: #28a745; /* لون أخضر لأزرار التنقل */
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 0; /* لإلغاء margin-top العام للأزرار */
}

.dashboard-nav-button:hover {
    background-color: #218838;
}

.logout-button {
    background-color: #dc3545; /* لون أحمر للخروج */
}

.logout-button:hover {
    background-color: #c82333;
}

.dashboard-content-area {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-top: 15px;
}

/* تنسيقات قسم تعديل الملف الشخصي */
#profile-section h1 {
    color: #007bff;
    margin-bottom: 20px;
}

.secondary-button {
    background-color: #6c757d; /* لون رمادي لزر العودة */
    margin-top: 10px;
}

.secondary-button:hover {
    background-color: #5a6268;
}

/* تنسيقات معلومات الجلسة (في الأسفل) */
.session-info {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
    color: #666;
}

.session-info button {
    margin-top: 10px;
    width: auto;
    display: inline-block;
    margin-left: 5px;
    margin-right: 5px;
}