/* Custom Fonts and Base Reset */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /* 🔴 الانتقال السلس: لتطبيق الوضع الداكن بسلاسة */
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

body {
    font-family: 'Cairo', sans-serif;
    /* 🔴 الأساس للوضع العادي */
    background-color: #f0f4f7;
    color: #333;
    direction: rtl; 
    text-align: right;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

/* 🔴 🆕 تنسيقات الوضع الداكن (Dark Mode Styles) */
body.dark-mode {
    background-color: #121212; /* خلفية داكنة جداً */
    color: #E0E0E0; /* لون نص فاتح */
}

body.dark-mode .screen {
    background-color: #1E1E1E; /* خلفية شاشات التطبيق الداكنة */
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.4); 
}

/* Auth Screens - تعديل Glassmorphism في الوضع الداكن */
body.dark-mode #auth-container {
    background: linear-gradient(135deg, #1C3F71 0%, #001f3f 100%); 
}
body.dark-mode .auth-box {
    background-color: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
body.dark-mode .auth-box h2 {
    color: #FFCC00; /* عنوان بلون لافت */
}
body.dark-mode .toggle-password {
    color: #FFCC00;
}
body.dark-mode .toggle-password:hover {
    color: #FFD700;
}


/* Form Inputs في الوضع الداكن */
body.dark-mode input[type="text"], 
body.dark-mode input[type="email"], 
body.dark-mode input[type="password"], 
body.dark-mode input[type="tel"],
body.dark-mode input[type="date"],
body.dark-mode textarea, 
body.dark-mode select {
    background-color: #2D2D2D; 
    color: #E0E0E0;
    border: 2px solid #444; 
}
body.dark-mode input:focus, 
body.dark-mode textarea:focus, 
body.dark-mode select:focus {
    border-color: #007bff; 
}
body.dark-mode input[readonly] {
    background-color: #3A3A3A; 
    color: #B0B0B0;
}
body.dark-mode label {
    color: #E0E0E0;
}

/* العناوين في الوضع الداكن */
body.dark-mode h3 {
    color: #FFCC00;
    border-bottom: 2px solid #3A3A3A;
}


/* البطاقات والقوائم في الوضع الداكن */
body.dark-mode .student-count-display {
    background-color: #2D2D2D;
    color: #E0E0E0;
}
body.dark-mode .student-count-display span {
    color: #FFCC00;
}

/* 🔴 🆕 تنسيق بطاقة الطالب الذهبية في الوضع الداكن */
body.dark-mode .student-card {
    background: linear-gradient(135deg, #3A2A00 0%, #2D2D2D 100%); /* خلفية داكنة مع لمسة ذهبية */
    box-shadow: 0 4px 12px rgba(255, 204, 0, 0.2); /* ظل ذهبي */
    border: 1px solid #FFD700; 
}
body.dark-mode .card-header {
    border-bottom: 1px dashed #FFCC00;
}
body.dark-mode .card-info h4 {
    color: #FFD700;
}


/* المودال في الوضع الداكن */
body.dark-mode .modal-content-small {
    background-color: #2D2D2D;
    color: #E0E0E0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
body.dark-mode .modal-content-small p {
    color: #E0E0E0;
}

/* 🔴 🆕 تنسيق مودال التفاصيل الذهبي في الوضع الداكن */
body.dark-mode .modal-content-details {
    /* الخلفية الزجاجية الذهبية الداكنة */
    background-color: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.6); /* ظل ذهبي قوي */
    border-top: 5px solid #FFD700;
}
body.dark-mode .details-name {
    color: #FFD700;
    border-bottom: 2px solid #3A3A3A;
    background-color: #333;
}
body.dark-mode .details-photo {
    border: 5px solid #FFD700;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.8);
}
body.dark-mode .details-info p {
    background-color: #2D2D2D;
    color: #E0E0E0;
    border: 1px solid #444;
}
body.dark-mode .details-info span {
    color: #FFD700;
}
body.dark-mode .modal-content-details-drag {
    background-color: #FFD700;
}
body.dark-mode .btn-back-details {
    background-color: #dc3545;
}
/* نهاية تنسيقات الوضع الداكن */

/* 🔴 ❌ تم حذف تنسيق زر الوضع الداكن القديم بالكامل */

/* 🔴 🆕 تنسيقات أيقونات الوضع الداكن/الفاتح الجديدة */

/* حاوية العنوان والأيقونات */
.header-with-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.header-with-toggle h3 {
    margin-bottom: 0;
    flex-grow: 1; /* للسماح للعنوان بالتمدد */
    border-bottom: none;
}
/* تنسيق حزمة الأيقونات */
.mode-toggle-icons {
    display: flex;
    gap: 15px; /* مسافة بين الشمس والقمر */
    align-items: center;
    flex-shrink: 0; /* لمنع تقلص الأيقونات */
}

.mode-icon {
    font-size: 28px; /* حجم كبير واحترافي */
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.mode-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* الشمس (الوضع العادي) */
.light-mode-icon {
    color: #FFCC00; /* لون ذهبي */
    /* 💡 افتراضياً، الشمس هي النشطة في الوضع العادي */
    opacity: 1; 
}
/* القمر (الوضع الداكن) */
.dark-mode-icon {
    color: #A0A0A0; /* لون رمادي باهت */
}

/* حالة الوضع الداكن (عندما يكون Body يحمل كلاس .dark-mode) */
body.dark-mode .light-mode-icon {
    color: #A0A0A0;
    opacity: 0.6;
}
body.dark-mode .dark-mode-icon {
    color: #FFCC00; /* القمر يصبح ذهبياً */
    opacity: 1;
}

/* 🔴 [الإصلاح]: هذا الكود يضمن أن الأيقونات (التي تستخدم كلاس fas) تستخدم خط Font Awesome */
/* ويجب وضعه في مكان يمكنه تجاوز الخط الافتراضي (Cairo) عند الحاجة */
.fas {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro", sans-serif !important;
    /* تعيين وزن الخط لضمان عمل أيقونات Solid */
    font-weight: 900; 
}

/* ------------------- Global Layout and Screens ------------------- */
.screen {
    width: 100%;
    max-width: 450px; 
    min-height: 100vh;
    /* 🔴 الأساس للوضع العادي */
    background-color: #fff;
    display: none;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.15); /* ظل أقوى وأكثر احترافية */
}

.screen.active {
    display: flex;
}

/* ------------------- Header (اللون الأزرق الداكن والذهبي) ------------------- */
.app-header {
    /* لون أزرق العتبة الحسينية (عميق) */
    background-color: #003366; 
    color: #ffffff;
    padding: 15px 10px;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    border-bottom: 5px solid #FFCC00; /* خط ذهبي سميك للتأكيد */
    position: relative; /* لإحتواء زر الوضع الداكن المطلق */
}

.content-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
}

.app-page {
    padding-bottom: 70px; 
    display: none;
}

.app-page.active {
    display: block;
}

h3 {
    color: #0056b3;
    /* 🔴 تم إزالة margin-bottom: 20px; من هنا ونقلها إلى .header-with-toggle لتجنب التداخل */
    font-size: 22px;
    border-bottom: 2px solid #EEE;
    padding-bottom: 5px;
}
h3 i {
    margin-left: 8px; /* مسافة بين الأيقونة والعنوان */
}

/* ------------------- Auth Screens - 💥 Glassmorphism Effect ------------------- */
#auth-container {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0056B3 0%, #003366 100%); /* خلفية متدرجة */
}

.auth-box {
    background-color: rgba(255, 255, 255, 0.9); /* شفافية خفيفة */
    /* Glassmorphism Effect */
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px);
    
    padding: 30px;
    border-radius: 20px; /* حواف أكثر استدارة */
    width: 90%;
    max-width: 350px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3); /* ظل احترافي */
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: none;
}

.auth-box.active {
    display: block;
}

.auth-box h2 {
    text-align: center;
    color: #003366;
    margin-bottom: 25px;
    font-size: 24px;
}

/* 🔴 إضافة تنسيق حاوية كلمة المرور لزر العين */
.password-container {
    position: relative;
    margin-bottom: 15px; /* لأنه يحتوي على الـ margin-bottom الأساسي */
}
/* إزالة الـ margin-bottom من الـ input داخل الحاوية */
.password-container input[type="password"],
.password-container input[type="text"] {
    margin-bottom: 0;
}

.toggle-password {
    position: absolute;
    left: 10px; /* آيقونة العين على اليسار */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #007bff;
    font-size: 18px; /* حجم أيقونة احترافي */
    transition: color 0.3s;
}
.toggle-password:hover {
    color: #0056b3;
}
/* ------------------- نهاية تنسيق زر العين ------------------- */


/* ------------------- Form Elements and Buttons ------------------- */
input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="tel"],
input[type="date"],
textarea, 
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #DDD; /* إطار أسمك للوضوح */
    border-radius: 8px;
    font-size: 16px;
    text-align: right;
    transition: border-color 0.3s; /* انتقال عند التركيز */
    /* 🔴 الأساس للوضع العادي */
    background-color: #fff;
    color: #333;
}

input:focus, textarea:focus, select:focus {
    border-color: #007bff; /* لون مميز عند التركيز */
    outline: none;
}

input[readonly] {
    background-color: #F8F8F8; 
    color: #666;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 15px;
}

.btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px; /* حواف أكثر استدارة */
    font-size: 18px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s, transform 0.1s, box-shadow 0.3s; /* انتقالات دقيقة */
    font-weight: bold;
}

.btn:active {
    transform: scale(0.98); /* تأثير الضغط الناعم (Micro-Animation) */
}

.btn.primary {
    background-color: #007bff;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.btn.secondary {
    background-color: #f8f9fa;
    color: #007bff;
    border: 2px solid #007bff;
    box-shadow: none;
}
/* 🔴 تنسيق الأزرار في الوضع الداكن */
.dark-mode .btn.secondary {
    background-color: #1E1E1E;
    color: #FFCC00;
    border: 2px solid #FFCC00;
}
.dark-mode .btn.primary {
    background-color: #007bff;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.6);
}

/* تنسيق زر هل نسيت كلمة السر */
.btn.text-link {
    background: none;
    color: #007bff;
    padding: 5px;
    margin-top: 15px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: underline;
    width: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.btn.text-link:hover {
    color: #0056b3;
}
.dark-mode .btn.text-link {
    color: #FFCC00;
}
.dark-mode .btn.text-link:hover {
    color: #FFD700;
}
/* نهاية تنسيق زر هل نسيت كلمة السر */

.btn i {
    margin-left: 8px;
}

/* ------------------- Add Student Screen ------------------- */

.date-inputs {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.date-inputs select {
    width: calc(33.33% - 7px);
    margin-bottom: 15px;
}

.image-label-container {
    display: flex;
    /* 🔴 التعديل: لتوسيط العناصر عمودياً */
    align-items: center; 
    justify-content: space-between;
}
/* 🔴 التعديل: لتوسيط كلمة "صورة الطالب" والأزرار */
.image-label-container label {
    flex-grow: 1; /* للسماح للعنوان بالتمدد */
    text-align: right; 
    margin-bottom: 0; /* إزالة الـ margin-bottom من الـ label */
}


/* 🔴 تعديل: تنسيق أزرار الأيقونات في سطر واحد */
.image-action-buttons {
    display: flex;
    align-items: center;
    gap: 5px; /* مسافة أقل بين زر الحذف وزر التعديل للاقتراب من العنوان */
}

/* 🔴 التعديل: لجعل زر التعديل أيقوني فقط ليتم توسيطه */
#btn-edit-photo {
    font-size: 14px;
    padding: 5px;
    border-radius: 5px;
    /* لجعله أيقونة فقط مع نص أقل */
    color: #007bff;
    font-weight: bold;
    background: none;
}
#btn-edit-photo i {
    margin-left: 5px;
}
.dark-mode #btn-edit-photo {
    color: #FFCC00;
}
.dark-mode .btn-icon:hover {
    color: #FFD700;
}


/* 🔴 التعديل المطلوب: زر حذف الصورة أكثر تكوراً واحترافاً (كزر أيقونة مستقل) */
.btn-icon.delete-photo {
    /* تنسيق زر حذف احترافي (أيقوني) */
    background-color: #dc3545; /* لون أحمر */
    color: white; 
    border-radius: 10px; /* تكور احترافي */
    padding: 8px 10px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
    transition: background-color 0.3s;
    flex-shrink: 0; /* لضمان عدم تقلص الزر */
}

.btn-icon.delete-photo:hover {
    background-color: #a71d2a;
    color: white;
}
/* إخفاء النص من زر التعديل (اختياري، تم الإبقاء على النص في الـ HTML) */
.btn-icon:hover {
    color: #0056b3;
}
.btn-icon i {
    margin-left: 5px;
}


.image-picker-container {
    height: 180px; /* ارتفاع أكبر */
    /* 🔴 الأساس للوضع العادي */
    background-color: #F0F4F7;
    border: 3px dashed #CCC;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s;
}
/* الوضع الداكن */
.dark-mode .image-picker-container {
    background-color: #2D2D2D;
    border: 3px dashed #555;
}

.btn-img-select {
    background-color: transparent;
    color: #007bff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    transition: color 0.3s;
}
/* الوضع الداكن */
.dark-mode .btn-img-select {
    color: #FFCC00;
}


/* 🔴 تعديل مهم: لتظهر الصورة كاملة في شاشة الإضافة/التعديل */
.photo-preview {
    width: 100%;
    height: 100%;
    /* تم تغيير object-fit من cover إلى contain */
    object-fit: contain; 
    background-color: #EFEFEF; /* خلفية خفيفة لـ contain */
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer; /* لجعلها قابلة للضغط للتكبير */
}
/* الوضع الداكن */
.dark-mode .photo-preview {
    background-color: #3A3A3A;
}


/* 🔴 تعديل: لتجميع زر الحفظ وزر إعادة التعيين */
.action-buttons-group {
    display: flex;
    /* 🔴 تم عكس الترتيب ليكون حفظ يمين وإعادة تعيين يسار */
    flex-direction: row-reverse; 
    gap: 10px;
    margin-top: 30px;
}

.action-buttons-group .btn {
    flex: 1; /* لجعل الزرين متساويين في العرض */
    padding: 15px;
    font-size: 18px;
    margin-top: 0;
    border-radius: 12px;
}

.save-button {
    background-color: #4CAF50;
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.5); /* ظل واضح وقوي */
    font-weight: bold;
}

/* 🔴 تنسيق زر إعادة تعيين الحقول */
.reset-button {
    background-color: #FF9800; /* لون برتقالي لافت */
    color: white;
    box-shadow: 0 6px 15px rgba(255, 152, 0, 0.5); 
    font-weight: bold;
}


/* ------------------- View All & Search Screens ------------------- */
.student-count-display {
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
    padding: 10px;
    background-color: #EFEFEF;
    border-radius: 10px;
}
.student-count-display span {
    font-weight: bold;
    color: #003366;
    font-size: 20px;
}

#search-input {
    margin-bottom: 20px;
}

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 🔴 بطاقة الطالب - تصميم احترافي (ذهبي) */
.student-card {
    background: linear-gradient(135deg, #FFEFBA 0%, #FFCC00 100%); /* خلفية متدرجة ذهبية */
    border-radius: 15px; 
    padding: 15px;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.4); /* ظل ذهبي عميق */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
    /* 🔴 إطار ذهبي لافت مع عمق */
    border: 1px solid #FFD700;
}
.student-card:hover {
    transform: translateY(-3px); /* تأثير تحريك طفيف عند المرور */
    box-shadow: 0 6px 20px rgba(255, 204, 0, 0.6);
}

.card-header {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    border-bottom: 1px dashed #B8860B; /* خط متقطع ذهبي داكن */
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.card-image {
    width: 70px; /* حجم أكبر قليلاً */
    height: 70px;
    border-radius: 50%;
    margin-left: 15px;
    object-fit: cover;
    /* 🔴 إطار ذهبي لافت مع عمق */
    border: 3px solid #003366; /* إطار بلون العتبة لتمييز الصورة */
    box-shadow: 0 0 8px rgba(0, 51, 102, 0.5);
    cursor: pointer; 
    transition: border-color 0.3s;
}

.card-info {
    flex-grow: 1;
    text-align: right;
}

.card-info h4 {
    margin: 0;
    font-size: 20px;
    color: #003366; /* لون الاسم بلون الهيدر */
    font-weight: bold;
}

/* 🔴 تعديل الألوان لتناسب البطاقة الذهبية */
.btn-view { background-color: #003366; } 
.btn-edit { background-color: #B8860B; } /* ذهبي داكن */
.btn-delete { background-color: #dc3545; }

/* ------------------- زر الإحصائيات العائم (FAB) ولوحة الإحصائيات ------------------- */
.fab-stats {
    position: fixed;
    bottom: 80px; /* فوق شريط التنقل */
    left: 20px; /* في الزاوية اليسرى */
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: #FFCC00; /* ذهبي لافت */
    color: #003366;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.6);
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.3s, background-color 0.3s;
}
.fab-stats:hover {
    background-color: #FFD700;
    transform: scale(1.05);
}

.side-panel {
    position: fixed;
    top: 0;
    right: 0; 
    width: 100%;
    max-width: 400px; /* عرض مناسب */
    height: 100vh;
    background-color: #F8F9FA;
    padding: 20px;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 99;
    transform: translateX(100%); /* مخفية في البداية */
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
}
.dark-mode .side-panel {
    background-color: #1E1E1E;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.6);
}

.side-panel.open {
    transform: translateX(0);
}
#stats-content p {
    background-color: #EEE;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
}
.dark-mode #stats-content p {
    background-color: #2D2D2D;
    color: #E0E0E0;
}
#stats-content strong {
    color: #0056b3;
}
.dark-mode #stats-content strong {
    color: #FFCC00;
}
#stats-content span {
    font-weight: bold;
    color: #dc3545;
}
.side-panel h3 {
    margin-top: 0;
}
.side-panel .btn.secondary {
    margin-top: 20px;
}


/* ------------------- Bottom Navigation ------------------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 450px;
    background-color: #003366; 
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    height: 65px; /* ارتفاع أكبر قليلاً */
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
    /* ✨ إضافة للعرض الصحيح */
    left: 50%;
    transform: translateX(-50%);
}

.bottom-nav button {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 12px; /* حجم الخط أصغر لإضافة الأيقونة */
    font-weight: bold;
    color: #ffffff; 
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0.7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* ✨ تصحيح مشكلة تداخل النص/الأيقونة */
    text-align: center;
}
.bottom-nav button i {
    font-size: 20px; /* حجم الأيقونة */
    margin-bottom: 3px;
    /* ✨ إزالة أي هامش أيسر/أيمن غير ضروري */
    margin-left: 0; 
    margin-right: 0;
}

.bottom-nav button.active {
    color: #FFCC00; 
    opacity: 1;
    /* خط تحت الزر النشط */
    border-bottom: 4px solid #FFCC00; 
}
.bottom-nav button:hover {
    opacity: 1;
}

/* ------------------- Modals and Notifications ------------------- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
    background-color: rgba(0,0,0,0.8); /* تعتيم أقوى للتركيز على المحتوى */
    justify-content: center;
    align-items: center;
}

/* تم حذف تنسيقات .modal-content و .btn-close-modal القديمة */

.modal-content-small {
    background-color: #fefefe;
    padding: 30px;
    border: none;
    width: 80%; 
    max-width: 400px; /* تحديد عرض أكبر قليلاً لمودال النسيان */
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-content-small p {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.modal-actions {
    display: flex;
    justify-content: space-around;
    margin-top: 25px;
    gap: 10px; /* مسافة بين الأزرار */
}
.modal-actions button {
    width: 48%;
    padding: 12px;
}
/* تعديل عرض أزرار مودال نسيان كلمة المرور لتأخذ عرض أكبر */
#forgot-password-modal .modal-actions button {
    width: 100%;
}
#forgot-password-modal .modal-actions {
    flex-direction: column; /* جعل الأزرار تأتي فوق بعضها البعض */
    gap: 15px;
}

/* 🔴 تنسيق مودال إعادة التعيين والرسائل الاحترافية */
.reset-confirm-modal .modal-content-small {
    background: linear-gradient(135deg, #FFFAE6 0%, #FFFFFF 100%);
    border: 3px solid #FF9800;
}
.reset-confirm-modal p {
    color: #333;
    font-size: 17px;
}
.reset-confirm-modal h3 {
    color: #FF9800;
    font-size: 22px;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 20px;
}
.btn-confirm-reset {
    background-color: #FF9800;
}

/* 🔴 الوضع الداكن لمودال إعادة التعيين */
.dark-mode .reset-confirm-modal .modal-content-small {
    background: linear-gradient(135deg, #3A2A00 0%, #2D2D2D 100%);
    border: 3px solid #FFCC00;
}
.dark-mode .reset-confirm-modal p {
    color: #E0E0E0;
}
.dark-mode .reset-confirm-modal h3 {
    color: #FFCC00;
}


/* ------------------- Details Modal (Bottom Sheet - الذهبي) ------------------- */

#details-modal.modal { 
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
    /* 🔴 🆕 الخلفية الزجاجية الضبابية */
    background-color: rgba(0,0,0,0.3); 
    backdrop-filter: blur(8px); /* تأثير ضبابي على الخلفية */
    -webkit-backdrop-filter: blur(8px);
    
    justify-content: center;
    align-items: flex-end; 
}

/* 🔴 🆕 تصميم المودال الذهبي */
.modal-content-details {
    /* 🔴 خلفية ذهبية فاتحة */
    background: linear-gradient(135deg, #FFEFBA 0%, #FFFDE7 100%);
    width: 100%; 
    max-width: 450px; 
    max-height: 90vh; 
    padding: 0 25px 25px 25px; 
    border-top-left-radius: 25px; 
    border-top-right-radius: 25px;
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.5); /* ظل ذهبي */
    position: relative;
    text-align: right;
    display: flex;
    flex-direction: column;
    
    transform: translateY(100%); 
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    overflow-y: auto; 
    margin-left: auto;
    margin-right: auto;
}

/* مقبض السحب (Draggable Handle) */
.modal-content-details-drag {
    width: 50px; 
    height: 6px;
    background-color: #FFCC00; /* لون ذهبي */
    border-radius: 3px;
    margin: 15px auto 25px; 
    cursor: grab;
    touch-action: none; 
}


#details-modal.modal.visible .modal-content-details {
    transform: translateY(0); 
}

.details-name {
    color: #003366;
    margin-bottom: 20px;
    padding-bottom: 5px;
    border-bottom: 2px solid #FFCC00; /* خط ذهبي */
    font-size: 24px;
    position: sticky; 
    top: -25px; 
    background-color: inherit; /* لضمان أن خلفية العنوان هي نفس خلفية المودال */
    z-index: 1; 
}

.details-photo {
    width: 140px; 
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 25px;
    border: 5px solid #003366; /* إطار بلون العتبة */
    cursor: pointer; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.details-info {
    width: 100%;
    font-size: 16px;
}

.details-info p {
    background-color: #FFF8E1; /* خلفية صفراء فاتحة جداً */
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
    border-right: 5px solid #FFCC00; /* شريط ذهبي جانبي */
}

.details-info span {
    color: #003366;
    font-weight: normal;
    text-align: left;
}

/* زر الرجوع في الأسفل (مثبت) */
.btn-back-details {
    width: 100%; 
    margin-top: 25px;
    padding: 15px;
    border-radius: 12px;
    font-size: 18px;
    background-color: #dc3545; 
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    
    /* تثبيت الزر في أسفل المودال */
    position: sticky;
    bottom: -25px; 
    z-index: 2;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}
.btn-back-details i {
    margin-left: 8px;
}

/* ------------------- 🆕 شاشة التكبير بملء الشاشة (Zoom Screen) ------------------- */
.full-screen-zoom {
    display: none; /* يتم إظهارها عبر JS عند الحاجة */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    max-width: none;
    background-color: #000; /* خلفية سوداء لتبدو مثل معرض الصور */
    z-index: 5000; /* قيمة عالية جداً */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s;
}

.zoom-content-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* لمنع التمرير الافتراضي */
}

#zoom-image {
    max-width: 100%;
    max-height: 100%;
    display: block;
    cursor: grab;
    /* التنسيق الأساسي لـ Transform الذي سيتم تعديله عبر JS */
    transform: translate(0, 0) scale(1); 
    transition: transform 0.1s ease-out; /* انتقال سلس عند التكبير/التصغير */
    /* 🔴 تم التعديل هنا ليكون في المنتصف */
    transform-origin: 50% 50%; 
}

.btn-close-zoom-full {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(220, 53, 69, 0.7); /* أحمر مع شفافية */
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    z-index: 5001;
    transition: background-color 0.3s;
}
.btn-close-zoom-full:hover {
    background-color: #dc3545;
}

/* ------------------- إشعار النجاح (Toast) ------------------- */
.notification {
    position: fixed;
    bottom: 80px; /* فوق شريط التنقل */
    left: 50%;
    transform: translateX(-50%);
    background-color: #4CAF50;
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    z-index: 10000;
    display: none;
    font-weight: bold;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    /* Micro-Animation للظهور */
    opacity: 0;
    /* 🔴 🆕 تحسين انتقال الظهور/الاختفاء */
    transition: opacity 0.3s, transform 0.3s, background-color 0.3s; 
}

.notification.show {
    opacity: 1;
    /* تحريك خفيف للأعلى عند الظهور */
    transform: translate(-50%, -10px); 
}
.dark-mode .notification {
    color: #121212;
}
