/* ==========================================================================
   Smart Learning Assistant - Public Styles (V1.0.3 - TTF Font Support)
   ========================================================================== */

@font-face {
    font-family: 'YekanBakh'; /* نامی که برای فونت در CSS استفاده می‌کنید */
    src: url('../fonts/Yekan-Bakh-EN-03-Light.ttf') format('truetype'); /* مسیر و فرمت TTF */
    font-weight: 300; /* یا normal اگر این وزن اصلی فونت Light شماست */
    font-style: normal;
    font-display: swap; /* برای بهبود تجربه بارگذاری */
}
/* اگر وزن‌ها یا استایل‌های دیگری از فونت یکان بخ با فرمت TTF دارید (مثلا Bold)،
   می‌توانید برای آن‌ها هم @font-face جداگانه در اینجا تعریف کنید:
@font-face {
    font-family: 'YekanBakh';
    src: url('../fonts/Yekan-Bakh-EN-07-Bold.ttf') format('truetype');
    font-weight: 700; // Bold
    font-style: normal;
    font-display: swap;
}
*/

/* --- Wrapper اصلی دوره --- */
.sla-course-display-wrapper {
    font-family: 'YekanBakh', Tahoma, Arial, sans-serif; /* فونت یکان بخ به عنوان اولویت */
    direction: rtl;
    margin: 30px auto;
    padding: 25px 30px;
    background: linear-gradient(to bottom, #FFFFFF, #F8F9FA);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    max-width: 900px;
    position: relative;
}

/* --- عنوان اصلی دوره --- */
.sla-course-display-wrapper h1.course-title {
    color: #212529;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.2em;
    font-weight: 600; /* اگر وزن سنگین‌تری از یکان بخ دارید، آن را تنظیم کنید، وگرنه از وزن تعریف شده در @font-face استفاده می‌کند */
    border-bottom: 2px solid #6AC8FF;
    padding-bottom: 10px;
}

/* --- فهرست مطالب --- */
.sla-course-toc {
    background-color: #f8f9fa;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 25px;
}

.sla-course-toc h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #343a40;
    font-size: 1.3em;
    font-weight: 600;
}

.sla-course-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    -webkit-columns: 2;
    -moz-columns: 2;
    column-gap: 20px;
}

.sla-course-toc ul li a {
    text-decoration: none;
    color: #0d6efd;
    display: block;
    padding: 10px 5px;
    border-bottom: 1px dashed #ced4da;
    transition: all 0.2s ease-in-out;
    font-size: 0.95em;
}
.sla-course-toc ul li:last-child a {
    border-bottom: none;
}

.sla-course-toc ul li a:hover,
.sla-course-toc ul li a.sla-active-chapter {
    color: #000;
    font-weight: 600;
    background-color: #e9ecef;
    border-radius: 3px;
    padding-right: 15px;
}

/* --- دکمه‌های ناوبری کلی --- */
.sla-course-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sla-top-navigation {
    margin-bottom: 25px;
}
.sla-bottom-navigation {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.sla-course-nav-button {
    padding: 10px 20px;
    text-decoration: none;
    color: white !important;
    background: linear-gradient(135deg, #6AC8FF 0%, #3A8DFF 100%);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: normal; /* استفاده از وزن عادی فونت یکان بخ که در @font-face تعریف شده */
    font-size: 0.95em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-align: center;
    min-width: 120px;
}
.sla-course-navigation .sla-prev-chapter {
    margin-left: 5px;
}
.sla-course-navigation .sla-next-chapter {
    margin-right: 5px;
}

.sla-course-nav-button:hover {
    color: white !important;
    background: linear-gradient(135deg, #3A8DFF 0%, #6AC8FF 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.sla-course-nav-button.disabled,
.sla-course-nav-button:disabled {
    background: #adb5bd;
    color: #e9ecef !important;
    cursor: not-allowed;
    opacity: 0.7;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* --- هر فصل --- */
.sla-course-chapter {
    display: none;
    margin-bottom: 40px;
    padding-bottom: 30px;
}

.sla-course-chapter.sla-chapter-visible {
    display: block !important;
}

.sla-course-chapter h2.chapter-title {
    color: #343a40;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.7em;
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

/* --- محتوای فصل --- */
.sla-course-chapter .chapter-content {
    line-height: 1.8;
    color: #495057;
    font-size: 1.05em;
}
.sla-course-chapter .chapter-content p {
    margin-bottom: 1.2em;
}
.sla-course-chapter .chapter-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 6px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    border: 1px solid #ddd;
    padding: 3px;
    background-color: #fff;
}
.sla-course-chapter .chapter-content ul,
.sla-course-chapter .chapter-content ol {
    margin-bottom: 1em;
    padding-right: 20px;
}
.sla-course-chapter .chapter-content blockquote {
    border-right: 4px solid #6AC8FF;
    padding: 10px 20px;
    margin: 20px 0;
    background-color: #f8f9fa;
    color: #555;
    font-style: italic;
}
.sla-course-chapter .chapter-content code {
    background-color: #e9ecef;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    direction: ltr;
    text-align: left;
    font-size: 0.9em;
}
.sla-course-chapter .chapter-content pre {
    background-color: #282c34;
    color: #abb2bf;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.5;
    font-size: 0.9em;
}
.sla-course-chapter .chapter-content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

/* --- استایل برای نوتیفیکیشن Toast (وسط‌چین) --- */
.sla-toast {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    z-index: 100001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0s linear 0.3s, transform 0.3s ease-in-out;
    font-size: 1em;
    pointer-events: none;
    text-align: center;
    min-width: 250px;
    max-width: 80%;
}

.sla-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* --- رسپانسیو کردن --- */
@media (max-width: 768px) {
    .sla-course-toc ul {
        columns: 1;
        -webkit-columns: 1;
        -moz-columns: 1;
    }
    .sla-course-display-wrapper {
        padding: 20px 15px;
    }
    .sla-course-display-wrapper h1.course-title {
        font-size: 1.8em;
    }
    .sla-course-chapter h2.chapter-title {
        font-size: 1.4em;
    }
    .sla-course-nav-button {
        padding: 10px 15px;
        font-size: 0.9em;
        min-width: 100px;
    }
}
@media (max-width: 480px) {
    .sla-course-nav-button {
        font-size: 0.85em;
        padding: 8px 12px;
        min-width: auto;
    }
}