/* Reset عام للصور لمنع التدخل من المتصفح */
img {
    max-width: 100%;
    height: auto;
}

/* تنسيقات عامة */
:root {
    --primary-color: #1a5c8a; /* أزرق نقابة */
    --secondary-color: #f4f7f6;
    --text-color: #333;
    --accent-color: #e67e22; /* برتقالي للتنبيهات أو الأزرار الهامة */
}

body {
    direction: rtl; /* لأن الموقع بالعربي */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    margin: 0; padding: 0;
}

/* الهيدر (الرأس) */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: 15px;
    font-weight: bold;
}

/* الأزرار */
.btn-login {
    background-color: var(--accent-color);
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: 0.3s;
}

.btn-login:hover {
    background-color: #d35400;
}

/* الحاوية الرئيسية */
.container {
    width: 85%;
    margin: 20px auto;
}

/* 1. التأكد من وجود مسافة داخلية لجميع حقول الإدخال */
.input-field {
    width: 100%;
    padding: 12px 15px; /* الـ 15px الثانية تضمن ابتعاد النص عن الحافة اليمنى واليسرى */
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 20px;
    font-family: inherit;
    box-sizing: border-box; /* يضمن أن الـ padding لا يزيد من عرض الحقل */
    text-align: right; /* محاذاة النص لليمين دائماً */
    display: block;
}

/* 2. تنسيق الحقول التي للقراءة فقط (Readonly) */
.input-field[readonly] {
    background-color: #f9f9f9;
    border-color: #eee;
    color: #666;
    cursor: not-allowed;
}

/* 3. حاوية البيانات الجانبية (Aside) */
.info-card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 4. ضمان اتجاه المحتوى داخل الكروت */
.info-card div, .edit-card {
    width: 100%;
    direction: rtl; 
}

/* --- Dropdown Menu Styles --- */
.user-menu-container { position: relative; display: inline-block; cursor: pointer; }
.user-profile-trigger { display: flex; align-items: center; gap: 10px; color: #fff; }
.nav-avatar { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; border: 2px solid #f1c40f; }
.dropdown-content {
    display: none; position: absolute; left: 0; background: #fff; min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2); border-radius: 8px; z-index: 1000; margin-top: 10px;
}
.dropdown-content a { color: #333 !important; padding: 12px 16px; text-decoration: none; display: block; text-align: right; }
.dropdown-content a:hover { background-color: #f1f1f1; border-radius: 8px; }
.show { display: block; }

/* منع تعارض .show مع عناصر الـ flex */
.slider-track.show { display: flex; }

/* --- Responsive Design (Mobile) --- */
@media screen and (max-width: 768px) {
    /* Login Page */
    .login-container { width: 90% !important; margin: 20px auto; padding: 20px; }
    
    /* Profile Page */
    .profile-container { 
        grid-template-columns: 1fr !important; /* تحويل الأعمدة لصف واحد */
    }
    .nav-links { gap: 10px; font-size: 0.9rem; }
    .profile-img-big { width: 120px; height: 120px; }
    
    header { padding: 10px; flex-direction: column; gap: 15px; text-align: center; }
    .nav-links a { padding: 5px; }
	
	/* Stack password fields on top of each other on mobile */
    .edit-card div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .input-field {
        font-size: 16px; /* Prevents iOS from zooming in on focus */
        padding: 15px;   /* Larger hit area for fingers */
    }
}