.widgetlearn-course {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: Tahoma, Arial, sans-serif;
    direction: rtl;
    margin-bottom: 30px;
    width: 100%;
}

.course-header {
    display: flex;
    padding: 15px;
    background: #f8f9fa;
    color: #333;
    gap: 15px;
    border-bottom: 1px solid #e0e0e0;
    min-height: 150px;
    align-items: center;
    transition: background-color 0.3s ease;
}

.course-header-content {
    flex: 1;
    padding: 5px;
}

.course-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #e0e0e0;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.course-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #333;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 3px;
    background: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.free-lessons-count {
    background: #e3f2fd;
}

.course-description {
    font-size: 12px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 10px;
}

.buy-button {
    display: inline-block;
    padding: 8px 15px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.3s ease;
}

.buy-button:hover {
    background: #3e8e41;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.widgetlearn-lessons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
}

.widgetlearn-lesson {
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.widgetlearn-lesson.accessible {
    border-left-width: 3px;
    border-left-style: solid;
}

.widgetlearn-lesson.locked {
    border-left-width: 3px;
    border-left-style: solid;
    opacity: 0.9;
}

.widgetlearn-lesson.lesson-free {
    border-left-width: 3px;
    border-left-style: solid;
}

.lesson-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    margin-bottom: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
    position: relative;
}

.lesson-header:hover {
    background: #f5f5f5;
}

.lesson-icon {
    font-size: 16px;
    color: #555;
    width: 20px;
    text-align: center;
}

.lesson-icon .material-icons {
    font-size: 16px;
    vertical-align: middle;
}

.lesson-title-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.lesson-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.lesson-short-desc {
    margin: 3px 0 0 0;
    font-size: 12px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.lesson-meta {
    display: flex;
    gap: 15px; /* Increased gap to separate free label and toggle */
    font-size: 12px;
    color: #777;
    margin-left: auto;
}

.lesson-free-badge {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #2196F3;
    font-weight: 600;
    font-size: 12px;
    margin-left: 10px;
}

.lesson-free-badge i {
    font-size: 12px;
}

.lesson-toggle {
    transition: transform 0.3s ease;
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.widgetlearn-lesson.active .lesson-toggle {
    transform: translateY(-50%) rotate(180deg);
}

.lesson-content {
    max-height: 0;
    opacity: 0;
    background: #fff;
    border: 1px solid #eee;
    border-top: none;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.lesson-content.active {
    max-height: 1000px;
    opacity: 1;
    padding: 10px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-top: 10px;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.document-container {
    padding: 10px;
}

.download-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #2196F3;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.download-button:hover {
    background: #0d8bf2;
}

.text-content {
    padding: 10px;
    font-size: 12px;
}

.quiz-container {
    padding: 10px;
}

.quiz-question {
    margin-bottom: 10px;
}

.quiz-submit {
    padding: 6px 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.quiz-submit:hover {
    background: #3e8e41;
}

.preview-content {
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 12px;
}

.locked-content {
    background: #ffebee;
    padding: 10px;
    text-align: center;
    font-size: 12px;
}

.locked-content p {
    margin: 0 0 8px 0;
    color: #F44336;
}

.button {
    display: inline-block;
    padding: 6px 12px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 12px;
}

.button:hover {
    background: #3e8e41;
}

/* Theme Styles */
.theme-list .widgetlearn-lessons {
    flex-direction: column;
    gap: 8px;
}

.theme-minimal .widgetlearn-course {
    box-shadow: none;
    border: 1px solid #e0e0e0;
}

.theme-minimal .course-header {
    border-bottom: none;
    padding: 10px;
}

.theme-minimal .widgetlearn-lesson {
    border: none;
    box-shadow: none;
    background: #f9f9f9;
    margin-bottom: 8px;
}

/* Media Query برای موبایل */
@media (max-width: 768px) {
    .course-header {
        flex-direction: column;
        padding: 10px;
        min-height: auto;
        text-align: center;
    }
    
    .course-image {
        width: 100px;
        height: 100px;
        margin-bottom: 10px;
    }
    
    .course-header-content {
        padding: 0;
    }
    
    .course-title {
        font-size: 16px;
    }
    
    .course-meta {
        gap: 5px;
        font-size: 11px;
        justify-content: center;
    }
    
    .course-description {
        font-size: 11px;
    }
    
    .buy-button {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .lesson-header {
        padding: 8px;
        gap: 5px;
        font-size: 12px;
    }
    
    .lesson-icon {
        font-size: 14px;
        width: 18px;
    }
    
    .lesson-header h4 {
        font-size: 12px;
    }
    
    .lesson-short-desc {
        font-size: 10px;
    }
    
    .lesson-meta {
        gap: 3px;
        font-size: 10px;
    }
    
    .lesson-free-badge {
        font-size: 10px;
        margin-left: 5px;
    }
    
    .lesson-free-badge i {
        font-size: 10px;
    }
    
    .lesson-toggle {
        left: 5px;
    }
    
    .lesson-content {
        padding: 8px;
    }
    
    .video-container iframe,
    .video-container video {
        height: 200px;
    }
    
    .document-container iframe {
        height: 300px;
    }
    
    .download-button {
        padding: 4px 10px;
        font-size: 10px;
    }
    
    .text-content {
        font-size: 10px;
    }
    
    .quiz-submit {
        padding: 4px 10px;
        font-size: 10px;
    }
    
    .preview-content {
        font-size: 10px;
    }
    
    .locked-content {
        font-size: 10px;
    }
    
    .button {
        padding: 4px 10px;
        font-size: 10px;
    }
}