/* ---------------------------------- */
/* 1. إعدادات التصفير والأنماط العامة  */
/* ---------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* لضمان حساب الأبعاد بشكل صحيح */
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: #f9f9f9;
    overflow-x: hidden; /* منع ظهور شريط التمرير الأفقي */
    line-height: 1.6;
    transition: background-color 0.3s ease; /* سلاسة عند التبديل للوضع الليلي */
}

/* ---------------------------------- */
/* 2. حاوية الملف الشخصي والرأس       */
/* ---------------------------------- */
.profile-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* إطار الصورة الشخصية الدائري */
.profile-pic-container {
    width: 140px;
    height: 140px;
    background-color: #f9f3ee;
    border: 4px solid #66774a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}

.user-icon {
    width: 70px;
    height: 70px;
}

.profile-header {
    text-align: center;
}

.profile-header h1 {
    color: #66774a;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.profile-header p {
    color: #889977;
    font-size: 1rem;
}

/* ---------------------------------- */
/* 3. قسم نموذج التعديل (Edit Form)   */
/* ---------------------------------- */
.edit-profile-section {
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    text-align: right; /* دعم الكتابة من اليمين لليسار */
}

.edit-profile-section h2 {
    color: #66774a;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f9f3ee;
    font-size: 1.6rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #3e4a2d;
    font-size: 0.95rem;
}

/* تنسيق خانات الإدخال */
.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    color: #555;
    transition: all 0.3s ease;
    background-color: #fcfcfc;
}

/* تأثير عند الضغط على خانة الإدخال */
.form-group input:focus {
    border-color: #66774a;
    box-shadow: 0 0 0 3px rgba(102, 119, 74, 0.1);
    outline: none;
    background-color: #fff;
}

/* ---------------------------------- */
/* 4. أزرار التحكم (Action Buttons)   */
/* ---------------------------------- */
.action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 2px solid #f2ede9;
    margin-top: 10px;
}

.save-btn, .logout-btn {
    padding: 12px 35px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
}

/* زر الحفظ الأخضر */
.save-btn {
    background-color: #66774a;
    color: white;
    border: 2px solid #66774a;
}

.save-btn:hover {
    background-color: #55633d;
    transform: translateY(-3px); /* تحريك للأعلى عند التمرير */
    box-shadow: 0 6px 15px rgba(102, 119, 74, 0.2);
}

/* زر تسجيل الخروج */
.logout-btn {
    background-color: transparent;
    color: #a67c7c;
    border: 2px solid #e0d5d3;
}

.logout-btn:hover {
    border-color: #a67c7c;
    background-color: rgba(166, 124, 124, 0.05);
    transform: translateY(-3px);
}



/* ---------------------------------- */
/* 5. خصائص الوضع الليلي (Dark Mode)   */
/* ---------------------------------- */
body.dark-mode {
    background-color: #2b1d12;
    color: #efe7d9;
}

body.dark-mode .profile-pic-container {
    background-color: #3d2b1f;
    border-color: #d4e0c0;
}

body.dark-mode .profile-header h1 { color: #d4e0c0; }
body.dark-mode .profile-header p { color: #a3b899; }

body.dark-mode .edit-profile-section {
    background-color: #3d2b1f;
    border: 1px solid rgba(212, 224, 192, 0.1);
}

body.dark-mode .edit-profile-section h2 {
    color: #d4e0c0;
    border-bottom-color: #4d3a2b;
}

body.dark-mode .form-group label { color: #efe7d9; }

body.dark-mode .form-group input {
    background-color: #2b1d12;
    border-color: #4d3a2b;
    color: #efe7d9;
}

body.dark-mode .action-buttons { border-top-color: #4d3a2b; }

body.dark-mode .logout-btn {
    color: #e2a5a5;
    border-color: #4d3a2b;
}

/* ---------------------------------- */
/* 6. التجاوب مع الشاشات (Responsive)  */
/* ---------------------------------- */
@media (max-width: 768px) {
    .profile-container {
        margin: 20px auto;
        gap: 20px;
    }
    .profile-pic-container {
        width: 110px;
        height: 110px;
    }
    /* تحويل الأزرار لتصبح فوق بعضها في الجوال */
    .action-buttons {
        flex-direction: column;
        gap: 15px;
    }
    .save-btn, .logout-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* تقليل الهوامش العلوية والسفلية للحاوية */
    .profile-container {
        margin: 15px auto;
        padding: 0 15px;
        gap: 15px;
    }

    /* تصغير إطار الصورة الشخصية ليناسب عرض الهاتف الصغير */
    .profile-pic-container {
        width: 100px;
        height: 100px;
        margin: 10px auto;
        border-width: 3px; /* تقليل سمك الإطار */
    }

    .user-icon {
        width: 50px;
        height: 50px;
    }

    /* تصغير أحجام الخطوط في الرأس */
    .profile-header h1 {
        font-size: 1.5rem;
    }

    .profile-header p {
        font-size: 0.9rem;
    }

    /* ضبط نموذج التعديل للمساحات الضيقة */
    .edit-profile-section {
        padding: 20px 15px;
        border-radius: 15px;
    }

    .edit-profile-section h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }

    /* تصغير خانات الإدخال والخطوط داخلها */
    .form-group label {
        font-size: 0.85rem;
    }

    .form-group input {
        padding: 10px;
        font-size: 0.9rem;
    }

    /* ضبط الأزرار لتكون أسهل في الضغط */
    .save-btn, .logout-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}