/* الإعدادات الأساسية للحاوية */
.lms-container {
    display: flex;
    max-width: 1200px;
    margin: 40px auto;
    gap: 30px;
    padding: 0 20px;
    font-family: 'Tajawal', 'Cairo', sans-serif; /* خطوط عربية حديثة */
}

/* القائمة الجانبية */
.lms-sidebar {
    width: 300px;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.lms-sidebar-title {
    margin-top: 0;
    font-size: 18px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    color: #2c3e50;
}

/* محتوى الدرس */
.lms-main-content {
    flex: 1;
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.lms-lesson-title {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 30px;
    border-bottom: 2px solid #3498db;
    display: inline-block;
    padding-bottom: 10px;
}

.lms-lesson-body {
    line-height: 1.8;
    color: #444;
    font-size: 16px;
    margin-bottom: 50px;
}

/* أزرار التنقل */
.lms-lesson-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.lms-btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.lms-btn-next {
    background: #3498db;
    color: #fff !important;
}
.lms-btn-next:hover { background: #2980b9; transform: translateX(-5px); }

.lms-btn-prev {
    background: #ecf0f1;
    color: #333 !important;
}
.lms-btn-prev:hover { background: #bdc3c7; transform: translateX(5px); }

.lms-complete-action {
    text-align: center;
    margin-top: 40px;
}

.lms-btn-complete {
    background: #2ecc71;
    color: #fff;
    width: 100%;
    max-width: 300px;
    font-size: 16px;
}
.lms-btn-complete:hover { background: #27ae60; }

/* التوافق مع الهواتف الذكية (Mobile-First) */
@media (max-width: 768px) {
    .lms-container {
        flex-direction: column; /* تحويل العرض ليكون عمودياً */
        margin: 20px auto;
    }
    .lms-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        box-sizing: border-box;
    }
    .lms-main-content {
        padding: 20px;
    }
    .lms-lesson-navigation {
        flex-direction: column;
        gap: 15px;
    }
    .lms-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* تنسيقات القائمة الجانبية (محتويات المادة) */
.lms-course-name {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lms-lesson-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.lms-lesson-list li {
    margin-bottom: 8px;
}

.lms-lesson-list li a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #34495e;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s ease;
    border-right: 3px solid transparent; /* مساحة لخط التمييز */
}

.lms-lesson-list li a:hover {
    background: #e9ecef;
    color: #3498db;
    border-right: 3px solid #bdc3c7;
}

/* تظليل الدرس المفتوح حالياً */
.lms-lesson-list li.current-lesson a {
    background: #3498db;
    color: #ffffff;
    border-right: 3px solid #2980b9;
    font-weight: bold;
}

/* تنسيق الدرس المكتمل في القائمة الجانبية */
.lms-lesson-list li.is-completed a {
    color: #27ae60; /* لون أخضر دلالة على الإنجاز */
}
.lms-check {
    font-size: 13px;
    margin-left: 5px;
    color: #27ae60;
}

/* --- تصميم لوحة تحكم الطالب --- */
.lms-dashboard-container {
    max-width: 1100px;
    margin: 40px auto;
    font-family: 'Tajawal', 'Cairo', sans-serif;
}

.lms-dashboard-header {
    background: #ffffff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.05);
    margin-bottom: 40px;
    text-align: center;
    border-bottom: 5px solid #3498db;
}

.lms-dashboard-header h2 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 32px;
}

.lms-dashboard-header p {
    color: #7f8c8d;
    font-size: 18px;
    margin-bottom: 0;
}

.lms-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.lms-course-card {
    background: #ffffff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}

.lms-course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.lms-course-title {
    margin-top: 0;
    color: #34495e;
    font-size: 22px;
    border-bottom: 2px dashed #ecf0f1;
    padding-bottom: 15px;
}

/* شريط التقدم */
.lms-progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
    margin-top: 25px;
    font-weight: bold;
}

.lms-percentage {
    color: #2ecc71;
    font-size: 16px;
}

.lms-progress-bar-bg {
    background: #ecf0f1;
    border-radius: 10px;
    height: 12px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.lms-progress-bar-fill {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    height: 100%;
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1); /* حركة انسيابية جميلة */
}

/* --- تصميم نماذج تسجيل الدخول وإنشاء الحساب --- */
.lms-auth-container {
    max-width: 400px;
    margin: 50px auto;
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    font-family: 'Tajawal', 'Cairo', sans-serif;
    border-top: 5px solid #3498db;
}

.lms-auth-title {
    text-align: center;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 24px;
}

.lms-auth-container label {
    display: block;
    margin-bottom: 8px;
    color: #34495e;
    font-weight: bold;
    font-size: 14px;
}

.lms-auth-container input[type="text"],
.lms-auth-container input[type="email"],
.lms-auth-container input[type="password"],
.lms-auth-container select.lms-select-field {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    background: #fdfdfd;
}

.lms-auth-container input:focus {
    border-color: #3498db;
    outline: none;
    background: #fff;
    box-shadow: 0 0 5px rgba(52,152,219,0.2);
}

.lms-auth-container input[type="submit"] {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.lms-auth-container input[type="submit"]:hover {
    background: #2980b9;
}

.lms-error {
    background: #fdeaea;
    color: #e74c3c;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    border-right: 4px solid #e74c3c;
}
.lms-auth-message {
    text-align: center;
    padding: 20px;
    background: #eafaf1;
    color: #27ae60;
    border-radius: 8px;
    margin: 20px auto;
    max-width: 400px;
}

/* --- تصميم لوحة تحكم المعلم --- */
.lms-stat-card {
    flex: 1;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: center;
    border-bottom: 4px solid #9b59b6;
}
.lms-stat-card h3 { margin: 0; color: #7f8c8d; font-size: 18px; }
.lms-stat-number { font-size: 40px; font-weight: bold; color: #2c3e50; margin-top: 10px; }

/* الفلترة والبحث */
.lms-teacher-filters { margin-bottom: 20px; }
.lms-search-input {
    width: 100%; max-width: 400px;
    padding: 12px 15px; border: 1px solid #dfe6e9;
    border-radius: 8px; font-size: 15px;
}

/* تصميم الجدول */
.lms-table-responsive { overflow-x: auto; background: #fff; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.lms-teacher-table { width: 100%; border-collapse: collapse; text-align: right; }
.lms-teacher-table th, .lms-teacher-table td { padding: 15px; border-bottom: 1px solid #f0f0f0; }
.lms-teacher-table th { background: #f8f9fa; color: #34495e; font-weight: bold; }
.lms-teacher-table tr:hover { background: #fdfdfd; }

.lms-badge {
    background: #e1f5fe; color: #0288d1;
    padding: 4px 10px; border-radius: 20px;
    font-size: 13px; font-weight: bold;
}

/* --- تصميم صفحة غلاف المادة --- */
.lms-course-landing-header {
    background: linear-gradient(135deg, #3498db, #8e44ad);
    color: #fff;
    padding: 60px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}
.lms-course-landing-title { margin: 0; font-size: 36px; color: #fff; }
.lms-course-landing-desc { font-size: 18px; opacity: 0.9; margin-top: 15px; }

.lms-course-syllabus-box {
    background: #fff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.lms-landing-lesson-list { list-style: none; padding: 0; margin: 0; }
.lms-landing-lesson-list li { margin-bottom: 15px; }
.lms-landing-lesson-list li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #34495e;
    transition: all 0.3s ease;
    border: 1px solid #eee;
}
.lms-landing-lesson-list li a:hover {
    background: #fff;
    transform: translateX(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-color: #3498db;
}
.lesson-num {
    background: #3498db; color: #fff;
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; margin-left: 15px; font-weight: bold;
}
.lesson-title { font-size: 18px; font-weight: bold; }

/* --- تصميم الأرشيف --- */
.lms-filter-bar {
    background: #fff; padding: 20px; border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* --- تصميم القائمة الجانبية المضغوطة (Accordion) --- */
.lms-compact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lms-parent-item {
    margin-bottom: 5px;
}

/* غلاف العنصر الرئيسي (رابط الدرس + سهم الطي) */
.lms-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border: 1px solid #edf2f7;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.lms-item-header:hover {
    background: #eef2f5;
}

/* رابط الدرس الرئيسي */
.lms-item-link {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

/* سهم الطي */
.lms-toggle-icon {
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    color: #7f8c8d;
    transition: transform 0.3s ease;
    border-right: 1px solid #edf2f7; /* فاصل خفيف بين الاسم والسهم */
}

/* حركة السهم عند الفتح */
.lms-parent-item.lms-open .lms-toggle-icon {
    transform: rotate(180deg);
}

/* تلوين القسم المفتوح حالياً */
.lms-parent-item.lms-open > .lms-item-header {
    border-color: #3498db;
    background: #f4f9fd;
}

/* قائمة الدروس الفرعية المتداخلة */
.lms-child-list {
    list-style: none;
    padding: 0 15px 0 0; /* إزاحة لليسار قليلاً لتبدو متداخلة */
    margin: 0;
    border-right: 2px solid #3498db; /* خط جانبي يوضح الانتماء للدرس الأب */
}

.lms-child-list li {
    margin: 2px 0;
}

.lms-child-list li a {
    display: block;
    padding: 6px 12px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.lms-child-list li a:hover {
    background: #f1f8ff;
    color: #2980b9;
}

/* تمييز الدرس الحالي (سواء أب أو ابن) */
.current-lesson > .lms-item-header .lms-item-link,
.lms-child-list li.current-lesson a {
    color: #2980b9;
    font-weight: bold;
}
.lms-child-list li.current-lesson a {
    background: #e4f1fc;
}

/* تصغير علامة الصح لتناسب التصميم المضغوط */
.lms-check {
    font-size: 11px;
    margin-left: 4px;
}

/* --- تصميم قسم النقاشات (Q&A) --- */
.lms-lesson-discussion .comment-respond {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #edf2f7;
}
.lms-lesson-discussion .comment-form-comment label {
    display: none; /* إخفاء كلمة "التعليق" */
}
.lms-lesson-discussion textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #bdc3c7;
    padding: 15px;
    font-family: inherit;
    box-sizing: border-box;
}
.lms-lesson-discussion .form-submit input[type="submit"] {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
}
.lms-lesson-discussion .comment-list {
    list-style: none;
    padding: 0;
}
.lms-lesson-discussion .comment-body {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    margin-bottom: 15px;
    border: 1px solid #eee;
}
.lms-lesson-discussion .bypostauthor > .comment-body {
    border-right: 4px solid #27ae60; /* تمييز إجابة المعلم بلون أخضر */
}

/* --- تصميم لوحة المعلم الاحترافية 🌟 --- */
.lms-pro-dashboard {
    font-family: 'Cairo', sans-serif;
    color: #2c3e50;
    margin-top: 20px;
}

/* الهيدر والإحصائيات */
.lms-pro-header {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
    background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin-bottom: 25px; border-right: 5px solid #8e44ad;
}
.lms-pro-title-area h2 { margin: 0 0 10px 0; font-size: 26px; }
.lms-pro-title-area p { margin: 0; color: #7f8c8d; font-size: 16px; }
.lms-pro-stats-area { display: flex; gap: 20px; }
.lms-pro-stat-box { display: flex; align-items: center; gap: 15px; background: #f8f9fa; padding: 15px 25px; border-radius: 8px; border: 1px solid #edf2f7; }
.stat-icon { font-size: 35px; }
.stat-info h4 { margin: 0; font-size: 14px; color: #95a5a6; font-weight: normal; }
.stat-info strong { font-size: 24px; color: #2c3e50; }

/* الفلاتر */
.lms-pro-filters-wrapper {
    background: #fff; padding: 25px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); margin-bottom: 25px;
}
.lms-pro-filters-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 20px;
}
.filter-group label { display: block; font-size: 13px; font-weight: bold; color: #7f8c8d; margin-bottom: 8px; }
.filter-group input, .filter-group select {
    width: 100%; padding: 12px; border: 1px solid #dfe6e9; border-radius: 6px; box-sizing: border-box;
    font-family: inherit; font-size: 14px; outline: none; transition: border 0.3s;
}
.filter-group input:focus, .filter-group select:focus { border-color: #3498db; }
.lms-pro-actions { display: flex; justify-content: flex-end; gap: 15px; border-top: 1px solid #edf2f7; padding-top: 20px; }

/* الجدول الاحترافي */
.lms-pro-table-wrapper {
    background: #fff; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); overflow-x: auto;
}
.lms-pro-table { width: 100%; border-collapse: collapse; text-align: right; }
.lms-pro-table th { background: #f8f9fa; color: #34495e; padding: 18px 20px; font-size: 14px; border-bottom: 2px solid #edf2f7; white-space: nowrap; }
.lms-pro-table td { padding: 15px 20px; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
.lms-pro-table tbody tr:hover { background: #fdfdfd; }

.st-name { font-weight: bold; font-size: 15px; color: #2c3e50; }
.st-user { font-size: 12px; color: #95a5a6; margin-top: 4px; }
.st-grade { font-weight: bold; color: #8e44ad; font-size: 14px; }
.st-school { font-size: 12px; color: #7f8c8d; margin-top: 4px; }

.lms-status { padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: bold; display: inline-block; }
.lms-status.good { background: #e8f8f5; color: #27ae60; }
.lms-status.bad { background: #fdedec; color: #e74c3c; }
.lms-status.empty { background: #f8f9fa; color: #95a5a6; }
