:root {
    --bg-dark: #0f111a;
    --card-bg: #181b26;
    --primary: #8b5cf6; 
    --primary-hover: #7c3aed;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #2a2e3f;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

* { box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; -webkit-tap-highlight-color: transparent; }

/* الأساسيات المانعة للتشوه */
html, body { margin: 0; padding: 0; height: 100vh; height: 100dvh; width: 100%; overflow: hidden; background-color: var(--bg-dark); color: var(--text-main); display: flex; flex-direction: column; }

/* الشريط العلوي */
.top-navbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 40px; background-color: rgba(24, 27, 38, 0.8); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); z-index: 1000; flex-shrink: 0; }
.logo-container { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.logo-icon { font-size: 24px; }
.logo-text { font-size: 22px; font-weight: 900; color: var(--text-main); letter-spacing: 0.5px; }
.nav-links { display: flex; gap: 35px; }
.nav-item { color: var(--text-muted); font-weight: 600; font-size: 15px; cursor: pointer; transition: 0.3s; padding: 5px 0; position: relative; display: flex; align-items: center; gap: 5px; }
.nav-item:hover { color: var(--text-main); }
.nav-item.active { color: var(--primary); }
.nav-links .nav-item.active::after { content: ''; position: absolute; bottom: -5px; left: 0; width: 100%; height: 2px; background-color: var(--primary); border-radius: 2px; }
.nav-actions { display: flex; align-items: center; gap: 20px; }
.btn-text { background: none; border: none; color: var(--text-muted); font-weight: 600; font-size: 15px; cursor: pointer; transition: 0.3s; }
.btn-text:hover { color: var(--text-main); }
.btn-signup { background: var(--primary); color: white; border: none; padding: 10px 24px; border-radius: 8px; font-weight: bold; font-size: 14px; cursor: pointer; transition: 0.3s; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-signup:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* شريط الأسعار */
.ticker-container { height: 46px; border-bottom: 1px solid var(--border); background-color: var(--bg-dark); flex-shrink: 0; position: relative; z-index: 50; }

/* منطقة العرض الرئيسية (التي تتحكم بالسحب) */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.view-area { flex: 1; padding: 40px 20px; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; }

/* إجبار الصفحات على دفع الإخلاء للأسفل */
#view-dashboard, #view-analysis, #view-settings { flex: 1 0 auto; width: 100%; }

/* واجهة الهبوط (Hero) */
.hero-container { max-width: 800px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; width: 100%; }
.hero-badge { background: rgba(139, 92, 246, 0.1); color: var(--primary); padding: 8px 16px; border-radius: 50px; font-size: 14px; font-weight: bold; margin-bottom: 20px; display: inline-block; border: 1px solid rgba(139, 92, 246, 0.2); }
.hero-title { font-size: 48px; font-weight: 900; line-height: 1.2; margin: 0 0 20px 0; }
.text-gradient { background: linear-gradient(135deg, #a78bfa, #6d28d9); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { font-size: 18px; color: var(--text-muted); line-height: 1.6; max-width: 600px; margin-bottom: 40px; }
.hero-stats { display: flex; gap: 60px; margin-bottom: 40px; justify-content: center; width: 100%; }
.stat-item { display: flex; flex-direction: column; gap: 5px; text-align: center; }
.stat-val { font-size: 32px; font-weight: 900; }
.stat-label { font-size: 15px; color: var(--text-muted); font-weight: 600; }
.hero-actions { width: 100%; max-width: 400px; margin-bottom: 60px; }
.btn-glow { width: 100%; padding: 18px; background: linear-gradient(135deg, var(--primary), #6d28d9); color: white; border: none; border-radius: 12px; font-size: 18px; font-weight: bold; cursor: pointer; transition: 0.3s; box-shadow: 0 10px 25px rgba(109, 40, 217, 0.4); }
.btn-glow:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(109, 40, 217, 0.6); }

/* الشارت التفاعلي مع تأثير التحويم (Hover Effect) */
.chart-mockup { 
    background: var(--card-bg); 
    border: 1px solid var(--border); 
    border-radius: 16px; 
    width: 100%; 
    max-width: 800px; 
    padding: 25px; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); 
    transition: transform 0.4s ease, box-shadow 0.4s ease; /* سرعة النعومة */
    cursor: crosshair; /* تغيير شكل الماوس ليوحي بالتحليل */
}

/* التأثير السحري عند مرور الماوس */
.chart-mockup:hover {
    transform: scale(1.02); /* التمدد بنسبة 2% */
    box-shadow: 0 30px 60px rgba(139, 92, 246, 0.15); /* توهج بنفسجي خفيف جداً بالأسفل */
}

/* صندوق الإشارة */
.signal-box { background-color: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); border-radius: 12px; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; text-align: right; }
.signal-icon { background-color: var(--success); color: white; min-width: 45px; height: 45px; border-radius: 10px; display: flex; justify-content: center; align-items: center; font-size: 22px; font-weight: bold; }
.signal-text { flex: 1; margin-right: 15px; display: flex; flex-direction: column; }
.signal-text strong { color: var(--success); font-size: 16px; margin-bottom: 4px; }
.signal-text span { color: var(--success); opacity: 0.8; font-size: 13px; }
.signal-confidence { text-align: center; display: flex; flex-direction: column; border-right: 1px solid rgba(16, 185, 129, 0.2); padding-right: 15px; }
.signal-confidence strong { color: var(--success); font-size: 26px; font-weight: 900; line-height: 1; }
.signal-confidence span { color: var(--success); opacity: 0.8; font-size: 12px; margin-top: 4px; }

/* عناصر أخرى (التحليل والإعدادات) */
.app-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 25px; width: 100%; }
.card { background-color: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 25px; }
.upload-area { border: 2px dashed var(--border); border-radius: 12px; padding: 30px 20px; text-align: center; cursor: pointer; transition: 0.3s; background-color: rgba(255,255,255,0.02); }
.upload-area:hover { border-color: var(--primary); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 14px; }
.form-control { width: 100%; padding: 12px; background-color: var(--bg-dark); border: 1px solid var(--border); border-radius: 8px; color: var(--text-main); font-size: 15px; outline: none; }
.btn-primary { width: 100%; padding: 16px; background-color: var(--primary); color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: bold; cursor: pointer; transition: 0.3s; margin-top: 10px; }

/* النتائج */
.signal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-radius: 12px; margin-bottom: 20px; border: 1px solid var(--border); background-color: var(--bg-dark); }
.signal-badge { padding: 12px 25px; border-radius: 8px; font-size: 22px; font-weight: bold; text-align: center; min-width: 140px; }
.signal-buy { background-color: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid var(--success); }
.signal-sell { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid var(--danger); }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 20px; }
.stat-box { background-color: var(--bg-dark); padding: 15px; border-radius: 10px; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.stat-box label { color: var(--text-muted); font-size: 13px; margin: 0; }
.stat-box .value { font-size: 22px; font-weight: bold; color: var(--text-main); }
.box-entry { border-right: 4px solid var(--info); } .box-entry .value { color: var(--info); }
.box-sl { border-right: 4px solid var(--danger); background-color: rgba(239, 68, 68, 0.1); } .box-sl .value { color: var(--danger); }
.box-tp { border-right: 4px solid var(--success); background-color: rgba(16, 185, 129, 0.1); } .box-tp .value { color: var(--success); }
.box-lot { border-right: 4px solid var(--warning); } .box-lot .value { color: var(--warning); }
.analysis-details { background-color: var(--bg-dark); border-radius: 10px; padding: 20px; border: 1px solid var(--border); }

/* إخلاء المسؤولية المطيع */
.legal-disclaimer { flex-shrink: 0; text-align: center; padding: 30px 20px; margin-top: auto; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; line-height: 1.8; width: 100%; }

/* شريط الجوال المخفي افتراضياً */
.mobile-bottom-nav { display: none; }

/* ================= تصميم قائمة الجوال (Hamburger & Overlay) ================= */
.hamburger-btn { display: none; background: none; border: none; color: var(--text-main); font-size: 28px; cursor: pointer; padding: 0; }

.mobile-menu-overlay {
    position: fixed; top: 0; right: 0; width: 100%; height: 100%;
    background-color: var(--bg-dark); z-index: 2000;
    display: flex; flex-direction: column;
    transform: translateX(100%); /* مخفية خارج الشاشة لليمين */
    transition: transform 0.3s ease-in-out;
}
.mobile-menu-overlay.active { transform: translateX(0); /* تدخل للشاشة */ }

.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--border); }
.close-menu-btn { background: none; border: none; color: var(--text-main); font-size: 26px; cursor: pointer; }

.mobile-menu-links { padding: 40px 30px; display: flex; flex-direction: column; gap: 30px; }
.menu-link { font-size: 18px; color: var(--text-main); font-weight: bold; cursor: pointer; transition: 0.2s; }
.menu-link:active { color: var(--primary); transform: scale(0.98); }

/* ==================== استجابة الجوال (Mobile) ==================== */
@media (max-width: 768px) {
    .top-navbar { padding: 15px 20px; }
    .nav-links, .nav-actions { display: none; } /* إخفاء الأزرار العلوية */
    .hamburger-btn { display: block; } /* إظهار الـ 3 شرطات */
    
    .view-area { padding: 30px 15px 40px 15px; } /* مساحة نظيفة بدون شريط سفلي */
    
    .hero-title { font-size: 32px; }
    .hero-subtitle { font-size: 15px; }
    .hero-stats { gap: 30px; }
    .stat-val { font-size: 24px; }
    
    .canvas-container { height: 220px; }
    .signal-box { padding: 12px; }
    .signal-icon { min-width: 35px; height: 35px; font-size: 18px; }
    
    .app-grid { grid-template-columns: 1fr; }
    .signal-header { flex-direction: column; text-align: center; gap: 15px; }
    .signal-badge { width: 100%; }
    
    .legal-disclaimer { font-size: 11px; padding-bottom: 20px; }
    
    /* حذفنا .mobile-bottom-nav نهائياً */
}
