/* ==========================================================================
   BS Training International - Master Stylesheet
   Architecture: Modern CSS with Variables, Flexbox, CSS Grid & Glassmorphism
========================================================================== */

/* --- 1. استيراد الخطوط (Google Fonts - Cairo) --- */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;700;900&display=swap');

/* --- 2. متغيرات التصميم (Design Tokens) الألوان الجديدة --- */
:root {
    /* الألوان الأساسية الجديدة التي اخترتها */
    --clr-primary: #2c85c8;          /* الأزرق الاحترافي */
    --clr-primary-dark: #21679e;     /* أزرق داكن لتأثيرات الأزرار */
    --clr-secondary: #c59936;        /* الذهبي الفخم */
    --clr-secondary-dark: #9e7929;   /* ذهبي داكن للتأثيرات */
    
    /* ألوان الخلفيات والنصوص */
    --clr-bg-main: #f4f7f6;
    --clr-bg-surface: #ffffff;
    --clr-text-main: #2d3748;
    --clr-text-muted: #718096;
    --clr-footer-bg: #1a202c;
    
    /* التنسيقات الهندسية */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 50px;
    
    /* الظلال (Shadows) - تم تحديث لون الظل الإشعاعي ليتناسب مع الأزرق الجديد */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
    --shadow-glow: 0 10px 25px rgba(44, 133, 200, 0.3); /* توهج أزرق ناعم */
    
    /* الحركات الانتقالية */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- 3. إعادة الضبط العامة (CSS Reset) --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--clr-bg-main);
    color: var(--clr-text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--clr-primary); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--clr-primary-dark); }

/* --- 4. الهيكل الأساسي (Layout) --- */
.app-main { flex: 1; width: 100%; position: relative; z-index: 1; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- 5. الهيدر (تأثير الزجاج - Glassmorphism) --- */
.site-header {
    position: sticky; top: 0; width: 100%; z-index: 1000;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.3); box-shadow: var(--shadow-sm); padding: 12px 0; transition: var(--transition-smooth);
}
.header-container { display: flex; justify-content: space-between; align-items: center; }
.brand-logo img { height: 60px; width: auto; transition: var(--transition-fast); filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.brand-logo img:hover { transform: translateY(-2px) scale(1.02); }

.header-actions { display: flex; align-items: center; gap: 15px; }

.action-btn {
    background: var(--clr-bg-main); border: 1px solid rgba(0,0,0,0.05); width: 48px; height: 48px;
    border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer;
    color: var(--clr-primary); transition: var(--transition-smooth); box-shadow: var(--shadow-sm);
    font-weight: 800; font-size: 1.1rem; font-family: 'Cairo', sans-serif;
}
.action-btn:hover { background: var(--clr-primary); color: white; box-shadow: var(--shadow-glow); }
.menu-trigger:hover { transform: rotate(90deg); }
.lang-trigger:hover { transform: translateY(-3px); }

/* --- 6. القائمة الجانبية (Sidebar) --- */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px); z-index: 1001; opacity: 0; visibility: hidden; transition: var(--transition-smooth); }
.sidebar-overlay.is-active { opacity: 1; visibility: visible; }

.offcanvas-sidebar {
    position: fixed; top: 0; right: -400px; width: 100%; max-width: 380px; height: 100vh;
    background: var(--clr-bg-surface); z-index: 1002; box-shadow: -10px 0 40px rgba(0,0,0,0.1);
    display: flex; flex-direction: column; transition: right 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.offcanvas-sidebar.is-active { right: 0; }

html[dir="ltr"] .offcanvas-sidebar { right: auto; left: -400px; box-shadow: 10px 0 40px rgba(0,0,0,0.1); transition: left 0.5s cubic-bezier(0.25, 1, 0.5, 1); }
html[dir="ltr"] .offcanvas-sidebar.is-active { left: 0; }

.sidebar-header { padding: 30px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #edf2f7; }

/* تحديث ألوان العنوان في القائمة ليتناسب مع الأزرق الجديد */
.sidebar-title { font-size: 1.5rem; font-weight: 900; background: linear-gradient(45deg, var(--clr-primary), #1a517b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.close-sidebar { background: #fee2e2; color: #ef4444; border: none; width: 40px; height: 40px; border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: var(--transition-fast); }
.close-sidebar:hover { background: #ef4444; color: white; transform: scale(1.1) rotate(90deg); }

.sidebar-body { padding: 20px; overflow-y: auto; flex: 1; }
.nav-item {
    display: flex; align-items: center; padding: 16px 20px; margin-bottom: 12px; border-radius: var(--radius-md);
    color: var(--clr-text-main); text-decoration: none; font-weight: 700; font-size: 1.1rem; background: #f8fafc;
    border: 1px solid transparent; transition: var(--transition-fast);
}
.nav-item:hover { background: white; border-color: var(--clr-primary); color: var(--clr-primary); transform: translateX(-8px); box-shadow: 0 4px 15px rgba(44, 133, 200, 0.08); }
html[dir="ltr"] .nav-item:hover { transform: translateX(8px); }
.nav-icon { margin-left: 15px; font-size: 1.4rem; flex-shrink: 0; }
html[dir="ltr"] .nav-icon { margin-left: 0; margin-right: 15px; }
.nav-text { flex: 1; white-space: normal; line-height: 1.4; word-break: break-word; }

/* --- 7. الفوتر (Footer) --- */
.site-footer { background: var(--clr-footer-bg); color: white; padding: 80px 0 20px; border-top: 5px solid var(--clr-secondary); position: relative; overflow: hidden; }

/* تحديث لون الدائرة الخلفية في الفوتر */
.site-footer::before { content: ''; position: absolute; top: -50px; right: -50px; width: 200px; height: 200px; background: radial-gradient(circle, rgba(44,133,200,0.1) 0%, transparent 70%); border-radius: 50%; }
html[dir="ltr"] .site-footer::before { right: auto; left: -50px; }

.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 50px; position: relative; z-index: 2; }
.footer-brand h3 { color: var(--clr-secondary); font-size: 1.8rem; font-weight: 900; margin-bottom: 20px; }
.footer-desc { color: #a0aec0; font-size: 1.05rem; margin-bottom: 25px; }
.footer-heading { font-size: 1.3rem; color: white; margin-bottom: 25px; position: relative; padding-bottom: 12px; }
.footer-heading::after { content: ''; position: absolute; right: 0; bottom: 0; width: 60px; height: 3px; background: var(--clr-primary); border-radius: var(--radius-pill); }
html[dir="ltr"] .footer-heading::after { right: auto; left: 0; }

.footer-links-list { display: flex; flex-direction: column; gap: 16px; }
.footer-link { color: #cbd5e0; text-decoration: none; transition: var(--transition-fast); display: inline-flex; align-items: center; }
.footer-link::before { content: '←'; color: var(--clr-primary); margin-left: 10px; transition: var(--transition-fast); }
html[dir="ltr"] .footer-link::before { content: '→'; margin-left: 0; margin-right: 10px; }
.footer-link:hover { color: var(--clr-secondary); }
.footer-link:hover::before { transform: translateX(-5px); }
html[dir="ltr"] .footer-link:hover::before { transform: translateX(5px); }

.contact-info { color: #cbd5e0; line-height: 2.2; }
.contact-highlight { color: var(--clr-secondary); font-weight: 700; display: block; margin-top: 10px;}
.social-network { display: flex; gap: 12px; flex-wrap: wrap; }
.social-btn { width: 45px; height: 45px; border-radius: 50%; background: rgba(255,255,255,0.05); display: flex; justify-content: center; align-items: center; color: white; text-decoration: none; transition: var(--transition-fast); border: 1px solid rgba(255,255,255,0.1); }
.social-btn:hover { background: var(--clr-primary); transform: translateY(-5px); box-shadow: var(--shadow-glow); border-color: transparent; }
.footer-copyright { text-align: center; padding-top: 30px; margin-top: 50px; border-top: 1px solid rgba(255,255,255,0.05); color: #718096; font-size: 0.95rem; }

/* ==========================================================================
   نظام الترجمة الفوري والصديق لمحركات البحث (SEO Language Toggle)
========================================================================== */
body.en .lang-ar { display: none !important; }
body.ar .lang-en { display: none !important; }

/* --- 8. التوافق مع الهواتف (Responsive Media Queries) --- */
@media (max-width: 768px) {
    .site-header { padding: 10px 15px; }
    .brand-logo img { height: 45px; }
    .header-actions { gap: 10px; }
    .action-btn { width: 42px; height: 42px; font-size: 1rem; }
    .offcanvas-sidebar { width: 300px; }
    .sidebar-title { font-size: 1.3rem; }
    .nav-item { font-size: 0.95rem; padding: 12px 15px; margin-bottom: 8px; }
    .nav-icon { font-size: 1.2rem; }
    .footer-grid { text-align: center; gap: 40px; }
    .footer-heading::after, html[dir="ltr"] .footer-heading::after { left: 50%; right: auto; transform: translateX(-50%); }
    .social-network, .footer-link { justify-content: center; }
    .footer-link::before { display: none; }
}
