/* ==========================================================================
   Smart Learning Assistant - Public Styles (V1.0.3 - TTF Font Support)
   ========================================================================== */

@font-face {
    font-family: 'YekanBakh';
    src: url('../../assets/fonts/YekanBakh_Light.ttf') format('truetype');
    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-hero {
    margin: 0 0 28px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(155deg, #134e4a 0%, #0f766e 32%, #0e7490 65%, #155e75 100%);
    box-shadow: 0 12px 42px rgba(15, 118, 110, 0.35), 0 0 0 1px rgba(45, 212, 191, 0.12) inset;
    border: 1px solid rgba(94, 234, 212, 0.35);
}
.sla-course-hero__inner {
    padding: 28px 26px 26px;
    color: #f8fafc;
}
.sla-course-hero__title {
    margin: 0 0 14px;
    font-size: 1.85em;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.sla-course-hero__instructor {
    text-align: center;
    margin: 0 0 16px;
    font-size: 1.05em;
    color: #99f6e4;
}
.sla-course-hero__instructor strong {
    color: #fff;
    font-weight: 600;
}
.sla-course-hero__label {
    opacity: 0.9;
    margin-left: 6px;
}
.sla-course-hero__summary {
    margin: 0;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    font-size: 0.98em;
    line-height: 1.75;
}
.sla-course-hero__summary p {
    margin: 0 0 0.65em;
}
.sla-course-hero__summary p:last-child {
    margin-bottom: 0;
}
.sla-course-hero__summary--muted {
    text-align: center;
    font-style: italic;
    opacity: 0.85;
}

/* --- ثبت‌نام / خرید دوره --- */
.sla-course-enrollment {
    margin: 20px 0 24px;
}

.sla-course-enrollment-card {
    border-radius: 14px;
    overflow: hidden;
    padding: 22px 24px;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* کادر ثبت‌نام رایگان — همان پالت بنفش/طلایی کادر خرید (هماهنگ با دوره پولی) */
.sla-course-enrollment-card--free {
    background: linear-gradient(148deg, #1e1b4b 0%, #4338ca 38%, #6d28d9 68%, #7c3aed 100%);
    border: 1px solid rgba(196, 181, 253, 0.45);
    box-shadow: 0 14px 48px rgba(91, 33, 182, 0.42), 0 0 0 1px rgba(167, 139, 250, 0.15) inset;
    text-align: center;
    color: #ede9fe;
}

.sla-course-enrollment-card__free-panel {
    margin: 0 auto 20px;
    padding: 18px 22px;
    max-width: 520px;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(167, 139, 250, 0.35);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sla-course-enrollment-card--free .sla-course-enrollment-card__lead {
    margin: 0;
    font-size: 1.08em;
    font-weight: 600;
    line-height: 1.75;
    color: #f5f3ff;
}

.sla-course-enrollment-card--enrolled {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #6ee7b7;
    color: #065f46;
    text-align: center;
    font-size: 1.05em;
}

/* کادر خرید — محور گرم بنفش/آجری (مکمل رنگ فیروزه‌ای قهرمان) */
.sla-course-enrollment-card--paid {
    background: linear-gradient(148deg, #1e1b4b 0%, #4338ca 38%, #6d28d9 68%, #7c3aed 100%);
    border: 1px solid rgba(196, 181, 253, 0.45);
    box-shadow: 0 14px 48px rgba(91, 33, 182, 0.42), 0 0 0 1px rgba(167, 139, 250, 0.15) inset;
    text-align: center;
    color: #ede9fe;
}

.sla-course-enrollment-card__kicker {
    margin: 0 0 14px;
    font-size: 1.05em;
    font-weight: 600;
    color: #e9d5ff;
    letter-spacing: 0.01em;
}

.sla-course-enrollment-card__price-panel {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 0 auto 20px;
    padding: 18px 22px;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(167, 139, 250, 0.35);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sla-course-enrollment-card__amount {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.sla-course-enrollment-card__amount--muted {
    font-size: 1.1rem;
    font-weight: 600;
    color: #cbd5e1;
    text-shadow: none;
}

.sla-course-enrollment-card__currency {
    font-size: 1.05em;
    font-weight: 600;
    color: #fcd34d;
}

.sla-course-enrollment-card__form {
    margin: 0;
}

.sla-course-enrollment-card--paid .sla-course-purchase-submit,
.sla-course-enrollment-card--free .sla-course-enrollment-cta {
    min-width: 200px;
    padding: 12px 28px !important;
    font-size: 1.05em !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 10px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sla-course-enrollment-card--paid .sla-course-purchase-submit,
.sla-course-enrollment-card--free .sla-course-free-cta {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 45%, #d97706 100%) !important;
    color: #1c1917 !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.sla-course-enrollment-card--paid .sla-course-purchase-submit:hover,
.sla-course-enrollment-card--paid .sla-course-purchase-submit:focus,
.sla-course-enrollment-card--free .sla-course-free-cta:hover,
.sla-course-enrollment-card--free .sla-course-free-cta:focus {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.45) !important;
    color: #1c1917 !important;
}

.sla-course-enrollment-card__login-hint {
    margin: 16px 0 0;
    font-size: 0.92em;
}

.sla-course-enrollment-card__login-hint a {
    color: #fcd34d;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sla-course-enrollment-card__login-hint a:hover {
    color: #fff;
}

.sla-course-access-hint {
    margin: 0 0 18px;
    padding: 12px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    color: #1e3a8a;
    font-size: 0.92em;
    line-height: 1.6;
}

.sla-toc-title {
    vertical-align: middle;
}
.sla-toc-badge {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 10px;
    font-size: 0.78em;
    font-weight: 700;
    color: #047857;
    background: #d1fae5;
    border-radius: 999px;
    vertical-align: middle;
    white-space: nowrap;
}

.sla-chapter-locked {
    padding: 20px 18px;
    border-radius: 10px;
    background: linear-gradient(to bottom, #fff7ed, #ffedd5);
    border: 1px solid #fdba74;
    color: #7c2d12;
}
.sla-chapter-locked p {
    margin: 0 0 12px;
}
.sla-chapter-locked p:last-child {
    margin-bottom: 0;
}
.sla-course-chapter--preview .chapter-content {
    border-right: 3px solid #10b981;
    padding-right: 12px;
}

/* --- فهرست مطالب --- */
.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: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    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;
    }
}

/* ==========================================================================
   Student Dashboard (Shortcode: [sla_student_dashboard])
   ========================================================================== */

.sla-student-dashboard {
    direction: rtl;
    font-family: 'YekanBakh', Tahoma, Arial, sans-serif;
    max-width: 980px;
    margin: 24px auto;
}

.sla-dashboard-intro {
    margin: 0 0 16px;
    padding: 0 0 14px;
    text-align: right;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.7;
    border-bottom: 1px solid #e2e8f0;
}

.sla-dashboard-hero {
    background: linear-gradient(135deg, #3A8DFF 0%, #6AC8FF 50%, #8B5CF6 100%);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 25px rgba(17, 24, 39, 0.18);
    position: relative;
    overflow: hidden;
}
.sla-dashboard-hero::after {
    content: "";
    position: absolute;
    inset: -40px;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.35), transparent 45%),
                radial-gradient(circle at 70% 70%, rgba(255,255,255,0.18), transparent 55%);
    pointer-events: none;
}
.sla-dashboard-hero__content {
    position: relative;
    z-index: 1;
    color: #fff;
}
.sla-dashboard-hero__title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.7;
}
.sla-dashboard-hero__name {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.22);
}
.sla-dashboard-hero__subtitle {
    margin-top: 10px;
    font-size: 0.95rem;
    opacity: 0.95;
}

.sla-dashboard-section {
    margin-top: 18px;
    background: linear-gradient(to bottom, #FFFFFF, #F8F9FA);
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.sla-dashboard-section__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 14px;
    border-right: 4px solid #6AC8FF;
    padding-right: 10px;
}

.sla-dashboard-empty {
    padding: 14px;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #334155;
}

.sla-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.sla-course-card {
    display: block;
    text-decoration: none !important;
    border-radius: 16px;
    padding: 12px 12px 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
    position: relative;
    overflow: hidden;
}
.sla-course-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(58,141,255,0.10), rgba(139,92,246,0.06));
    opacity: 0;
    transition: opacity 180ms ease;
}
.sla-course-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
    border-color: rgba(58,141,255,0.35);
}
.sla-course-card:hover::before {
    opacity: 1;
}
.sla-course-card__title,
.sla-course-card__excerpt,
.sla-course-card__cta {
    position: relative;
    z-index: 1;
}
.sla-course-card__title {
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.7;
}

.sla-course-card__media {
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: linear-gradient(135deg, rgba(58,141,255,0.12), rgba(139,92,246,0.10));
    aspect-ratio: 16 / 9;
}
.sla-course-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sla-course-card__img-placeholder {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.55), transparent 55%),
                linear-gradient(135deg, rgba(58,141,255,0.22), rgba(139,92,246,0.18));
}
.sla-course-card__excerpt {
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.8;
    min-height: 44px;
}
.sla-course-card__cta {
    margin-top: 12px;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6AC8FF 0%, #3A8DFF 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
}

@media (max-width: 480px) {
    .sla-dashboard-hero,
    .sla-dashboard-section {
        border-radius: 14px;
        padding: 14px;
    }
    .sla-course-card {
        border-radius: 14px;
    }
}