/* استایل‌های اصلی LMS */
.lms-course-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    direction: rtl;
}

.lms-course-main {
    display: flex;
    gap: 30px;
    min-height: 600px;
}

/* بخش ویدیو (سمت چپ) */
.lms-video-section {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.lms-video-container {
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
    max-width: 1280px;
    margin: 0 auto;
}

/* استایل‌های Presto Player */
.lms-video-container .wp-block-presto-player-reusable-edit {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 16/9;
}

.lms-video-container presto-player {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    position: relative !important;
    z-index: 10 !important;
    background: #000 !important;
    aspect-ratio: 16/9;
}

.lms-video-container figure {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 10 !important;
    aspect-ratio: 16/9;
}

.lms-video-container video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    aspect-ratio: 16/9;
}

/* بهبود responsive design */
.lms-video-container iframe {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 16/9;
    border: none;
}

/* واترمارک */
.lms-zh-watermark {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
    pointer-events: none;
    backdrop-filter: blur(4px);
}



/* عنوان سرفصل بالای ویدیو */
.lms-chapter-title-header {
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.lms-chapter-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    text-align: center;
}

/* اطلاعات ویدیو */
.lms-video-info {
    padding: 20px;
    background: #fff;
}

.lms-video-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.lms-video-description {
    font-size: 16px;
    color: #64748b;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.lms-video-actions {
    display: flex;
    gap: 10px;
}

/* دکمه نشانه‌گذاری به عنوان مشاهده شده */
.lms-mark-as-viewed-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.lms-mark-as-viewed-btn {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lms-mark-as-viewed-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.lms-mark-as-viewed-btn:disabled {
    background: #059669;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* دکمه سوال از پشتیبانی */
.lms-support-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.lms-support-btn {
    width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    color: #2563eb;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lms-support-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.lms-support-icon {
    font-size: 16px;
}

.lms-support-text {
    font-size: 14px;
}

/* ناوبری بین سرفصل‌ها (پایین ویدیو) */
.lms-chapter-navigation {
    margin: 20px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.lms-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.lms-nav-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.lms-nav-btn:disabled {
    background: #f8fafc;
    color: #cbd5e1;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.lms-nav-arrow {
    font-size: 14px;
    font-weight: bold;
}

.lms-nav-text {
    font-size: 13px;
}

.lms-nav-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.lms-nav-current {
    color: #2563eb;
    font-weight: 600;
}

.lms-nav-separator {
    color: #94a3b8;
}

.lms-nav-total {
    color: #64748b;
    font-weight: 500;
}







/* دکمه‌ها */
.lms-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lms-btn-primary {
    background: #2563eb;
    color: #fff;
}

.lms-btn-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.lms-btn:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

/* بخش سرفصل‌ها (سمت راست) */
.lms-chapters-section {
    width: 400px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.lms-chapters-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lms-chapters-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.lms-chapters-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lms-chapters-toggle span {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.lms-toggle-switch {
    width: 40px;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.lms-toggle-switch.active {
    background: #2563eb;
}

.lms-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.lms-toggle-switch.active::after {
    transform: translateX(20px);
}

/* لیست سرفصل‌ها */
.lms-chapters-list {
    max-height: 500px;
    overflow-y: auto;
}

.lms-chapter-item {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.lms-chapter-item:last-child {
    border-bottom: none;
}

.lms-chapter-item.active {
    background: #f8fafc;
    border-left: 3px solid #2563eb;
}

.lms-chapter-item.completed {
    background: #f0fdf4;
}

.lms-chapter-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s ease;
}

.lms-chapter-header:hover {
    background: #f1f5f9;
}

.lms-chapter-number {
    width: 28px;
    height: 28px;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.lms-chapter-item.active .lms-chapter-number {
    background: #2563eb;
    color: white;
}

.lms-chapter-item.completed .lms-chapter-number {
    background: #059669;
    color: white;
}

.lms-chapter-content {
    flex: 1;
    min-width: 0;
}

.lms-chapter-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 4px;
}

.lms-chapter-item.active .lms-chapter-title {
    color: #2563eb;
}

.lms-chapter-description {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lms-chapter-status {
    font-size: 14px;
    color: #64748b;
    flex-shrink: 0;
}

.lms-chapter-item.completed .lms-chapter-status {
    color: #059669;
}

.lms-chapter-item.active .lms-chapter-status {
    color: #2563eb;
}

/* Placeholder برای ویدیو */
.lms-video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: #f8fafc;
    border-radius: 8px;
    min-height: 400px;
}

.lms-video-placeholder h3 {
    font-size: 18px;
    color: #64748b;
    margin: 0 0 10px 0;
}

.lms-video-placeholder p {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

/* Loading Animation */
.lms-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #64748b;
}

.lms-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* پیام‌های دسترسی */
.lms-course-empty {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 12px;
    margin: 20px 0;
}

.lms-course-empty h3 {
    font-size: 20px;
    color: #1e293b;
    margin: 0 0 10px 0;
}

.lms-course-empty p {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

/* منوی همبرگری برای موبایل */
.lms-mobile-menu-toggle {
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
    width: 100%;
    border: none;
    margin-bottom: 20px;
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.lms-mobile-menu-toggle:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.lms-mobile-menu-toggle:active {
    transform: scale(0.95);
}

.lms-mobile-menu-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 16px;
}

.lms-mobile-menu-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.lms-mobile-menu-text {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.lms-mobile-menu-toggle.active .lms-mobile-menu-icon span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.lms-mobile-menu-toggle.active .lms-mobile-menu-icon span:nth-child(2) {
    opacity: 0;
}

.lms-mobile-menu-toggle.active .lms-mobile-menu-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.lms-mobile-menu-toggle.active .lms-mobile-menu-text {
    opacity: 0;
}

.lms-mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #1e293b;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.lms-mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.lms-mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.lms-mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* مودال سرفصل‌ها برای موبایل */
.lms-mobile-chapters-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.lms-mobile-chapters-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.lms-mobile-chapters-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.lms-mobile-chapters-modal.active .lms-mobile-chapters-sidebar {
    transform: translateX(0);
}

.lms-mobile-chapters-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.lms-mobile-chapters-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.lms-mobile-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.lms-mobile-close-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.lms-mobile-chapters-list {
    padding: 0;
}

.lms-mobile-chapter-item {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.lms-mobile-chapter-item:last-child {
    border-bottom: none;
}

.lms-mobile-chapter-item.active {
    background: #f8fafc;
    border-left: 3px solid #2563eb;
}

.lms-mobile-chapter-item.completed {
    background: #f0fdf4;
}

.lms-mobile-chapter-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s ease;
}

.lms-mobile-chapter-header:hover {
    background: #f1f5f9;
}

.lms-mobile-chapter-number {
    width: 28px;
    height: 28px;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.lms-mobile-chapter-item.active .lms-mobile-chapter-number {
    background: #2563eb;
    color: white;
}

.lms-mobile-chapter-item.completed .lms-mobile-chapter-number {
    background: #059669;
    color: white;
}

.lms-mobile-chapter-content {
    flex: 1;
    min-width: 0;
}

.lms-mobile-chapter-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 4px;
}

.lms-mobile-chapter-item.active .lms-mobile-chapter-title {
    color: #2563eb;
}

.lms-mobile-chapter-description {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lms-mobile-chapter-status {
    font-size: 14px;
    color: #64748b;
    flex-shrink: 0;
}

.lms-mobile-chapter-item.completed .lms-mobile-chapter-status {
    color: #059669;
}

.lms-mobile-chapter-item.active .lms-mobile-chapter-status {
    color: #2563eb;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .lms-course-main {
        flex-direction: column;
        gap: 20px;
    }
    
    .lms-chapters-section {
        width: 100%;
        order: -1;
    }
    
    .lms-chapters-list {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .lms-course-container {
        padding: 10px;
    }
    
    .lms-video-container {
        aspect-ratio: 16/9;
        max-width: 100%;
        min-height: auto;
    }
    
    .lms-video-info {
        padding: 15px;
    }
    
    .lms-video-title {
        font-size: 18px;
    }
    
    .lms-chapters-header {
        padding: 15px;
    }
    
    /* مخفی کردن سرفصل‌های دسکتاپ در موبایل */
    .lms-desktop-only {
        display: none !important;
    }
    
    /* نمایش منوی همبرگری در موبایل */
    .lms-mobile-menu-toggle {
        display: flex;
    }
    
    /* تنظیم padding برای موبایل */
    .lms-course-container {
        padding-top: 20px;
    }
    
    /* بهبود responsive برای ویدیو */
    .lms-video-container presto-player,
    .lms-video-container figure,
    .lms-video-container video,
    .lms-video-container iframe {
        aspect-ratio: 16/9;
        max-height: 50vh;
    }
}

/* تبلت */
@media (min-width: 769px) and (max-width: 1024px) {
    .lms-video-container {
        aspect-ratio: 16/9;
        max-width: 100%;
    }
    
    .lms-video-container presto-player,
    .lms-video-container figure,
    .lms-video-container video,
    .lms-video-container iframe {
        aspect-ratio: 16/9;
        max-height: 60vh;
    }
}

/* دسکتاپ بزرگ */
@media (min-width: 1025px) {
    .lms-video-container {
        aspect-ratio: 16/9;
        max-width: 1280px;
    }
    
    .lms-video-container presto-player,
    .lms-video-container figure,
    .lms-video-container video,
    .lms-video-container iframe {
        aspect-ratio: 16/9;
        max-height: 720px;
    }
}

/* Error States */
.lms-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 14px;
}

/* Success States */
.lms-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #059669;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 14px;
}

/* Loading Overlay برای ویدیو */
.lms-video-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
}

.lms-video-loading-content {
    text-align: center;
    padding: 30px;
}

.lms-video-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.lms-video-loading-text {
    color: #374151;
    font-size: 16px;
    font-weight: 500;
}

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