/* =======================================================
   🌍 Global Styles (Rouby Style: Red & White Theme)
   Created for: Eslam Elfeky
   ======================================================= */

/* استدعاء الخط */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    /* --- ☀️ الوضع النهاري (الافتراضي) --- */
    --primary: #D90429;       /* تم التغيير للأحمر بدلاً من البرتقالي */
    --primary-dark: #b90322;  /* أحمر غامق للهوفر */
    --primary-light: #ffe5e9; /* خلفية حمراء فاتحة جداً */
    
    --bg-body: #ffffff;            /* خلفية الموقع بيضاء */
    --bg-card: #ffffff;            /* خلفية الكروت */
    --bg-hero: linear-gradient(180deg, #fff5f6 0%, #ffffff 100%); /* تدرج أحمر خفيف جداً */
    --bg-section: #f9f9f9;
    
    --text-main: #111111;          /* أسود للنص الأساسي */
    --text-gray: #555555;          /* رمادي للنص الفرعي */
    --text-white: #ffffff;
    
    --border: #eeeeee;
    --shadow: 0 5px 20px rgba(0,0,0,0.05);
    --nav-bg: rgba(255, 255, 255, 0.98); /* خلفية الهيدر */
    --header-height: 80px;         /* ارتفاع الهيدر الثابت */
}

/* --- 🌙 الوضع الليلي (Dark Mode) --- */
[data-theme="dark"] {
    --primary: #EF233C;       /* أحمر أفتح قليلاً للوضع الليلي */
    --primary-dark: #ff4d63;
    --primary-light: rgba(239, 35, 60, 0.15);
    
    --bg-body: #0a0a0a;
    --bg-card: #151515;
    --bg-hero: linear-gradient(180deg, #111 0%, #0a0a0a 100%);
    --bg-section: #111111;
    
    --text-main: #f0f0f0;
    --text-gray: #a0a0a0;
    --text-white: #ffffff;
    
    --border: #222222;
    --shadow: 0 5px 20px rgba(0,0,0,0.5);
    --nav-bg: rgba(10, 10, 10, 0.95);
}

/* --- الأساسيات --- */
* { margin: 0; padding: 0; box-sizing: border-box; transition: background-color 0.3s, color 0.3s, border-color 0.3s; }

body { 
    font-family: 'Tajawal', sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    overflow-x: hidden;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    padding-top: var(--header-height); /* هام: لمنع اختفاء المحتوى تحت الهيدر */
}

a { text-decoration: none; transition: 0.3s; color: inherit; }
ul { list-style: none; }
.container { max-width: 1300px; margin: 0 auto; padding: 0 20px; }

/* =======================================================
   🚀 HEADER STYLES
   ======================================================= */

.site-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    background-color: var(--nav-bg);
    box-shadow: var(--shadow);
    z-index: 1000;
    display: flex; align-items: center;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.header-container {
    width: 100%; max-width: 1300px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px;
}

/* اللوجو */
.logo-area img { height: 45px; width: auto; display: block; }
.logo-text-fallback { display: none; font-weight: 800; color: var(--primary); font-size: 1.4rem; }

/* عناصر الديسكتوب */
.desktop-nav { display: none; }

.desktop-nav a {
    text-decoration: none; 
    color: var(--text-main); 
    font-weight: 700; 
    font-size: 1rem; 
    margin: 0 15px; 
    transition: 0.3s;
    white-space: nowrap;
    position: relative;
}
.desktop-nav a:hover, .desktop-nav a.active { color: var(--primary); }

/* تأثير الخط تحت الروابط */
.desktop-nav a.active::after {
    content: ''; position: absolute; bottom: -5px; left: 0; width: 100%; height: 2px; background: var(--primary);
}

/* أزرار الهيدر (الحاوية الرئيسية للأزرار) */
/* 🔴 هذا هو التعديل الهام لإصلاح المشكلة 🔴 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px; /* مسافة بين العناصر */
}

/* زر تغيير الثيم */
.theme-toggle-btn {
    background: transparent; border: 1px solid var(--border);
    color: var(--text-main); cursor: pointer;
    width: 35px; height: 35px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    /* margin-left removed because we use gap now */
    transition: 0.3s;
}
.theme-toggle-btn:hover { border-color: var(--primary); color: var(--primary); }

/* زر الموبايل */
.burger-icon {
    display: block; font-size: 1.6rem; cursor: pointer;
    color: var(--text-main); padding: 5px; margin-left: 2px;
}

/* =======================================================
   📱 MOBILE SIDEBAR
   ======================================================= */
.mobile-sidebar {
    position: fixed; top: 0; right: -320px;
    width: 280px; height: 100vh;
    background: var(--bg-card); 
    z-index: 2000;
    box-shadow: -5px 0 30px rgba(0,0,0,0.15);
    transition: right 0.3s ease-in-out;
    display: flex; flex-direction: column;
    border-left: 3px solid var(--primary);
}
.mobile-sidebar.open { right: 0; }

.sidebar-head { 
    padding: 20px; 
    border-bottom: 1px solid var(--border); 
    display: flex; justify-content: space-between; align-items: center; 
    flex-shrink: 0;
}

.sidebar-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-main); }

.sidebar-menu { 
    list-style: none; padding: 0; margin: 0; 
    overflow-y: auto; flex-grow: 0; 
}

.sidebar-menu li a {
    display: flex; align-items: center; gap: 15px;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    text-decoration: none; color: var(--text-main); font-weight: 600;
}
.sidebar-menu li a:hover { background: var(--bg-hero); color: var(--primary); }
.sidebar-menu li a i { width: 25px; text-align: center; color: var(--primary); }

.sidebar-foot { 
    padding: 25px 20px; 
    border-top: 1px solid var(--border); 
    margin-top: 20px; margin-bottom: auto; 
}

.overlay-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1500; display: none;
}
.overlay-bg.active { display: block; }

/* === Media Queries (الهيدر) === */
@media (min-width: 993px) {
    .desktop-nav { display: flex !important; }
    /* .desktop-actions removed because we handle it via .header-actions now */
    .burger-icon { display: none !important; }
    .mobile-sidebar { display: none !important; }
}

@media (max-width: 992px) {
    .desktop-nav { display: none !important; }
}

/* =======================================================
   🦶 FOOTER STYLES
   ======================================================= */
/* ===========================
   تنسيق الفوتر الاحترافي
   =========================== */
footer {
    background-color: #000000 !important;
    color: #b0b0b0 !important;
    padding-top: 80px;
    margin-top: auto;
    font-size: 0.95rem;
    /* الخط الأحمر العلوي */
    border-top: 5px solid var(--primary); 
    /* الخط الأحمر السفلي - لجعل الحقوق محصورة داخله */
    border-bottom: 5px solid var(--primary); 
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 40px;
    padding-bottom: 40px;
    /* الخط الرمادي الفاصل بين المحتوى والحقوق */
    border-bottom: 1px solid #333; 
    text-align: right;
}

footer h3 {
    color: #ffffff !important;
    font-size: 1.2rem;
    margin-bottom: 25px;
    font-weight: 800;
    position: relative;
    padding-bottom: 10px;
}

footer h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary);
}

footer ul { list-style: none; padding: 0; }
footer ul li { margin-bottom: 12px; }

footer ul li a { 
    color: #b0b0b0 !important; 
    transition: 0.3s;
    display: inline-block;
    text-decoration: none;
}

footer ul li a:hover { 
    color: var(--primary) !important; 
    transform: translateX(-5px); 
}

.footer-about p { line-height: 1.8; opacity: 0.8; }

.contact-item { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 15px; 
    color: #b0b0b0; 
}

.contact-item i { 
    color: var(--primary); 
    font-size: 1.1rem; 
    width: 20px;
    text-align: center;
}

/* --- تنسيق النشرة البريدية المتطور --- */
.newsletter-form {
    display: flex;
    margin-top: 20px;
    background: #1a1a1a;
    padding: 5px;
    border-radius: 50px;
    border: 1px solid #333;
}

.newsletter-form input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 15px;
    color: #fff;
    outline: none;
    font-family: 'Tajawal';
}

.newsletter-form button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: bold;
}

.newsletter-form button:hover {
    background: #fff;
    color: var(--primary);
}

/* --- منطقة الحقوق (المحصورة بين الخطين) --- */
.footer-bottom {
    padding: 20px 0; /* مسافة متوازنة للتوسط بين الخط الرمادي والأحمر */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-socials a {
    color: #fff !important;
    background: #1a1a1a; 
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 10px;
    transition: 0.3s;
}

.footer-socials a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

/* --- إصلاحات الموبايل --- */
@media (max-width: 991px) {
    .footer-grid { 
        grid-template-columns: 1fr; 
        text-align: center; 
        padding-bottom: 30px; 
    }
    footer h3::after { right: 50%; transform: translateX(50%); }
    .contact-item { justify-content: center; }
    .footer-bottom { 
        flex-direction: column; 
        text-align: center; 
        padding: 20px 0;
    }
    .copyright-area { flex-direction: column; gap: 10px; }
}

/* --- زر واتساب العائم --- */
.floating-whatsapp {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 10000;
    transition: 0.3s;
    text-decoration: none;
}

.floating-whatsapp:hover {
    background-color: #128c7e;
    transform: scale(1.1);
}

/* --- زر الحاسبة في الهيدر --- */
.btn-calc-header {
    background-color: var(--primary);
    color: #fff;
    padding: 8px 18px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(217, 4, 41, 0.2);
}

.btn-calc-header:hover {
    background-color: #fff;
    color: var(--primary);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .btn-calc-header span { display: none; }
    .btn-calc-header { 
        padding: 0;
        width: 40px;
        height: 40px;
        justify-content: center;
        border-radius: 50%; 
    }
}

