: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;
}

.accordion-item {
    margin-bottom: 1rem;
    transition: var(--transition-base);
}

.accordion-title {
    background-color: var(--accordion-bg-color);
    padding: 1rem 1.5rem;
    cursor: pointer;
    position: relative;
    border-radius: 0.75rem;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.accordion-title::before {
    content: "\2630";
    font-size: 1.25rem;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    transition: var(--transition-base);
    color: var(--accordion-hover-color);
}

.accordion-title:hover {
    background-color: #f8fafc;
    box-shadow: var(--shadow-md);
}

.accordion-content {
    display: none;
    padding: 1.5rem;
    background-color: var(--accordion-bg-color);
    transition: var(--transition-base);
    border-radius: 0.75rem;
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
}

.accordion-item.active .accordion-content {
    display: block;
    opacity: 1;
}

.accordion-item.active .accordion-title::before {
    transform: rotate(90deg) translateY(-50%);
}

.accordion-content ul li {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--accordion-bg-color);
    transition: var(--transition-base);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.accordion-content ul li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.accordion-content ul li:hover {
    background-color: #f8fafc;
}

.accordion-content ul li:hover h3 {
    color: var(--accordion-hover-color);
}

.accordion-content ul li:hover p {
    color: var(--private-course-text-color);
}

.download-button,
.show-course-button {
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    float: left;
    margin-left: 0.75rem;
    border-radius: 0.5rem;
    transition: var(--transition-base);
    font-weight: 500;
}

.download-button:hover,
.show-course-button:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

h3 {
    overflow: hidden;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.private-course-text {
    color: var(--private-course-text-color);
    font-size: 0.875rem;
    float: left;
    margin-left: 0.5rem;
    font-weight: 500;
}

/* --- Courses Carousel Widget Styles V3 (Final) --- */

/* اطمینان از اینکه swiper به درستی نمایش داده می‌شود */
.masir-courses-carousel-widget .swiper-container {
    overflow: hidden;
    padding: 5px; /* فضایی برای سایه کارت‌ها */
}
.masir-courses-carousel-widget .swiper-wrapper {
    display: flex;
}
.masir-courses-carousel-widget .swiper-slide {
    flex-shrink: 0;
    height: auto; /* اجازه می‌دهد ارتفاع خودکار باشد */
    display: flex; /* برای کشیده شدن کارت */
    flex-direction: column;
}

.masir-courses-carousel-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.masir-courses-carousel-widget .all-courses-btn {
    background-color: #ef4444;
    color: #fff;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}
.masir-courses-carousel-widget .all-courses-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
}
.masir-courses-carousel-widget .carousel-container {
    position: relative;
    padding: 0 40px;
}

/* --- Navigation Buttons --- */
.masir-courses-carousel-widget .swiper-button-next,
.masir-courses-carousel-widget .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: all 0.3s ease;
}
.masir-courses-carousel-widget .swiper-button-next:hover,
.masir-courses-carousel-widget .swiper-button-prev:hover {
    background-color: #ef4444;
    color: #fff !important;
}
.masir-courses-carousel-widget .swiper-button-next {
    right: 0;
}
.masir-courses-carousel-widget .swiper-button-prev {
    left: 0;
}
.masir-courses-carousel-widget .swiper-button-next::after,
.masir-courses-carousel-widget .swiper-button-prev::after {
    font-size: 18px !important;
    font-weight: bold;
}

/* --- Pagination Dots --- */
.masir-courses-carousel-widget .swiper-pagination {
    position: static;
    margin-top: 2rem;
}
.masir-courses-carousel-widget .swiper-pagination-bullet {
    background: #ccc !important;
    opacity: 1;
    width: 10px;
    height: 10px;
}
.masir-courses-carousel-widget .swiper-pagination-bullet-active {
    background: #ef4444 !important;
}

/* --- New Course Card Design --- */
.masir-courses-carousel-widget .course-card {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
}
.masir-courses-carousel-widget .course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.masir-courses-carousel-widget .card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.masir-courses-carousel-widget .card-image a {
    position: relative;
    display: block;
}

.masir-courses-carousel-widget .card-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 15px;
    opacity: 0.8;
}
.masir-courses-carousel-widget .card-image-title {
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
}
.masir-courses-carousel-widget .play-icon {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 16px;
}
.masir-courses-carousel-widget .discount-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background-color: #ff9f43;
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 15px 8px 5px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 85%, 0 100%);
}

.masir-courses-carousel-widget .card-content {
    padding: 15px;
    flex-grow: 1;
}
.masir-courses-carousel-widget .course-title-secondary {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 10px;
    min-height: 44px;
}
.masir-courses-carousel-widget .course-title-secondary a {
    color: #333;
    text-decoration: none;
}
.masir-courses-carousel-widget .course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #777;
}

.masir-courses-carousel-widget .card-footer {
    padding: 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* --- استایل نهایی و صحیح برای بخش قیمت --- */

.masir-courses-carousel-widget .price {
    font-size: 18px;
    direction: rtl;
    text-align: left;
    width: 100%;
}

/* استایل قیمت فعلی (قیمت ویژه یا قیمت عادی) */
.masir-courses-carousel-widget .price ins {
    color: #27ae60; /* رنگ سبز */
    font-weight: bold; /* ضخیم کردن متن */
    text-decoration: none; /* حذف خط زیرین که مرورگر به تگ <ins> می‌دهد */
}

/* استایل قیمت خط‌خورده (در حالت فروش ویژه) */
.masir-courses-carousel-widget .price del {
    font-size: 14px;
    font-weight: normal;
    color: #999;
    margin-left: 8px; /* ایجاد کمی فاصله با قیمت ویژه */
}

/* استایل واحد پول */
.masir-courses-carousel-widget .price .woocommerce-Price-currencySymbol {
    font-size: 14px;
    font-weight: normal;
    margin-right: 5px;
}
.masir-courses-carousel-widget .price .free-course {
    color: #27ae60; /* A nice green color */
    font-weight: bold;
}

/* ==========================================================================
   استایل کاروسل نوشته‌ها (Posts Carousel)
   ========================================================================== */

.masir-posts-carousel-widget .swiper-container {
    width: 100%;
    overflow: hidden;
    padding: 5px; /* فضایی برای سایه کارت‌ها */
}
.masir-posts-carousel-widget .swiper-wrapper {
    display: flex;
}
.masir-posts-carousel-widget .swiper-slide {
    flex-shrink: 0;
    height: auto; /* اجازه می‌دهد ارتفاع خودکار باشد */
    display: flex; /* برای کشیده شدن کارت */
    flex-direction: column;
}
.masir-posts-carousel-widget .post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.masir-posts-carousel-widget .post-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background-color: #f0f0f0;
}
.masir-posts-carousel-widget .post-image a,
.masir-posts-carousel-widget .post-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.masir-posts-carousel-widget .post-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.masir-posts-carousel-widget .post-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #2c3e50;
    min-height: 54px;
}
.masir-posts-carousel-widget .post-title a {
    color: inherit;
    text-decoration: none;
}
.masir-posts-carousel-widget .post-excerpt {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
    flex-grow: 1;
}
.masir-posts-carousel-widget .post-meta {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
    color: #888;
}

/* --- Navigation Buttons --- */
.masir-posts-carousel-widget .swiper-button-next,
.masir-posts-carousel-widget .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: all 0.3s ease;
}
.masir-posts-carousel-widget .swiper-button-next:hover,
.masir-posts-carousel-widget .swiper-button-prev:hover {
    background-color: #ef4444;
    color: #fff !important;
}
.masir-posts-carousel-widget .swiper-button-next {
    right: 0;
}
.masir-posts-carousel-widget .swiper-button-prev {
    left: 0;
}
.masir-posts-carousel-widget .swiper-button-next::after,
.masir-posts-carousel-widget .swiper-button-prev::after {
    font-size: 18px !important;
    font-weight: bold;
}
/* --- Pagination Dots --- */
.masir-posts-carousel-widget .swiper-pagination {
    position: static;
    margin-top: 2rem;
}
.masir-posts-carousel-widget .swiper-pagination-bullet {
    background: #ccc !important;
    opacity: 1;
    width: 10px;
    height: 10px;
}
.masir-posts-carousel-widget .swiper-pagination-bullet-active {
    background: #ef4444 !important;
}




/* ==========================================================================
   استایل کاروسل پادکست‌ها (شبیه به دوره‌ها)
   ========================================================================== */
.masir-podcasts-carousel-widget .carousel-container { position: relative; padding: 0 45px; }
.masir-podcasts-carousel-widget .swiper-slide { height: auto; }

/* استایل کارت (کپی شده از .course-card) */
.masir-podcasts-carousel-widget .course-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #f0f0f0;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.07);
}
.masir-podcasts-carousel-widget .card-image {
    position: relative;
}
.masir-podcasts-carousel-widget .card-image img,
.masir-podcasts-carousel-widget .card-image .fallback-bg {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}
.masir-podcasts-carousel-widget .play-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.4);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* استایل محتوا (کپی شده از دوره‌ها) */
.masir-podcasts-carousel-widget .card-content {
    padding: 15px;
    flex-grow: 1;
}
.masir-podcasts-carousel-widget .course-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    min-height: 45px;
}
.masir-podcasts-carousel-widget .course-title a {
    color: #333;
    text-decoration: none;
}

/* استایل فوتر (اختصاصی برای پادکست) */
.masir-podcasts-carousel-widget .card-footer {
    padding: 15px;
    border-top: 1px solid #f0f0f0;
}
.masir-podcasts-carousel-widget .podcast-meta {
    font-size: 13px;
    color: #777;
    width: 100%;
    text-align: left;
}
.masir-podcasts-carousel-widget .podcast-meta i {
    margin-left: 5px;
}