* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* حماية تامة لجميع العناصر من الخروج عن الشاشة بسبب البادينج */
}

body {
      font-family: 'Plus Jakarta Sans', 'Amiri', serif !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    background-color: #0A0E27;
    color: #E5E5E5;
    direction: rtl;
    padding: 40px 15px; /* تقليل البادينج قليلاً ليتناسب مع حواف الهواتف */
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

h1 {
    color: #B8860B;
    font-size: 36px;
    margin-bottom: 12px;
    font-weight: 700;
}

.intro {
    color: #A0A8C0;
    font-size: 17px;
    margin-bottom: 45px;
}

/* شبكة الكروت الأساسية: 3 أعمدة مرنة على الشاشات الكبيرة */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 60px;
}

.card {
    background-color: #131733;
    border-radius: 14px;
    padding: 30px 22px;
    border: 1px solid #1E2347;
    border-top: 3px solid #B8860B;
    transition: 0.4s;
}

.card:hover {
    transform: translateY(-6px);
    border-color: #B8860B;
    box-shadow: 0 10px 30px rgba(184, 134, 11, 0.25);
}

/* أيقونات SVG رصينة */
.icon-svg {
    width: 50px;
    height: 50px;
    margin-bottom: 18px;
    fill: #B8860B;
}

.card h3 {
    color: #B8860B;
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.card p {
    color: #C5C8D4;
    font-size: 15px;
    line-height: 1.8;
}

/* قسم الكتب 1 */
.books-section {
    background-color: #131733;
    padding: 40px 30px;
    border-radius: 16px;
    border: 1px solid #1E2347;
    margin-bottom: 40px;
}

.books-section h2 {
    color: #B8860B;
    font-size: 28px;
    margin-bottom: 25px;
}

.book-card {
    background-color: #0A0E27;
    padding: 30px;
    border-radius: 10px;
    border-right: 4px solid #B8860B;
    text-align: right;
}

.book-card h3 {
    color: #B8860B;
    font-size: 22px;
    margin-bottom: 12px;
}

.book-card p {
    color: #A0A8C0;
    font-size: 16px;
    margin-bottom: 22px;
}

.book-buttons {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap; /* تتيح نزول الأزرار تحت بعضها لو انضغطت الشاشة */
}

.btn-download, .btn-buy {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: 0.3s;
    text-align: center;
}

.btn-download {
    background-color: #B8860B;
    color: #0A0E27;
}

.btn-buy {
    background-color: transparent;
    color: #B8860B;
    border: 1.5px solid #B8860B;
}

.btn-download:hover, .btn-buy:hover {
    background-color: #D4A017;
    color: #0A0E27;
    transform: translateY(-2px);
}

/* قسم الكتب 2 (تم إصلاح خطأ الاسم البرمجي) */
.books-sectior {
    background-color: #131733;
    padding: 40px 30px;
    border-radius: 16px;
    border: 1px solid #1E2347;
    margin-top: 60px;
    margin-bottom: 40px;
}

.books-sectior h2 {
    color: #B8860B;
    font-size: 28px;
    margin-bottom: 25px;
}

.book-carr {
    background-color: #0A0E27;
    padding: 30px;
    border-radius: 10px;
    border-right: 4px solid #B8860B;
    text-align: right;
}

.book-button {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.btn-downloar, .btn-bur {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: 0.3s;
    text-align: center;
}

.btn-downloar {
    background-color: #B8860B;
    color: #0A0E27;
}

.btn-bur {
    background-color: transparent;
    color: #B8860B;
    border: 1.5px solid #B8860B;
}

.btn-downloar:hover, .btn-bur:hover {
    background-color: #D4A017;
    color: #0A0E27;
    transform: translateY(-2px);
}

/* قسم الاقتباس */
.quote-section {
    background: linear-gradient(135deg, #131733 0%, #0A0E27 100%);
    padding: 45px 30px;
    border-radius: 14px;
    margin-bottom: 40px;
    border: 1px solid #1E2347;
    border-top: 3px solid #B8860B;
}

.quote-icon {
    width: 40px;
    height: 40px;
    fill: #B8860B;
    opacity: 0.5;
    margin-bottom: 15px;
}

.quote-section p {
    color: #E5E5E5;
    font-size: 24px; /* تقليله سنة ليكون متزناً على الهواتف */
    line-height: 1.8;
    margin-bottom: 12px;
    font-family: 'Amiri', serif;
    font-weight: 400;
}

.quote-section span {
    color: #B8860B;
    font-size: 19px;
    font-weight: 600;
}

/* قسم الإحصائيات */
.stats-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}

.stat {
    background-color: #131733;
    padding: 25px 15px;
    border-radius: 12px;
    border: 1px solid #1E2347;
    text-align: center;
    transition: 0.3s;
}

.stat:hover {
    border-color: #B8860B;
    transform: translateY(-4px);
}

.stat h4 {
    color: #B8860B;
    font-size: 34px;
    margin-bottom: 8px;
    font-weight: 700;
}

.stat p {
    color: #A0A8C0;
    font-size: 14px;
}

/* الفاصل الزخرفي */
.divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #B8860B, transparent);
    margin: 40px auto;
    width: 60%;
}

/* قسم الخط الزمني */
.timeline-section {
    margin-bottom: 50px;
}

.timeline-section h2 {
    color: #B8860B;
    font-size: 26px;
    margin-bottom: 35px;
    text-align: center;
}

.timeline {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 50%;
    transform: translateX(50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, #B8860B, #1E2347);
}

.timeline-item {
    background-color: #131733;
    border: 1px solid #1E2347;
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 25px;
    position: relative;
    width: calc(50% - 25px); /* توزيع متوازن ومحمي */
    margin-right: auto;
    transition: 0.3s;
    text-align: right;
}

.timeline-item:nth-child(even) {
    margin-right: 0;
    margin-left: auto;
}

.timeline-item:hover {
    border-color: #B8860B;
    transform: translateY(-3px);
}

/* ==========================================================================
   أكواد التجاوب التام لجميع عناصر الكود المذكور على التابلت والموبايل
   ========================================================================== */
@media (max-width: 768px) {
    h1 { font-size: 28px; }
    .cards { 
        grid-template-columns: repeat(2, 1fr); /* عمودين بدلاً من ثلاثة للتابلت */
        gap: 15px;
    }
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
    .books-section, .books-sectior {
        padding: 30px 15px;
    }
    /* تحويل الخط الزمني ليصبح عموداً واحداً فخماً جهة اليمين بدلاً من الانقسام */
    .timeline::before {
        right: 15px; /* نقل الخط لليمين بالكامل */
        transform: none;
    }
    .timeline-item {
        width: calc(100% - 40px) !important;
        margin-right: 40px !important;
        margin-left: 0 !important;
    }
}

@media (max-width: 480px) {
    body { padding: 25px 10px; }
    h1 { font-size: 24px; }
    .intro { margin-bottom: 30px; font-size: 15px; }
    .cards { 
        grid-template-columns: 1fr; /* عمود واحد مريح جداً لشاشات الموبايل الضيقة */
    }
    .stats-section {
        grid-template-columns: 1fr;
    }
    .quote-section p {
        font-size: 19px;
    }
    .btn-download, .btn-buy, .btn-downloar, .btn-bur {
        width: 100%; /* جعل أزرار الكتب تملأ العرض بالكامل لتسهيل الضغط على الموبايل */
    }
}












.timeline-item:nth-child(even):hover {
    transform: translateY(-3px);
}

.year {
    background-color: #B8860B;
    color: #0A0E27;
    font-size: 14px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 8px;
}

.timeline-item p {
    color: #C5C8D4;
    font-size: 15px;
    line-height: 1.7;
}

/* نقطة الدائرة على الخط الزمني للكمبيوتر */
.timeline-item::after {
    content: '';
    position: absolute;
    top: 25px;
    right: -31px; /* تم ضبطها بدقة لتتوسط الخط تماماً */
    width: 12px;
    height: 12px;
    background-color: #B8860B;
    border-radius: 50%;
    border: 3px solid #0A0E27;
    z-index: 2;
}

.timeline-item:nth-child(even)::after {
    right: auto;
    left: -31px;
}

/* شريط الشعارات والمؤسسات - نسخة مكبرة فخمة */
.logos-section {
    margin-bottom: 50px;
    padding: 50px 30px;
    background-color: #131733;
    border-radius: 16px;
    border: 1px solid #1E2347;
    border-top: 3px solid #B8860B;
    width: 100%;
    box-sizing: border-box;
}

.logos-title {
    color: #B8860B;
    font-size: 24px;
    margin-bottom: 40px;
    text-align: center;
    font-weight: 700;
}

/* شبكة الشعارات: 4 أعمدة متناسقة على الكمبيوتر */
.logos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    align-items: center;
}

.logo-item {
    text-align: center;
    transition: 0.3s;
    padding: 15px;
}

.logo-item svg {
    width: 100px;  
    height: 100px; 
    margin-bottom: 15px;
    opacity: 1;    
    transition: 0.3s
}

.logo-item:hover svg {
    transform: scale(1.15);
    stroke-width: 3; 
}

.logo-item span {
    display: block;
    color: #E5E5E5; 
    font-size: 17px; 
    font-weight: 600; 

}

/* ==========================================================================
   📱 كود الـ Media Queries المطور والذكي البديل بالكامل لكودك القديم
   ========================================================================== */
@media (max-width: 768px) {
    /* إلغاء أي أحجام ثابتة للكلاس .bas المجهول وإعطائه مرونة */
    .bas {
        width: 100% !important;
        max-width: 400px;
        height: auto !important;
    }  

    body {
        padding: 30px 15px;
    }

    h1 {
        font-size: 28px;
        line-height: 1.4;
    }

    .intro {
        font-size: 16px;
        margin-bottom: 35px;
    }

    /* تحويل كل الشبكات المكونة من أعمدة متعددة إلى عمود واحد أو اثنين حسب المساحة */
    .cards, .stats-section {
        grid-template-columns: 1fr !important;
        gap: 15px;
        margin-bottom: 40px;
    }

    .card, .stat {
        padding: 20px 15px;
    }

    .icon-svg {
        width: 46px;
        height: 46px;
        margin-bottom: 14px;
    }

    .quote-section {
        padding: 30px 20px;
        margin-bottom: 40px;
    }
    
    .quote-section p {
        font-size: 20px;
    }

    .timeline-section h2, .books-section h2, .books-sectior h2 {
        font-size: 24px;
        margin-bottom: 30px;
    }

    /* 🛠️ هندسة الخط الزمني على الموبايل ليصبح عموداً واحداً انسيابياً جهة اليمين */
    .timeline {
        padding-right: 25px;
        margin-right: 5px;
    }
    
    /* نقل الخط الممتد ليكون في أقصى اليمين بدلاً من المنتصف */
    .timeline::before {
        right: 15px !important;
        transform: none !important;
    }

    /* جعل كروت المحطات تملأ العرض المتاح وتصطف خلف بعضها بنظافة */
    .timeline-item {
        width: calc(100% - 30px) !important;
        margin-right: 30px !important;
        margin-left: 0 !important;
        padding: 15px;
        margin-bottom: 20px;
    }

    /* ضبط مكان النقاط الدائرية لتقع فوق الخط تماماً في كل المحطات بدون تداخل */
    .timeline-item::after, .timeline-item:nth-child(even)::after {
        right: -36px !important;
        left: auto !important;
        top: 22px;
    }

    /* 🛠️ تنظيف وتطويع أقسام الكتب (طردنا الـ 350px والـ 450px الثابتة) */
    .books-section, .books-sectior {
        width: 100% !important;  /* تأخذ عرض الحاوية بالكامل */
        height: auto !important; /* الارتفاع حر يتحدد بناءً على النصوص المكتوبة بالداخل لمنع الكبس */
        padding: 25px 15px !important;
    }

    .book-card, .book-carr {
        width: 100% !important;  /* الكرت الداخلي يملأ المساحة بنسبة 100% */
        padding: 25px 20px !important;
        margin-bottom: 20px !important;
    }

    /* جعل الأزرار تأخذ شكلاً طولياً ممتازاً على شاشات الجوال لسهولة الضغط */
    .book-buttons, .book-button {
        flex-direction: column !important;
        gap: 10px;
    }

    .btn-download, .btn-buy, .btn-downloar, .btn-bur {
        width: 100% !important;
        display: inline-flex;
        justify-content: center;
        padding: 14px;
    }

    /* كروت المؤسسات والشعارات: جعلناها صفين متزنين (2 في كل صف) مع ترك الارتفاع تلقائي */
    .logos-section {
        padding: 30px 15px;
    }
    
    .logos-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
        height: auto !important; /* طردنا الـ 230px القديمة التي كانت تسبب تداخل الشعارات */
    }

    .logo-item {
        padding: 10px;
    }

    .logo-item svg {
        width: 70px;  /* تصغير الشعارات قليلاً لتناسب شاشة الجوال */
        height: 70px;
    }

    .logo-item span {
        font-size: 14px;
    }
    
}
