/* ====== 1. المتغيرات والتأسيس ====== */
:root {
    --light-sky: #eef5ff;
    --dark-blue: #2c5d87;
    --gold: #d4af37;
    --btn-shadow: #5da0bc;
    --header-bg: linear-gradient(to right, #add8e6, #e0f2f7);
    --white: #ffffff;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
    /* خلفية المكتبة مع طبقة شفافة لجعل النص واضحاً */
    background: linear-gradient(rgba(238, 245, 255, 0.9), rgba(238, 245, 255, 0.9)), 
                url('library-bg.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #333;
}

a { text-decoration: none; }

/* ====== 2. الهيدر واللوجو ====== */
.site-header { 
    text-align: center; 
    padding: 30px 20px; /* تم ضبط المسافات لرفع المحتوى */
    background: var(--header-bg); 
    position: relative; 
    border-bottom: 4px solid var(--white); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.site-logo { 
    max-width: 550px; 
    width: 100%; 
    height: auto; 
    display: block;
    margin: 0 auto;
    mix-blend-mode: multiply; /* دمج اللوجو مع خلفية الهيدر */
}

/* ====== 3. أزرار التنقل 3D ====== */
.nav-bar {
    display: flex;
    justify-content: center;
    padding: 25px;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-3d {
    padding: 12px 24px;
    background: var(--white);
    border-radius: 12px;
    color: var(--dark-blue);
    font-weight: 800;
    box-shadow: 0 5px 0 var(--btn-shadow);
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.btn-3d:hover {
    transform: translateY(2px);
    box-shadow: 0 3px 0 var(--btn-shadow);
}

.btn-3d:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 var(--btn-shadow);
}

/* ====== 4. الحاويات والأكورديون ====== */
.container {
    max-width: 950px;
    margin: 20px auto;
    padding: 0 15px 60px;
}

.accordion-item {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 15px;
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0,0,0,0.06);
    border: 1px solid #eef2f6;
}

.accordion-header {
    padding: 22px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
    font-weight: 900;
    color: var(--dark-blue);
    font-size: 1.35rem;
}

.accordion-header:hover { background: #f0faff; }

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

.active .accordion-content {
    max-height: 5000px; /* مساحة كافية للدروس */
    padding: 15px;
}

/* ====== 5. قائمة الدروس ====== */
.lessons-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.lesson-card {
    background: var(--white);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

audio { height: 32px; width: 160px; }

.download-btn {
    color: #27ae60;
    font-size: 1.4rem;
    transition: 0.3s;
}

.download-btn:hover { color: var(--gold); }

/* تنسيق زر التحميل المطور والجديد ثلاثي الأبعاد 3D */
.btn-download-3d {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(145deg, #60a5fa, #3b82f6); /* تدرج أزرق فاتح مريح */
    color: white !important;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1rem;
    /* تأثير البروز والظل ثلاثي الأبعاد */
    box-shadow: 0 3px 0 #1d4ed8, 
                0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    cursor: pointer;
}

/* حركة الضغط اللمسية لـ 3D */
.btn-download-3d:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #1d4ed8, 
                0 2px 3px rgba(0, 0, 0, 0.2);
}

/* تعديل مرونة صندوق الدرس ليتناسب مع الزر الجديد */
.lesson-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
}
/* ====== 6. الفوتر ====== */
footer {
    text-align: center;
    padding: 50px 20px;
    color: #666;
    font-weight: bold;
    margin-top: 40px;
}
/* التنسيق الجديد لزر التحميل الأزرق الفاتح ثلاثي الأبعاد 3D */
.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(145deg, #60a5fa, #3b82f6); /* تدرج أزرق فاتح مريح */
    color: white !important;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.1rem;
    /* تأثير البروز والظل ثلاثي الأبعاد */
    box-shadow: 0 3px 0 #1d4ed8, 
                0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

/* الحركة عند الضغط على الزر ليعطي إيحاء الضغط الحقيقي */
.btn-download:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #1d4ed8, 
                0 2px 3px rgba(0, 0, 0, 0.2);
}
