/* =========================================
   1. المتغيرات الأساسية (Variables)
========================================= */
:root {
    --primary-blue: #3A41E8;
    --primary-purple: #8B85FE;
    --dark-blue: #1C1D2A;
    --bg-color: #F4F6FC;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-main: #14151A;
    --text-muted: #6B7280;
    --card-bg: #ffffff;
    --card-hover-bg: #ffffff;
    --footer-bg: rgba(255, 255, 255, 0.4);
    --danger-color: #EF4444;
    --success-color: #10B981;
}

body.dark-mode {
    --dark-blue: #FFFFFF;
    --bg-color: #0B0E14;
    --glass-bg: rgba(20, 24, 36, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #E2E8F0;
    --text-muted: #94A3B8;
    --card-bg: rgba(30, 35, 50, 0.8);
    --card-hover-bg: rgba(40, 45, 65, 0.9);
    --footer-bg: rgba(20, 24, 36, 0.6);
    --danger-bg: rgba(239, 68, 68, 0.1);
    --input-bg: rgba(40, 45, 65, 0.6);
}

/* =========================================
   2. الإعدادات العامة (Global Styles)
========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Cairo', sans-serif; }
html, body { overflow-x: hidden; background-color: var(--bg-color); color: var(--text-main); scroll-behavior: smooth; transition: background-color 0.4s ease, color 0.4s ease; }

/* --- الخلفية المتحركة --- */
.bg-mesh { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; background: var(--bg-color); transition: 0.4s; overflow: hidden; }
.bg-mesh::before, .bg-mesh::after { content: ''; position: absolute; border-radius: 50%; filter: blur(100px); animation: moveMesh 20s infinite alternate ease-in-out; }
.bg-mesh::before { width: 600px; height: 600px; background: rgba(139, 133, 254, 0.3); top: -100px; right: -100px; }
.bg-mesh::after { width: 500px; height: 500px; background: rgba(58, 65, 232, 0.2); bottom: -100px; left: -100px; animation-delay: -5s; }

@keyframes moveMesh {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-100px, 100px) scale(1.2); }
    100% { transform: translate(100px, -50px) scale(0.9); }
}

/* =========================================
   3. شريط التنقل (Navbar)
========================================= */
.navbar { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 1200px; display: flex; justify-content: space-between; align-items: center; padding: 15px 30px; background: var(--glass-bg); backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: 24px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); z-index: 1000; transition: 0.4s; }
.nav-brand img { height: 35px; transition: 0.4s; }
body.dark-mode .nav-brand img { filter: brightness(0) invert(1); }

.nav-links { display: flex; gap: 30px; list-style: none; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-main); font-weight: 700; font-size: 15px; position: relative; transition: 0.3s; }
.nav-links a::after { content: ''; position: absolute; bottom: -5px; right: 0; width: 0; height: 3px; background: var(--primary-blue); border-radius: 5px; transition: 0.3s; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a:hover, .nav-links a.active { color: var(--primary-blue); }

.nav-actions { display: flex; align-items: center; gap: 15px; }
.theme-switch { background: var(--glass-bg); border: 1px solid var(--glass-border); width: 40px; height: 40px; border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer; color: var(--text-main); transition: 0.3s; font-size: 18px; }
.theme-switch:hover { color: var(--primary-blue); transform: rotate(15deg); }

.add-btn { background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple)); color: white; padding: 12px 24px; border-radius: 14px; text-decoration: none; font-weight: 700; box-shadow: 0 10px 20px rgba(58, 65, 232, 0.2); transition: all 0.3s ease; display: inline-block; }
.add-btn:hover { transform: translateY(-3px); box-shadow: 0 15px 25px rgba(58, 65, 232, 0.4); }

.menu-toggle { display: none; font-size: 24px; color: var(--primary-blue); cursor: pointer; transition: 0.3s; }
.mobile-add-btn { display: none; }
.menu-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 998; opacity: 0; transition: 0.4s; }

/* =========================================
   4. العناوين المشتركة (Page Headers)
========================================= */
.page-header { padding: 140px 20px 40px; text-align: center; max-width: 800px; margin: 0 auto; animation: fadeInDown 0.8s ease; }
.page-header h1 { font-size: 42px; font-weight: 900; color: var(--dark-blue); margin-bottom: 15px; transition: 0.4s;}
.text-gradient { background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: inline-block;}
.page-header p { font-size: 16px; font-weight: 600; color: var(--text-muted); transition: 0.4s; line-height: 1.8;}

/* =========================================
   5. الفوتر (Footer)
========================================= */
.glass-footer { background: var(--footer-bg); backdrop-filter: blur(25px); border-top: 1px solid var(--glass-border); padding: 60px 20px 20px; position: relative; z-index: 5; transition: 0.4s; }
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand img { height: 40px; margin-bottom: 20px; transition: 0.4s; }
.footer-brand p { color: var(--text-muted); font-size: 14px; line-height: 1.8; margin-bottom: 20px; max-width: 350px; font-weight: 600; transition: 0.4s;}
.social-icons { display: flex; gap: 15px; }
.social-icons a { width: 40px; height: 40px; border-radius: 12px; background: var(--card-bg); display: flex; justify-content: center; align-items: center; color: var(--primary-blue); transition: 0.3s; text-decoration: none; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.social-icons a:hover { background: var(--primary-blue); color: white; transform: translateY(-3px); }
.footer-title { font-size: 18px; font-weight: 800; margin-bottom: 20px; color: var(--dark-blue); transition: 0.4s;}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: 0.3s; font-size: 14px; font-weight: 700; }
.footer-links a:hover { color: var(--primary-purple); padding-right: 5px; }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid var(--glass-border); color: var(--text-muted); font-size: 13px; font-weight: 700; transition: 0.4s;}
.footer-bottom span { color: var(--primary-purple); font-weight: 900; }

/* =========================================
   6. حركات الانيميشن المشتركة
========================================= */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   7. التجاوب مع الموبايل (المشترك)
========================================= */
@media (max-width: 992px) {
    .navbar { width: 95%; padding: 12px 20px; top: 10px; border-radius: 18px; }
    /* تم حذف سطر .menu-overlay { display: block; } من هنا */
    .menu-overlay.active { opacity: 1; z-index: 998; }
    .menu-toggle { display: block; position: relative; z-index: 1000; }
    .desktop-add-btn, .desktop-profile { display: none !important; }
    
    .nav-links { position: fixed; top: 0; right: -300px; width: 280px; height: 100vh; background: var(--glass-bg); backdrop-filter: blur(25px); border-left: 1px solid var(--glass-border); border-radius: 24px 0 0 24px; flex-direction: column; padding: 100px 30px 30px; gap: 25px; box-shadow: -10px 0 30px rgba(0,0,0,0.1); transition: right 0.4s; z-index: 999; }
    .nav-links.active { right: 0; }
    .nav-links a { font-size: 18px; width: 100%; display: block; }
    .nav-links a::after { display: none; }
    .theme-switch { margin-top: auto; width: 100%; border-radius: 12px; padding: 10px; background: rgba(139, 133, 254, 0.1); border: none; }
    .mobile-add-btn { display: block; width: 100%; margin-top: 20px; }
    .mobile-add-btn .add-btn { width: 100%; text-align: center; }
    
    .page-header { padding: 120px 20px 20px; }
    .page-header h1 { font-size: 32px; }
    
    .footer-container { grid-template-columns: 1fr; text-align: center; }
    .footer-brand p { margin: 0 auto 20px; }
    .social-icons { justify-content: center; }
}

/* ستايل زر البروفايل بالنافبار */
.profile-btn { display: flex; align-items: center; gap: 8px; background: var(--card-bg); border: 1px solid var(--glass-border); padding: 6px 15px 6px 6px; border-radius: 30px; text-decoration: none; color: var(--text-main); font-weight: 700; font-size: 14px; transition: 0.3s; }
.profile-btn:hover { border-color: var(--primary-blue); color: var(--primary-blue); }

@media (max-width: 992px) {
    .desktop-profile { display: none !important; }
}
@media (min-width: 993px) {
    .mobile-profile { display: none !important; }
}