/* --- الأنماط العامة --- */
/* متغيرات الألوان والخطوط للوضع النهاري (الأساسي) */
:root {
    --bg-color: #f5eada; /* لون الخلفية الرئيسي */
    --text-color: #3a322c; /* لون النص الداكن لتحسين التباين */
    --text-color-light: #5c534d; /* لون النص الفاتح للنصوص الثانوية */
    --card-bg: #ede4d1; /* لون خلفية البطاقات لزيادة الوضوح */
    --card-border: #d3c5a8; /* لون إطار البطاقات */
    --input-bg: #fffbf2; /* لون خلفية حقول الإدخال */
    --input-border: #e0c9a6; /* لون إطار حقول الإدخال */
    --primary-accent: #c76b29; /* اللون البرتقالي الأساسي للأزرار والعناصر المهمة */
    --primary-accent-hover: #a85a22; /* لون الزر عند مرور الماوس فوقه */
    --danger-accent: #993333; /* لون الخطر (لزر الخروج) */
    --danger-accent-hover: #7a2929; /* لون زر الخطر عند مرور الماوس */
    --bottom-bar-bg: #333; /* لون خلفية شريط التنقل السفلي */
    --bottom-bar-text: white; /* لون نص شريط التنقل السفلي */
}

/* متغيرات الألوان عند تفعيل الوضع الليلي */
body[data-theme="dark"] {
    --bg-color: #2c2825;
    --text-color: #f5eada;
    --text-color-light: #d1c8b8;
    --card-bg: rgba(0, 0, 0, 0.2);
    --card-border: rgba(255, 255, 255, 0.2);
    --input-bg: #3a322c;
    --input-border: #555;
    --bottom-bar-bg: #1a1a1a;
}

/* إعدادات أساسية لـ HTML لضمان امتداد الصفحة بالكامل */
html {
    height: 100%;
}

/* إعدادات أساسية لجسم الصفحة */
body {
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif; /* استخدام خط تجول */
    background-color: var(--bg-color); /* تطبيق لون الخلفية من المتغيرات */
    color: var(--text-color); /* تطبيق لون النص من المتغيرات */
    min-height: 100%; /* ضمان امتداد الجسم على كامل الشاشة */
    direction: rtl; /* دعم اللغة العربية من اليمين لليسار */
    text-align: right; /* محاذاة النص لليمين */
    transition: background-color 0.3s, color 0.3s; /* تأثير انتقال ناعم عند تغيير الوضع */
}

/* --- شاشة الترحيب --- */
#splash {
    position: fixed; /* تثبيت الشاشة لتغطية كل شيء */
    width: 100vw; /* عرض كامل الشاشة */
    height: 100vh; /* ارتفاع كامل الشاشة */
    background: #f5eada; /* لون خلفية يتناسب مع الفيديو */
    display: flex; /* لتوسيط الفيديو */
    align-items: center;
    justify-content: center;
    z-index: 100; /* للتأكد من أنها فوق كل العناصر */
    transition: opacity 0.5s ease-out; /* تأثير تلاشي عند الإخفاء */
}
#splash video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: contain; /* عرض الفيديو بالكامل بدون قص */
    transform: translate(-50%, -50%); /* توسيط الفيديو تماماً */
}

/* --- هيكل التطبيق الرئيسي --- */
#main-content {
    display: none; /* إخفاء المحتوى الرئيسي مبدئياً */
    width: 100%;
    min-height: 100vh;
    position: relative;
}
.full-screen-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    padding-top: 140px; /* مساحة للشعار في الأعلى */
    padding-bottom: 100px; /* مساحة لشريط التنقل في الأسفل */
}
.logo {
    width: 120px; /* حجم الشعار */
    height: 120px;
    object-fit: cover;
    border-radius: 20px;
    position: absolute; /* تثبيت الشعار في مكانه */
    top: 20px;
    right: 20px;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* ظل خفيف للشعار */
    border: 2px solid rgba(255,255,255,0.3);
}
.content-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    padding: 30px;
    box-sizing: border-box;
    text-align: center;
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 2px solid var(--card-border);
}
.page-content-container {
     width: 100%;
     max-width: 500px;
     padding: 20px;
}

/* --- الخطوط والعناصر --- */
h1, h2, h3, p, label, span, div {
    color: var(--text-color);
}
p, span {
    color: var(--text-color-light); /* لون أفتح للنصوص الثانوية */
}
h1, h2, h3, .font-bold {
     color: var(--text-color); /* لون أغمق للعناوين والنصوص المهمة */
}

h1 { margin-bottom: 30px; font-size: 28px; text-align: center; }
h2 { text-align: center; margin-bottom: 20px; font-size: 24px; }
        
.btn {
    padding: 12px 24px;
    margin: 10px 0;
    font-size: 18px;
    background-color: var(--primary-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
    transition: background-color 0.3s ease;
    font-weight: 700;
}
.btn:hover { background-color: var(--primary-accent-hover); }
.btn.btn-danger {
    background-color: var(--danger-accent);
}
.btn.btn-danger:hover {
    background-color: var(--danger-accent-hover);
}
        
.input-group { width: 100%; margin-bottom: 20px; text-align: right; }
.input-group label { display: block; margin-bottom: 8px; font-size: 16px; }
.input-group input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    box-sizing: border-box;
    background-color: var(--input-bg);
    color: var(--text-color);
    text-align: right;
}
.link-text { margin-top: 15px; font-size: 15px; }
.link-text a { color: var(--primary-accent); text-decoration: none; font-weight: bold; }

/* --- شريط التنقل السفلي --- */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bottom-bar-bg);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    justify-content: center;
}
.bottom-bar ul { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    width: 100%; 
}
.bottom-bar li { flex: 1; text-align: center; }
.bottom-bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--bottom-bar-text); text-decoration: none; padding: 12px 5px; font-size: 14px; transition: color 0.3s ease; }
.bottom-bar a i { margin-bottom: 4px; }
.bottom-bar a:hover { color: var(--primary-accent); }
.bottom-bar a.active { color: var(--primary-accent); font-weight: bold; }

/* --- صندوق التنبيهات المخصص --- */
.custom-alert { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 1001; justify-content: center; align-items: center; }
.alert-content { background-color: var(--bg-color); border-radius: 15px; padding: 30px; text-align: center; box-shadow: 0 0 20px rgba(0, 0, 0, 0.3); width: 80%; max-width: 400px; }
.alert-content p { font-size: 18px; margin-bottom: 20px; }
.alert-buttons button { background-color: var(--primary-accent); color: #fff; border: none; border-radius: 8px; padding: 12px 24px; font-size: 16px; cursor: pointer; }

/* --- أنماط خاصة بالمكونات --- */
.list-item-card {
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
        
/* --- زر التبديل (للوضع الليلي) --- */
.switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-accent); }
input:checked + .slider:before { transform: translateX(26px); }

/* --- التصميم المتجاوب (للشاشات الصغيرة) --- */
@media (max-width: 600px) {
    .logo { 
        width: 90px;
        height: 90px;
        top: 15px; 
        right: 15px; 
    }
    h1 { font-size: 24px; }
    .btn, .alert-buttons button { font-size: 16px; padding: 10px 20px; }
    .input-group input { font-size: 14px; }
    .bottom-bar a { font-size: 10px; padding: 8px 3px; }
    .bottom-bar a i { font-size: 20px; }
}
