/* ==========================================================================
   Variables & Root
   ========================================================================== */
:root {
    --accordion-bg-color: #ffffff;
    --accordion-hover-color: #2563eb;
    --button-bg-color: #3b82f6;
    --button-text-color: #ffffff;
    --private-course-text-color: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --transition-base: all 0.2s ease-in-out;
    --main-red: #ef4444;
}

/* ==========================================================================
   Modern Accordion Design (V4)
   ========================================================================== */
.accordion-item {
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.accordion-title {
    background-color: #ffffff;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    user-select: none;
}

.accordion-title h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #334155;
    flex-grow: 1;
    text-align: right;
}

/* آیکون مدرن سمت چپ (Chevron) */
.accordion-title::before {
    content: "\f107"; /* کد فلش FontAwesome */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 1.2rem;
    color: #94a3b8;
    transition: all 0.3s ease;
    margin-right: 15px;
    position: static; /* حذف موقعیت مطلق قبلی */
    transform: none;
}

/* وضعیت فعال */
.accordion-item.active {
    border-color: var(--button-bg-color);
    box-shadow: 0 4px 20px -2px rgba(59, 130, 246, 0.1);
}

.accordion-item.active .accordion-title {
    background-color: #f8faff;
    border-bottom: 1px solid #eef2ff;
}

.accordion-item.active .accordion-title::before {
    transform: rotate(180deg);
    color: var(--button-bg-color);
}

.accordion-content {
    display: none;
    padding: 0; /* پدینگ به داخل li منتقل شد برای ظاهر یکپارچه */
    background-color: #ffffff;
}

.accordion-content ul {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
}

.accordion-content ul li {
    margin: 0.25rem 0.5rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.accordion-content ul li:hover {
    background-color: #f1f5f9;
}

/* دکمه‌های مدرن داخل لیست */
.lesson-actions {
    display: flex;
    gap: 8px;
}

.download-button,
.show-course-button {
    float: none; /* حذف فلوت قدیمی */
    margin: 0;
    border-radius: 0.6rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #475569 !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.show-course-button:hover {
    background: var(--button-bg-color);
    color: #fff !important;
    border-color: var(--button-bg-color);
}

.download-button:hover {
    background: #10b981; /* رنگ سبز برای دانلود */
    color: #fff !important;
    border-color: #10b981;
}

.lesson-title {
    font-size: 0.95rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lesson-title i {
    color: var(--button-bg-color);
    font-size: 1.1rem;
}

.private-course-text {
    font-size: 0.8rem;
    color: #94a3b8;
    background: #f8fafc;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px dashed #e2e8f0;
}

h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

/* ==========================================================================
   Shared Carousel Styles (Courses, Posts, Podcasts)
   ========================================================================== */
.masir-courses-carousel-widget,
.masir-posts-carousel-widget,
.masir-podcasts-carousel-widget {
    margin-bottom: 2rem;
}

.swiper-container {
    overflow: hidden;
    padding: 10px 5px;
}
.swiper-wrapper {
    display: flex;
}
.swiper-slide {
    height: auto;
    display: flex;
    flex-direction: column;
}

/* Carousel Header & Buttons */
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.all-courses-btn {
    background-color: var(--main-red);
    color: #fff;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
    transition: var(--transition-base);
}
.all-courses-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
}

/* Navigation & Pagination */
.swiper-button-next,
.swiper-button-prev {
    width: 44px;
    height: 44px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: #333 !important;
    transition: var(--transition-base);
}
.swiper-button-next:hover,
.swiper-button-prev:hover {
    background-color: var(--main-red);
    color: #fff !important;
}
.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 16px !important;
    font-weight: bold;
}

.swiper-pagination {
    position: static;
    margin-top: 1.5rem;
}
.swiper-pagination-bullet {
    background: #ccc !important;
    opacity: 1;
    width: 8px;
    height: 8px;
}
.swiper-pagination-bullet-active {
    background: var(--main-red) !important;
    width: 20px;
    border-radius: 5px;
}

/* ==========================================================================
   Card Designs (Courses & Podcasts)
   ========================================================================== */
.course-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition-base);
}
.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.card-image {
    position: relative;
    width: 100%;
}
.card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.play-icon {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.3);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
}

.discount-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background-color: #ff9f43;
    color: white;
    font-size: 13px;
    font-weight: bold;
    padding: 15px 8px 5px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 85%, 0 100%);
}

.card-content {
    padding: 1.2rem;
    flex-grow: 1;
}
.course-title-secondary,
.course-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    min-height: 44px;
    line-height: 1.5;
}
.course-title-secondary a,
.course-title a {
    color: #1e293b;
    text-decoration: none;
}

.card-footer {
    padding: 1rem;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Price Styling */
.price {
    font-size: 1.1rem;
    direction: rtl;
    text-align: left;
    width: 100%;
}
.price ins {
    color: #27ae60;
    font-weight: bold;
    text-decoration: none;
}
.price del {
    font-size: 0.85rem;
    color: #999;
    margin-left: 8px;
}
.free-course {
    color: #27ae60;
    font-weight: bold;
}

/* ==========================================================================
   Post Card Specifics
   ========================================================================== */
.post-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.post-image {
    position: relative;
    padding-top: 56.25%;
}
.post-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.post-content {
    padding: 1.2rem;
    flex-grow: 1;
}
.post-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    min-height: 50px;
}
.post-excerpt {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.7;
    margin-top: 10px;
}
.post-meta {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.8rem;
    color: #888;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .download-button,
    .show-course-button {
        float: none;
        display: block;
        width: 100%;
        margin: 0.5rem 0;
        text-align: center;
    }
    .carousel-container {
        padding: 0 20px;
    }
}

/* ظرف اصلی عنوان */
.accordion-title {
    display: flex;
    justify-content: space-between; /* متن و آیکون در راست، فلش در چپ */
    align-items: center;
    padding: 15px 20px;
    background: #f8faff;
    cursor: pointer;
    direction: rtl;
}

/* پکیج سمت راست: شامل آیکون و متن */
.title-right-side {
    display: flex;
    align-items: center;
    gap: 12px; /* فاصله بین آیکون کتاب/کاغذ و متن سرفصل */
}

.main-accordion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3182ce; /* رنگ آیکون سرفصل */
    font-size: 1.2rem;
    width: 24px;
}

.main-accordion-icon svg {
    width: 24px;
    height: auto;
    fill: currentColor;
}

.section-title-text {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    color: #2d3748;
}

/* فلش سمت چپ */
.title-left-side {
    display: flex;
    align-items: center;
}

.arrow-icon {
    font-size: 14px;
    color: #a0aec0;
    transition: transform 0.3s ease;
}

/* چرخش فلش در حالت فعال */
.accordion-item.active .arrow-icon {
    transform: rotate(180deg);
}

/* حذف فلش‌های مزاحم قدیمی */
.accordion-title::before,
.accordion-title::after {
    display: none !important;
}

/* استایل پنل داخلی محتوای درس */
.lesson-details-panel {
    background-color: #fcfcfd;
    border-right: 3px solid #3182ce; /* یک خط رنگی در سمت راست برای تمایز */
    margin: 0 10px 10px 10px;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.lesson-content-inner {
    padding: 20px;
    font-size: 14px;
    line-height: 1.8;
    color: #4a5568;
    border: 1px solid #edf2f7;
    border-top: none;
}

/* تغییر رنگ دکمه وقتی پنل باز است */
.lesson-row + .lesson-details-panel[style*="display: block"] {
    margin-top: -5px;
}

/* استایل‌های تکمیلی برای چیدمان عمودی متن‌ها */
.title-text-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.section-subtitle-text {
    margin: 0;
    font-size: 13px;
    color: #718096;
    font-weight: normal;
    line-height: 1.4;
}

.lesson-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lesson-desc {
    margin: 0;
    font-size: 12px;
    color: #a0aec0;
    line-height: 1.4;
}

.lock-status {
    color: #e53e3e;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    background: #fff5f5;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #fed7d7;
}

.is-locked {
    cursor: not-allowed;
}

.lesson-row.is-locked .lesson-name {
    color: #a0aec0;
}

.lesson-info {
    display: flex;
    gap: 0.5rem;
}

.product-sale-badge {
    position: absolute;
    top: 5.5rem !important;
    right: -2.5rem !important;
    background: red !important;

}