/* 
 * أنماط واستخلاص الجماليات لدرس "أَزْرَعُ نَبْتَةً"
 * تصميم عصري مبهج ومناسب للمرحلة الابتدائية والمعلمين
 */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Marhey:wght@500;700&family=Tajawal:wght@400;500;700;900&display=swap');

:root {
    --primary: #10b981;
    --primary-dark: #047857;
    --primary-light: #d1fae5;
    --secondary: #f59e0b;
    --secondary-light: #fef3c7;
    --accent-rose: #e11d48;
    --accent-rose-light: #ffe4e6;
    --bg-main: #f0fdf4;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: #cbd5e1;
    --shadow-sm: 0 2px 8px rgba(16, 185, 129, 0.08);
    --shadow-md: 0 10px 25px -5px rgba(16, 185, 129, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 30px -10px rgba(16, 185, 129, 0.22);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --font-heading: 'Marhey', 'Cairo', sans-serif;
    --font-body: 'Tajawal', 'Cairo', sans-serif;
}

/* الوضع الداكن اللطيف */
body.dark-theme {
    --bg-main: #064e3b;
    --bg-card: #0f2922;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --border-color: #1e463a;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    direction: rtl;
    line-height: 1.8;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* حل مشكلة تكبير الحقول التلقائي في iOS Safari والأندرويد */
input, select, textarea {
    font-size: 16px !important;
}

/* شريط الهيدر العلوي والتنقل */
.app-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid rgba(16, 185, 129, 0.2);
    box-shadow: var(--shadow-sm);
}

body.dark-theme .app-header {
    background: rgba(15, 41, 34, 0.9);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.brand-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-decoration: none;
}

body.dark-theme .brand-title {
    color: #34d399;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    animation: floatLeaf 3s infinite ease-in-out;
}

@keyframes floatLeaf {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(8deg); }
}

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

.brand-text {
    display: flex;
    flex-direction: column;
}
.brand-text .main-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    line-height: 1.1;
    font-weight: 900;
    color: var(--primary-dark);
}
.brand-text .sub-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
}

body.dark-theme .brand-text .main-name {
    color: #34d399;
}

/* زر الحساب الشخصي */
.user-account-btn {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
    transition: all 0.25s ease;
}
.user-account-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
}

/* شريط الصفوف الدراسية للمرحلة الابتدائية - تصميم عالي الجودة والانسجام */
.grade-selector-bar {
    background: #ecfdf5;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
    padding: 12px 20px;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.05);
}

body.dark-theme .grade-selector-bar {
    background: #064e3b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.grade-selector-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 0;
}

.grade-pill-btn {
    background: #ffffff;
    color: #047857;
    border: 1.5px solid #a7f3d0;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.06);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-theme .grade-pill-btn {
    background: #0f2922;
    color: #a7f3d0;
    border-color: #1e463a;
}

.grade-pill-btn:hover {
    background: #d1fae5;
    color: #065f46;
    border-color: #34d399;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.18);
}

body.dark-theme .grade-pill-btn:hover {
    background: #1e463a;
    color: #ffffff;
}

.grade-pill-btn.active {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    border-color: #047857 !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35) !important;
    transform: scale(1.05);
}

/* شريط فهرس دروس المنهج */
.lessons-syllabus-bar {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 15px;
    transition: all 0.3s ease;
}

body.dark-theme .lessons-syllabus-bar {
    background: #0f172a;
}

.syllabus-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.syllabus-label {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--primary-dark);
    white-space: nowrap;
}

body.dark-theme .syllabus-label {
    color: #34d399;
}

.syllabus-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.lesson-pill-btn {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

body.dark-theme .lesson-pill-btn {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.lesson-pill-btn.active {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    color: white !important;
    border-color: #b45309 !important;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35) !important;
}

.lesson-pill-btn.disabled {
    opacity: 0.7;
    cursor: pointer;
    background: #f1f5f9;
}

body.dark-theme .lesson-pill-btn.disabled {
    background: #0f172a;
}

/* نافذة الحساب والتفعيل Modal */
.auth-modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
    background: rgba(15, 23, 42, 0.88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999 !important;
    padding: 15px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: fadeIn 0.3s ease;
}

.auth-modal-box {
    background: var(--bg-card);
    width: 100%;
    max-width: 480px;
    margin: auto;
    border-radius: var(--radius-lg);
    padding: 30px;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--primary);
    z-index: 1000000 !important;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.close-auth-btn {
    position: absolute;
    top: 15px; left: 15px;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
}

.auth-header {
    text-align: center;
    margin-bottom: 22px;
}

.auth-logo {
    font-size: 3rem;
    margin-bottom: 6px;
}

.auth-header h2 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.auth-header p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.auth-tabs-nav {
    display: flex;
    gap: 6px;
    background: var(--bg-main);
    padding: 4px;
    border-radius: 30px;
    margin-bottom: 20px;
}

.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 25px;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.auth-form-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
}

.form-group label {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-main);
}

.form-group input, .form-group select {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.btn-auth-submit {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
    transition: all 0.25s ease;
}

.btn-auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.45);
}

.btn-activate-submit {
    background: linear-gradient(135deg, #d97706, #b45309);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
}

.profile-modal-box {
    text-align: center;
    max-width: 460px;
}

.profile-header {
    margin-bottom: 20px;
}

.profile-avatar {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px auto;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
    border: 2px solid #34d399;
}

.btn-logout {
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.3);
    transition: all 0.25s ease;
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(225, 29, 72, 0.45);
}

/* تصميم بطاقات وتفاصيل الاشتراك وتنبيهات التست */
.sub-success-box {
    text-align: center;
    border-color: #f59e0b;
    max-width: 520px;
}

.sub-success-icon {
    font-size: 3.2rem;
    margin-bottom: 8px;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

.sub-success-title {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    font-size: 1.55rem;
    margin-bottom: 4px;
}

.sub-success-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.sub-details-card {
    background: var(--bg-main);
    border-radius: var(--radius-md);
    padding: 18px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: right;
}

.sub-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.sub-detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sub-label {
    font-weight: 800;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.sub-value {
    font-weight: 800;
    color: var(--text-main);
    font-size: 0.95rem;
}

.sub-value.badge-green {
    background: #d1fae5;
    color: #065f46;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 0.88rem;
}

.sub-value.badge-gold {
    background: #fef3c7;
    color: #92400e;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    border: 1px solid #fcd34d;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-message {
    pointer-events: auto;
    background: #0f172a;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.toast-message.success {
    background: #047857;
    border-color: #10b981;
}

.toast-message.error {
    background: #be123c;
    border-color: #f43f5e;
}

@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

.star-badge {
    background: linear-gradient(135deg, #fef3c7, #fde047);
    color: #92400e;
    padding: 6px 16px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.25);
    border: 1px solid #fcd34d;
}

.btn-icon {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    transform: scale(1.08);
}

/* شريط التبويبات الرئيسي (Nav Tabs) */
.main-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 20px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.nav-btn:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

/* الحاوية الرئيسية */
.container {
    max-width: 1150px;
    margin: 30px auto;
    padding: 0 20px;
    flex: 1;
}

/* التبويبات والأقسام */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.tab-content.active {
    display: block;
}

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

/* كروت العناوين الملونة */
.section-banner {
    background: linear-gradient(135deg, #10b981, #047857);
    color: white;
    padding: 25px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.section-banner::after {
    content: '🌸';
    position: absolute;
    left: -15px;
    bottom: -15px;
    font-size: 6rem;
    opacity: 0.15;
    pointer-events: none;
}

.banner-text h1 {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    margin-bottom: 5px;
}

.banner-text p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 1. قسم النص التفاعلي وشريط التنقل بين الفقرات (Pagination Slider) */
.para-tabs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.para-stepper-box {
    display: flex;
    gap: 10px;
}

.para-step-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.para-step-btn:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.para-step-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.para-page-indicator {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 1.05rem;
    background: var(--primary-light);
    padding: 6px 16px;
    border-radius: 20px;
}

body.dark-theme .para-page-indicator {
    background: #064e3b;
    color: #34d399;
}

.story-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.story-card.active-para-page {
    animation: slideInPara 0.4s ease-out;
}

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

/* شريط أزرار التالي والسابق أسفل كل فقرة */
.para-footer-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px stroke var(--border-color);
    flex-wrap: wrap;
    gap: 15px;
}

.btn-para-nav {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
    transition: all 0.25s ease;
}

.btn-para-nav:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.btn-para-nav:disabled {
    background: #cbd5e1 !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.para-badge-status {
    font-weight: 800;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.story-card:hover {
    box-shadow: var(--shadow-md);
}

.story-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px stroke var(--primary-light);
    padding-bottom: 10px;
}

.story-title {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark-theme .story-title {
    color: #34d399;
}

.story-text {
    font-size: 1.35rem;
    line-height: 2.3;
    color: var(--text-main);
    background: rgba(16, 185, 129, 0.03);
    padding: 22px;
    border-radius: var(--radius-sm);
    border-right: 5px solid var(--primary);
    margin-bottom: 20px;
    position: relative;
}

/* 🌟 شريط التبديل للتظليل التفاعلي (المعنى، المضاد، الجمع) */
.vocab-filter-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--bg-main);
    padding: 10px 15px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.vocab-filter-title {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-left: 5px;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    transform: translateY(-1px);
}

.filter-btn.active[data-filter="all"] {
    background: #0284c7;
    color: white;
    border-color: #0284c7;
}

.filter-btn.active[data-filter="meaning"] {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.filter-btn.active[data-filter="opposite"] {
    background: #f43f5e;
    color: white;
    border-color: #f43f5e;
}

.filter-btn.active[data-filter="plural"] {
    background: #d97706;
    color: white;
    border-color: #d97706;
}

.filter-btn.active[data-filter="none"] {
    background: #64748b;
    color: white;
    border-color: #64748b;
}

.story-text {
    font-size: 1.35rem;
    line-height: 2.3;
    color: var(--text-main);
    background: rgba(16, 185, 129, 0.03);
    padding: 22px;
    border-radius: var(--radius-sm);
    border-right: 5px solid var(--primary);
    margin-bottom: 20px;
    position: relative;
}

/* 🌟 تلميحات المعنى والمضاد والجمع التفاعلية فوق الكلمات */
mark.word-tooltip {
    background: transparent;
    color: inherit;
    font-weight: inherit;
    padding: 0 2px;
    border-radius: 4px;
    cursor: default;
    position: relative;
    display: inline-block;
    transition: all 0.25s ease;
}

/* عند تفعيل تظليل المعنى 🟢 */
.filter-active-meaning mark.word-tooltip[data-type*="meaning"],
.filter-active-all mark.word-tooltip[data-type*="meaning"] {
    background: rgba(16, 185, 129, 0.2);
    color: #047857;
    font-weight: 800;
    border-bottom: 2px stroke #10b981;
    cursor: pointer;
}

/* عند تفعيل تظليل المضاد 🔴 */
.filter-active-opposite mark.word-tooltip[data-type*="opposite"],
.filter-active-all mark.word-tooltip[data-type*="opposite"] {
    background: rgba(244, 63, 94, 0.2);
    color: #be123c;
    font-weight: 800;
    border-bottom: 2px stroke #f43f5e;
    cursor: pointer;
}

/* عند تفعيل تظليل المفرد والجمع 🟡 */
.filter-active-plural mark.word-tooltip[data-type*="plural"],
.filter-active-plural mark.word-tooltip[data-type*="singular"],
.filter-active-all mark.word-tooltip[data-type*="plural"],
.filter-active-all mark.word-tooltip[data-type*="singular"] {
    background: rgba(245, 158, 11, 0.2);
    color: #b45309;
    font-weight: 800;
    border-bottom: 2px stroke #f59e0b;
    cursor: pointer;
}

body.dark-theme .filter-active-meaning mark.word-tooltip[data-type*="meaning"] { color: #6ee7b7; }
body.dark-theme .filter-active-opposite mark.word-tooltip[data-type*="opposite"] { color: #fda4af; }
body.dark-theme .filter-active-plural mark.word-tooltip[data-type*="plural"] { color: #fde047; }

/* تأثير التحليق (Hover) والضغط للمظلل فقط */
mark.word-tooltip.active-highlight:hover,
mark.word-tooltip.active-tooltip {
    background: #0f172a !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* فقاعة التلميح المعروضة فوق الكلمة */
mark.word-tooltip::after {
    content: attr(data-tooltip-text);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: #0f172a;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    z-index: 50;
}

mark.word-tooltip::before {
    content: '';
    position: absolute;
    bottom: 105%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #0f172a transparent transparent transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 50;
}

mark.word-tooltip.active-highlight:hover::after, mark.word-tooltip.active-highlight:hover::before,
mark.word-tooltip.active-tooltip::after, mark.word-tooltip.active-tooltip::before {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* جدول المفردات الخاص بكل فقرة */
.para-vocab-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin: 15px 0;
    box-shadow: var(--shadow-sm);
}

.para-vocab-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 2. قسم ورشة الإبداع ومهارات التفكير العليا */
.creative-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}

.creative-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.creative-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #7c3aed;
}

.creative-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
    color: #5b21b6;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
    align-self: flex-start;
}

body.dark-theme .creative-badge {
    background: #4c1d95;
    color: #ddd6fe;
}

.creative-q-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.8;
    margin-bottom: 18px;
}

.creative-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.btn-reveal-ans {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-reveal-ans:hover {
    background: #6d28d9;
}

.btn-creative-audio {
    background: var(--bg-main);
    color: #7c3aed;
    border: 1px solid #7c3aed;
    padding: 9px 16px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-creative-audio:hover {
    background: #f5f3ff;
}

.creative-ans-box {
    background: #f5f3ff;
    border-right: 4px solid #7c3aed;
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-top: 15px;
    color: #4c1d95;
    font-size: 1.05rem;
    line-height: 1.8;
    animation: fadeIn 0.3s ease;
}

body.dark-theme .creative-ans-box {
    background: #2e1065;
    color: #ddd6fe;
    border-right-color: #a78bfa;
}

.para-vocab-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 1.05rem;
}

.para-vocab-table th, .para-vocab-table td {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    text-align: right;
}

.para-vocab-table th {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 800;
}

body.dark-theme .para-vocab-table th {
    background: #064e3b;
    color: #34d399;
}

/* صندوق الشرح الأكاديمي والتربوي للفقرة */
.para-explanation-box {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-right: 5px solid #0284c7;
    border-radius: var(--radius-sm);
    padding: 20px;
    margin: 15px 0;
    color: #0c4a6e;
    box-shadow: var(--shadow-sm);
}

body.dark-theme .para-explanation-box {
    background: linear-gradient(135deg, #072b42, #031b2e);
    color: #bae6fd;
    border-right-color: #38bdf8;
}

.para-explanation-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0369a1;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark-theme .para-explanation-title {
    color: #38bdf8;
}

/* لافته قفل الشهادة في حال عدم جمع 10 نجوم */
.cert-locked-banner {
    background: linear-gradient(135deg, #fef3c7, #fde047);
    border: 2px solid #f59e0b;
    border-radius: var(--radius-md);
    padding: 25px;
    text-align: center;
    color: #78350f;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.story-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.btn-story-audio {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid var(--primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-story-audio:hover {
    background: var(--primary);
    color: white;
}

.inline-questions {
    margin-top: 22px;
    background: #fefce8;
    border-radius: var(--radius-md);
    padding: 22px 25px;
    border-right: 6px solid #f59e0b;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
}

body.dark-theme .inline-questions {
    background: #271c06;
    border-right-color: #fbbf24;
}

.inline-questions h4 {
    color: #78350f;
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark-theme .inline-questions h4 {
    color: #fef08a;
}

.inline-qa-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inline-q-row {
    background: #ffffff;
    border: 1px solid #fef08a;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.inline-q-row:hover {
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
    border-color: #f59e0b;
}

body.dark-theme .inline-q-row {
    background: #1c1404;
    border-color: #451a03;
}

.inline-q-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.inline-q-icon {
    font-size: 1.2rem;
    color: #dc2626;
}

.inline-q-type-badge {
    background: #f59e0b;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 12px;
}

.inline-q-text {
    font-size: 1.15rem;
    font-weight: 800;
    color: #78350f;
    line-height: 1.7;
}

body.dark-theme .inline-q-text {
    color: #fef08a;
}

.inline-q-btns {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.btn-toggle-inline-ans {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #ffffff;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.2);
    transition: all 0.2s ease;
}

.btn-toggle-inline-ans:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}

.btn-read-inline-qa {
    background: #fffbebe6;
    color: #d97706;
    border: 1px solid #d97706;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-read-inline-qa:hover {
    background: #fef3c7;
}

.inline-ans-box {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-right: 4px solid #10b981;
    padding: 12px 18px;
    border-radius: 8px;
    margin-top: 10px;
    color: #065f46;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.8;
    animation: fadeIn 0.3s ease;
}

body.dark-theme .inline-ans-box {
    background: #064e3b;
    color: #a7f3d0;
    border-right-color: #34d399;
}

/* تصميم سلايدر الأسئلة التفاعلي (Question Carousel) */
.inline-q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.inline-q-counter-badge {
    background: #d97706;
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 4px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

.inline-q-nav-dots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    justify-content: center;
}

.q-dot-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #f59e0b;
    background: white;
    color: #78350f;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.q-dot-btn:hover {
    background: #fef3c7;
    transform: scale(1.08);
}

.q-dot-btn.active {
    background: #d97706;
    color: white;
    border-color: #b45309;
    box-shadow: 0 3px 8px rgba(217, 119, 6, 0.35);
    transform: scale(1.12);
}

body.dark-theme .q-dot-btn {
    background: #1c1404;
    color: #fef08a;
    border-color: #78350f;
}

body.dark-theme .q-dot-btn.active {
    background: #f59e0b;
    color: #1c1404;
}

.inline-q-card {
    background: #ffffff;
    border: 2px solid #fde047;
    border-radius: var(--radius-md);
    padding: 20px 22px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

body.dark-theme .inline-q-card {
    background: #1c1404;
    border-color: #78350f;
}

.inline-q-footer-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    gap: 10px;
}

.btn-q-nav {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-q-nav:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}

.btn-q-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

.q-progress-text {
    font-weight: 800;
    color: #78350f;
    font-size: 1rem;
}

body.dark-theme .q-progress-text {
    color: #fef08a;
}

/* شريط تبديل وتدرج الاختبارات التفاعلية */
.quiz-subnav-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.quiz-type-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: 12px 22px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-type-btn:hover {
    border-color: #d97706;
    color: #d97706;
}

.quiz-type-btn.active {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
    border-color: #b45309;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.quiz-wizard-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 28px;
    border: 2px solid #fde047;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

body.dark-theme .quiz-wizard-card {
    border-color: #78350f;
    background: #1c1404;
}

.q-dot-btn.answered-correct {
    background: #10b981 !important;
    color: white !important;
    border-color: #059669 !important;
}

.q-dot-btn.answered-wrong {
    background: #f43f5e !important;
    color: white !important;
    border-color: #e11d48 !important;
}

.quiz-gated-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.quiz-lock-hint {
    color: #dc2626;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: pulse 1.5s infinite;
}

.btn-quiz-next {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
    transition: all 0.25s ease;
}

.btn-quiz-next:disabled {
    background: #cbd5e1 !important;
    color: #64748b !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.btn-quiz-next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.45);
}

/* 2. قسم قاموس المفردات */
.vocab-subnav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.vocab-tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    border-radius: 30px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.vocab-tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.search-box {
    width: 100%;
    max-width: 450px;
    margin-bottom: 20px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 1.05rem;
    outline: none;
    box-shadow: var(--shadow-sm);
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.vocab-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    text-align: center;
    cursor: pointer;
    perspective: 1000px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}

.vocab-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.vocab-word {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

body.dark-theme .vocab-word {
    color: #34d399;
}

.vocab-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.badge-meaning { background: #d1fae5; color: #065f46; }
.badge-opposite { background: #ffe4e6; color: #9f1239; }
.badge-plural { background: #fef3c7; color: #92400e; }
.badge-singular { background: #e0f2fe; color: #075985; }

.vocab-detail {
    font-size: 1.15rem;
    color: var(--text-main);
    font-weight: 600;
}

/* 3. لعبة محاكاة تجربة مريم للزراعة (Plant Simulator) */
.simulator-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.sim-steps-bar {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
    position: relative;
    margin-bottom: 10px;
}

.sim-steps-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-color);
    z-index: 1;
    transform: translateY(-50%);
}

.sim-step-node {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.3s ease;
}

.sim-step-node.active {
    background: var(--primary);
    border-color: var(--primary-dark);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.sim-step-node.done {
    background: #059669;
    border-color: #047857;
    color: white;
}

/* حوض المحاكاة التفاعلي (Glass Jar Graphics) */
.jar-view-box {
    width: 280px;
    height: 360px;
    border: 5px solid rgba(16, 185, 129, 0.5);
    border-top: none;
    border-radius: 0 0 40px 40px;
    background: linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(224,242,254,0.4) 100%);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.15), var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

body.dark-theme .jar-view-box {
    background: linear-gradient(180deg, rgba(15,41,34,0.7) 0%, rgba(6,78,59,0.5) 100%);
}

.jar-cotton {
    width: 85%;
    height: 60px;
    background: #f8fafc;
    border-radius: 20px;
    border: 2px dashed #cbd5e1;
    position: absolute;
    bottom: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    z-index: 2;
}

.seed-item {
    width: 14px;
    height: 14px;
    background: #78350f;
    border-radius: 50%;
    position: absolute;
    top: -8px;
    box-shadow: inset -2px -2px 0 rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.seed-item:nth-child(1) { left: 25%; }
.seed-item:nth-child(2) { left: 50%; transform: translateX(-50%); }
.seed-item:nth-child(3) { right: 25%; }

/* البذور التالفة */
.seed-item.withered {
    background: #451a03;
    opacity: 0.5;
    transform: scale(0.8);
}

/* الجذور أسفل القطن */
.root-system {
    position: absolute;
    bottom: 5px;
    width: 70%;
    height: 35px;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.root-system.visible {
    opacity: 1;
}

.root-line {
    stroke: #854d0e;
    stroke-width: 3;
    stroke-linecap: round;
}

/* النبتة الخضراء فوق القطن */
.sprout-plant {
    position: absolute;
    bottom: 95px;
    width: 100px;
    height: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 3;
}

.stem {
    width: 6px;
    height: 100%;
    background: #15803d;
    border-radius: 3px;
}

.leaf-left, .leaf-right {
    width: 25px;
    height: 14px;
    background: #22c55e;
    border-radius: 15px 0 15px 0;
    position: absolute;
    top: 30%;
}

.leaf-left { right: 50%; transform: rotate(-20deg); }
.leaf-right { left: 50%; transform: rotate(110deg); }

/* الوردة الحمراء الفواحة */
.red-rose {
    width: 45px;
    height: 45px;
    background: radial-gradient(circle, #f43f5e 0%, #be123c 100%);
    border-radius: 50%;
    position: absolute;
    top: -20px;
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.6);
    display: none;
    animation: bloom 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bloom {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.rose-petal {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #e11d48;
    border-radius: 50%;
}

/* أزرار التحكم بالمحاكاة */
.sim-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: all 0.25s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    color: var(--primary-dark);
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-secondary:hover {
    background: var(--primary-light);
}

/* 4. قسم الاختبارات (Quizzes) */
.quiz-box {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
}

.quiz-question-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

@media (min-width: 640px) {
    .quiz-options.grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.option-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: right;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.option-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-btn.correct {
    background: #d1fae5 !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
}

.option-btn.wrong {
    background: #ffe4e6 !important;
    border-color: #f43f5e !important;
    color: #9f1239 !important;
}

.explanation-box {
    background: #f0f9ff;
    border-right: 4px solid #0284c7;
    padding: 15px;
    border-radius: var(--radius-sm);
    color: #0369a1;
    font-weight: 600;
    margin-top: 15px;
    display: none;
}

/* 5. قسم سؤال وجواب (Q&A Accordion) */
.qa-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qa-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.qa-header-btn {
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    text-align: right;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark-theme .qa-header-btn {
    color: #34d399;
}

.qa-content {
    padding: 0 20px 16px 20px;
    font-size: 1.1rem;
    color: var(--text-main);
    line-height: 1.9;
    display: none;
    border-top: 1px dashed var(--border-color);
    background: rgba(16, 185, 129, 0.02);
}

.qa-card.open .qa-content {
    display: block;
}

/* 6. شهادة المتفوق الرقمية (Certificate Modal) */
.certificate-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.certificate-box {
    background: #fff;
    width: 100%;
    max-width: 650px;
    border: 10px solid #10b981;
    border-radius: 20px;
    padding: 35px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-lg);
    background-image: radial-gradient(#d1fae5 1px, transparent 1px);
    background-size: 16px 16px;
    color: #0f172a;
}

.cert-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: #047857;
    margin-bottom: 10px;
}

.cert-name {
    font-size: 1.8rem;
    font-weight: 800;
    color: #e11d48;
    border-bottom: 2px dashed #e11d48;
    display: inline-block;
    padding: 0 20px;
    margin: 15px 0;
}

/* زر إغلاق وشهادة */
.close-cert-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: 800;
    cursor: pointer;
}

/* تحسينات وضع الطباعة لصفحة أوراق العمل للمعلم */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    .app-header, .main-nav, .search-box, .sim-controls, .header-actions, .btn-icon, .btn-story-audio {
        display: none !important;
    }
    .container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .tab-content {
        display: block !important;
        page-break-after: always;
    }
    .story-card, .vocab-card, .quiz-box, .qa-card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
}

/* ==========================================
 * إخفاء أشرطة التمرير القبيحة تلقائياً على كل الشاشات والهواتف (Scrollbar Hiding)
 * ========================================== */
.grade-selector-container::-webkit-scrollbar,
.syllabus-pills::-webkit-scrollbar,
.nav-container::-webkit-scrollbar,
.dots-nav-bar::-webkit-scrollbar,
.sub-details-card::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

.grade-selector-container,
.syllabus-pills,
.nav-container,
.dots-nav-bar,
.sub-details-card {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

/* ==========================================
 * التنسيق البسيط والراقي الشامل للهواتف الذكية (Simple & Minimal Mobile)
 * ========================================== */

@media (max-width: 768px) {
    /* 1. الهيدر البسيط والأنيق على صف واحد */
    .header-container {
        padding: 6px 12px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }

    .brand-title {
        gap: 6px;
    }

    .brand-icon {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }

    .brand-text .main-name {
        font-size: 1.1rem;
    }

    .brand-text .sub-name {
        display: none !important;
    }

    .header-actions {
        width: auto;
        gap: 5px;
    }

    .user-account-btn {
        padding: 5px 10px;
        font-size: 0.78rem;
        border-radius: 20px;
        max-width: 140px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .star-badge {
        padding: 4px 8px;
        font-size: 0.78rem;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    /* 2. شريط الصفوف الرفيع وبدون أسهم أو سكرول بار */
    .grade-selector-bar {
        padding: 5px 8px;
        background: transparent;
        border-bottom: 1px solid rgba(16, 185, 129, 0.1);
    }

    .grade-selector-container {
        gap: 5px;
        padding: 0;
    }

    .grade-pill-btn {
        padding: 5px 12px;
        font-size: 0.88rem;
        border-radius: 16px;
    }

    /* 3. شريط دروس المنهج البسيط */
    .lessons-syllabus-bar {
        padding: 4px 8px;
        background: transparent;
        border-bottom: 1px solid rgba(16, 185, 129, 0.1);
    }

    .syllabus-container {
        gap: 6px;
    }

    .syllabus-label {
        display: none !important; /* إخفاء النص الطويل الزائد ليكون الهيدر سيمبل ومستغلاً للمساحة */
    }

    .syllabus-pills {
        gap: 5px;
        width: 100%;
    }

    .lesson-pill-btn {
        padding: 5px 12px;
        font-size: 0.82rem;
        border-radius: 16px;
        width: 100%;
        justify-content: center;
    }

    /* 4. شريط التبويبات الرئيسي المريح */
    .main-nav {
        padding: 4px 8px;
        margin: 2px 0;
    }

    .nav-container {
        gap: 5px;
    }

    .nav-btn {
        padding: 6px 12px;
        font-size: 0.82rem;
        border-radius: 16px;
    }

    /* 4. كروت المحتوى ونصوص الدروس */
    main.container {
        padding: 12px;
    }

    .section-banner {
        padding: 16px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .banner-text h1 {
        font-size: 1.4rem;
    }

    .banner-text p {
        font-size: 0.92rem;
    }

    .story-card {
        padding: 18px 14px;
    }

    .story-text {
        font-size: 1.15rem;
        line-height: 2.1;
    }

    .question-slider-card {
        padding: 14px;
        margin-top: 15px;
    }

    .question-title {
        font-size: 1.05rem;
    }

    .dots-nav-bar {
        gap: 4px;
    }

    .dot-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .slider-nav-bar {
        flex-direction: row;
        gap: 8px;
    }

    .btn-nav-slider {
        flex: 1;
        padding: 8px 12px;
        font-size: 0.88rem;
        justify-content: center;
    }

    /* 5. النوافذ المنبثقة (Modals) */
    .auth-modal-box, .sub-success-box, .profile-modal-box {
        width: 95% !important;
        max-width: 100% !important;
        padding: 22px 16px !important;
        border-radius: 18px !important;
    }

    .auth-header h2, .sub-success-title, .profile-header h2 {
        font-size: 1.25rem !important;
    }

    .auth-tabs-nav {
        gap: 4px;
        padding: 3px;
    }

    .auth-tab-btn {
        padding: 7px 8px;
        font-size: 0.82rem;
    }

    .sub-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .sub-label {
        font-size: 0.85rem;
    }

    .sub-value {
        font-size: 0.88rem;
    }

    /* 6. المحاكاة والتسميع والألعاب */
    .jar-view-box {
        width: 220px;
        height: 290px;
    }

    .sim-step-node {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        flex-wrap: wrap;
    }

    .brand-text .sub-name {
        display: none; /* إخفاء النص الفرعي الصغير للشاشات بالغة الصغر */
    }

    .user-account-btn {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    .star-badge {
        font-size: 0.8rem;
        padding: 3px 8px;
    }

    .question-title {
        font-size: 1rem;
    }
}

/* ==========================================
 * زر الدعم الفني العائم عبر الواتساب (WhatsApp Float Button)
 * ========================================== */
.whatsapp-float-btn {
    position: fixed;
    bottom: 25px;
    left: 25px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #ffffff !important;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
    z-index: 9999;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: waPulse 2.5s infinite;
}

.whatsapp-float-btn:hover {
    transform: scale(1.12) rotate(6deg);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.65);
}

.wa-tooltip {
    position: absolute;
    right: 70px;
    background: #0f172a;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.whatsapp-float-btn:hover .wa-tooltip {
    opacity: 1;
    transform: translateX(0);
}

@keyframes waPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
    }
    70% {
        box-shadow: 0 0 0 16px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@media (max-width: 768px) {
    .whatsapp-float-btn {
        bottom: 18px;
        left: 18px;
        width: 52px;
        height: 52px;
        font-size: 1.85rem;
    }
}

/* ==========================================
 * شاشة التحميل الكاملة (Full Screen Auth Loading Overlay)
 * ========================================== */
.auth-loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.96), rgba(15, 23, 42, 0.98));
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999999 !important;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.loading-card-box {
    background: rgba(255, 255, 255, 0.96);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    text-align: center;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 3px solid #10b981;
    position: relative;
    overflow: hidden;
}

body.dark-theme .loading-card-box {
    background: #0f2922;
    border-color: #34d399;
}

.loading-logo-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-gem-icon {
    font-size: 3.2rem;
    animation: gemPulse 1.8s infinite ease-in-out;
    z-index: 2;
}

.loading-spinner-ring {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 4px solid rgba(16, 185, 129, 0.2);
    border-top: 4px solid #10b981;
    border-radius: 50%;
    animation: spinRing 1s linear infinite;
}

.loading-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

body.dark-theme .loading-title {
    color: #34d399;
}

.loading-subtitle {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 20px;
}

.loading-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

.loading-progress-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #10b981, #f59e0b, #10b981);
    background-size: 200% 100%;
    animation: loadingBarMove 1.5s infinite linear;
}

@keyframes spinRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes gemPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18); }
}

@keyframes loadingBarMove {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
