/* =============================================
   المدرسة - CSS موحد للموقع كاملاً
   يشمل: الصفحة الرئيسية + جميع صفحات الدروس
   ============================================= */

:root {
    --primary: #1B5E6B;
    --primary-dark: #0D3F4A;
    --secondary: #F9A826;
    --accent: #E8F0F2;
    --text: #2C3E50;
    --text-light: #5D6D7E;
    --white: #FFFFFF;
    --bg: #F4F7F9;
    --border: #E0E7EC;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
    --radius: 16px;
    --red: #e74c3c;
    --green: #27ae60;
    --purple: #8e44ad;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== زخرفة الخلفية (للصفحة الرئيسية) ========== */
body.home-page::before {
    content: '';
    position: fixed;
    top: -30%;
    left: -10%;
    width: 60%;
    height: 80%;
    background: radial-gradient(circle at 30% 30%, rgba(27,94,107,0.05) 0%, transparent 70%);
    z-index: -1;
}
body.home-page::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -5%;
    width: 70%;
    height: 90%;
    background: radial-gradient(circle at 70% 80%, rgba(249,168,38,0.04) 0%, transparent 70%);
    z-index: -1;
}

/* ========== شريط التنقل (للدروس) ========== */
.top-nav {
    background: var(--white);
    padding: 0.7rem 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.btn-back {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: 0.3s;
    white-space: nowrap;
}

.btn-back:hover {
    background: var(--primary-dark);
}

.breadcrumb {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb i {
    font-size: 0.6rem;
}

/* ========== الهيدر ========== */
header {
    background: linear-gradient(135deg, var(--primary) 0%, #154B57 100%);
    color: white;
    padding: 1.8rem 1.5rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* الهيدر في الصفحة الرئيسية */
header.home-header::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg);
    border-radius: 50% 50% 0 0;
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
}

.logo-icon {
    font-size: 2.8rem;
    color: var(--secondary);
    margin-bottom: 0.3rem;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

header h1 {
    font-family: 'Cairo', sans-serif;
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0.2rem 0;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ========== هيدر الدرس (الصفحات الفرعية) ========== */
.lesson-header {
    background: linear-gradient(135deg, var(--primary) 0%, #154B57 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
}

.lesson-badge {
    display: inline-block;
    background: rgba(249,168,38,0.2);
    color: var(--secondary);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    border: 1px solid rgba(249,168,38,0.3);
}

.lesson-header h1 {
    font-size: 2rem;
}

.lesson-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.8rem;
    font-size: 0.85rem;
}

.lesson-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255,255,255,0.15);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
}

/* ========== الحاوية الرئيسية ========== */
.container {
    max-width: 950px;
    margin: -1rem auto 2rem;
    padding: 0 1.5rem;
    position: relative;
    z-index: 10;
}

/* حاوية الدرس (بدون margin سالب) */
.lesson-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ========== بطاقة البحث (الرئيسية) ========== */
.search-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem 2rem 1.8rem;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.search-card:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.search-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: var(--primary-dark);
}

.search-title i {
    font-size: 1.8rem;
    color: var(--secondary);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.4rem;
    margin-bottom: 2rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
}

.filter-group label i {
    width: 20px;
    color: var(--secondary);
}

select {
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
    background: var(--white);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B5E6B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 0.8rem center;
    background-size: 1.2rem;
    transition: all 0.2s;
    cursor: pointer;
}

select:hover {
    border-color: var(--secondary);
}

select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(249,168,38,0.2);
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== أزرار ========== */
.buttons-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0.3px;
    border: 2px solid transparent;
    text-decoration: none;
}

.btn-search {
    flex: 2;
    background: var(--primary);
    color: white;
}

.btn-search i {
    font-size: 1.2rem;
}

.btn-search:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(27,94,107,0.3);
}

.btn-youtube {
    flex: 1;
    background: var(--red);
    color: white;
    min-width: fit-content;
}

.btn-youtube:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(231,76,60,0.3);
}

.btn-youtube i {
    font-size: 1.3rem;
}

/* ========== رسالة "لا يوجد" ========== */
.not-found-message {
    display: none;
    background: #FFF3CD;
    border: 1px solid #FFEEBA;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: center;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.not-found-message .icon-warning {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.not-found-message p {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #856404;
}

.btn-youtube-inline {
    display: inline-flex;
    background: var(--red);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    gap: 0.5rem;
    transition: 0.3s;
}

.btn-youtube-inline:hover {
    background: #c0392b;
    transform: scale(1.03);
}

/* ========== المميزات (الرئيسية) ========== */
.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    flex: 1 1 250px;
    max-width: 280px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 1rem;
    display: inline-block;
    background: rgba(249,168,38,0.1);
    padding: 0.8rem;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    line-height: 70px;
}

.feature-card h3 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-family: 'Cairo', sans-serif;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ========== بطاقات المحتوى (الدروس) ========== */
.content-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: 'Cairo', sans-serif;
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 3px solid var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--secondary);
}

.content-card p {
    margin-bottom: 0.8rem;
    color: var(--text);
    text-align: justify;
}

.content-card ul, .content-card ol {
    margin-right: 1.2rem;
    margin-bottom: 0.8rem;
}

.content-card li {
    margin-bottom: 0.4rem;
}

.highlight-box {
    background: var(--accent);
    border-right: 4px solid var(--primary);
    padding: 1rem 1.2rem;
    border-radius: 0 12px 12px 0;
    margin: 1rem 0;
}

.highlight-box h3 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* ========== الأكورديون للمفاهيم ========== */
.concepts-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.concept-item {
    background: var(--bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.concept-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    background: var(--white);
}

.concept-number {
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.concept-header h3 {
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.concept-body {
    padding: 0 1.2rem 1.2rem 1.2rem;
}

.concept-body ul {
    margin-right: 1.2rem;
    margin-bottom: 0.6rem;
}

.concept-body li {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.concept-body p {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

/* ========== الإعلانات ========== */
.ad-container {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== جدول التحميل ========== */
.download-section {
    text-align: center;
}

.download-note {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.download-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.download-card {
    background: var(--bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 2px solid var(--border);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.download-card:hover {
    border-color: var(--secondary);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.download-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.audio-icon {
    background: rgba(142,68,173,0.1);
    color: var(--purple);
}

.pdf-icon {
    background: rgba(231,76,60,0.1);
    color: var(--red);
}

.download-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.download-info {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    width: 100%;
    justify-content: center;
}

.audio-btn {
    background: var(--purple);
    color: white;
}

.audio-btn:hover {
    background: #7d3c98;
    transform: translateY(-2px);
}

.pdf-btn {
    background: var(--red);
    color: white;
}

.pdf-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* ========== الفوتر ========== */
footer {
    margin-top: auto;
    background: var(--primary-dark);
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
}

footer i, footer a {
    color: var(--secondary);
}

footer a {
    text-decoration: none;
}

/* ========== تجاوب مع الهواتف ========== */
@media (max-width: 768px) {
    header h1, .lesson-header h1 {
        font-size: 1.5rem;
    }

    .lesson-meta {
        font-size: 0.75rem;
        gap: 0.4rem;
    }

    .lesson-meta span {
        padding: 0.2rem 0.5rem;
    }

    .content-card, .search-card {
        padding: 1.2rem;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .download-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .download-card {
        padding: 1.2rem;
    }

    .btn-back-text {
        display: none;
    }

    .btn-back {
        padding: 0.5rem;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        justify-content: center;
    }

    .buttons-container {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container, .lesson-container {
        padding: 1rem 0.5rem;
    }

    .content-card, .search-card {
        padding: 1rem;
        border-radius: 12px;
    }

    header, .lesson-header {
        padding: 1.5rem 0.8rem;
    }

    header h1, .lesson-header h1 {
        font-size: 1.3rem;
    }

    .concept-header h3 {
        font-size: 1rem;
    }

    .breadcrumb {
        font-size: 0.7rem;
    }

    .download-btn {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    .search-title {
        font-size: 1.2rem;
    }
}