/* ======================= General Setup & Variables ======================= */
:root {
    --accent-color: rgba(235, 99, 78, 1);
    --accent-color2: rgba(235, 99, 78, 0.75);
    --bg-light-blue: rgba(212, 237, 241, 1);
    --bg-light-pink: rgba(255, 228, 224, 1);
    --text-dark: #2c3e50;
    --text-secondary: #7f8c8d;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --border-radius: 15px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    color: var(--text-dark);
    line-height: 1.8;
    font-size: 16px;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    /* افزودن پدینگ پایین برای جبران نوار چسبنده موبایل */
    padding-bottom: 100px;
}

@media (min-width: 992px) {
    body {
        /* در دسکتاپ نوار چسبنده وجود ندارد، پس پدینگ را برمیداریم */
        padding-bottom: 0;
    }
}

.section-title {
    font-weight: 800;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-dark);
    font-size: 1.8rem;
}

.page-section {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid #eee;
}

.page-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ======================= Buttons (From User) ======================= */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 1.05rem;
    letter-spacing: -0.5px;
    text-decoration: none; /* برای لینک‌ها */
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--white);
    box-shadow: 0 5px 15px rgba(235, 99, 78, 0.3);
}

.btn-accent:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(235, 99, 78, 0.4);
}

.btn-outline-primary {
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.btn-outline-primary:hover {
    background-color: var(--accent-color);
    color: var(--white);
}



/* =================================================== */
/* هدر ساده و زیبا (مبتنی بر تایپوگرافی) */
/* =================================================== */

.hero-section-simple {
    background-color: var(--bg-light-blue);
    padding: 70px 0;
    position: relative;
    overflow: hidden; /* برای المان‌های گرافیکی */
    text-align: center;
}

/* --------------------------------------------------- */
/* Media Query: نمایش المان‌های گرافیکی فقط در دسکتاپ (عرض >= 992px) */
/* --------------------------------------------------- */
@media (min-width: 992px) {

    /* المان گرافیکی ظریف اول (دایره بالا راست) */
    .hero-section-simple::before {
        content: '';
        position: absolute;
        top: -120px;
        right: -120px;
        width: 300px;
        height: 300px;
        background-color: var(--accent-color2);
        border-radius: 50%;
        z-index: 1;
        /* مطمئن می‌شویم که در موبایل (زیر 992px) وجود ندارد چون outside media query تعریف نشده */
    }

    /* المان گرافیکی ظریف دوم (دایره پایین چپ) */
    .hero-section-simple::after {
        content: '';
        position: absolute;
        bottom: -80px;
        left: -80px;
        width: 250px;
        height: 250px;
        background-color: rgba(255, 255, 255, 0.5);
        border-radius: 50%;
        z-index: 1;
        /* مطمئن می‌شویم که در موبایل (زیر 992px) وجود ندارد چون outside media query تعریف نشده */
    }
}

/* موج پایین هدر */
.hero-section-simple {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: -1px; /* برای همپوشانی کامل */
}

.hero-section-simple .container {
    position: relative;
    z-index: 2; /* محتوا باید روی المان‌های گرافیکی باشد */
}

/* محدود کردن عرض متن برای خوانایی بهتر */
.hero-simple-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title-simple {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 20px;
    line-height: 1.4;
}

.hero-subtitle-simple {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 35px; /* فاصله بیشتر تا اطلاعات کلیدی */
    line-height: 1.8;
}

/* ما از استایل .course-meta که در CSS اصلی شما بود استفاده می‌کنیم.
  این استایل (کپسول‌های خاکستری) برای این هدر عالی است.
  فقط مطمئن می‌شویم که در مرکز قرار می‌گیرد.
*/
.hero-section-simple .course-meta {
    justify-content: center; /* اطمینان از وسط‌چین بودن کپسول‌ها */
}

/* ======================= New Hero Header ======================= */
.hero-header-section {
    background-color: var(--bg-light-blue);
    padding: 60px 0;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero-header-section::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: var(--white);
    clip-path: ellipse(80% 100% at 50% 100%);
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* ======================= New Sticky Sidebar (Desktop) ======================= */
.sticky-sidebar {
    position: sticky;
    top: 20px; /* فاصله از بالای صفحه */
    z-index: 100;
}

.hero-image-desktop {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* ======================= New Mobile Purchase Card ======================= */
.mobile-purchase-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    background: #fdfdfd;
    margin-bottom: 30px;
}

.hero-image-mobile {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* ======================= Price Box (From User, slightly adapted) ======================= */
.price-box {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

/* در دسکتاپ، باکس قیمت کمی فاصله از عکس بالا دارد */
.sticky-sidebar .price-box {
    margin-top: 20px;
}

.price-subtitle {
    margin-top: 15px;
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #e74c3c;
}

/* =================================================== */
/* نوار چسبنده خرید موبایل (v2) */
/* =================================================== */
.mobile-sticky-footer-v2 {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    /* پس‌زمینه سفید با کمی سایه برای برجسته شدن */
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 1030; /* بالاتر از Navbar موبایل */
    padding: 10px 0;
}

.mobile-sticky-footer-v2 .container {
    padding: 0 15px; /* برای جلوگیری از چسبیدن به لبه‌ها */
}

.footer-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* بخش عنوان دوره */
.course-title-mobile-footer {
    flex-grow: 1; /* فضای باقی‌مانده را بگیرد */
    text-align: right;
    overflow: hidden; /* ضروری برای محدود کردن خطوط */
    max-width: 50%; /* حداکثر نصف عرض را بگیرد */
}

.course-title-mobile-footer .label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: -3px; /* نزدیک‌تر کردن به عنوان */
    font-weight: 500;
}

.course-title-mobile-footer .title-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;

    /* محدود کردن عنوان به حداکثر دو خط در موبایل */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* تعداد خطوط */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* بخش قیمت و دکمه */
.purchase-area-mobile-footer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-info-mobile-footer {
    text-align: right;
    white-space: nowrap;
}

.mobile-old-price-v2 {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: line-through;
    line-height: 1;
}

.mobile-final-price-v2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
}

.purchase-btn-v2 {
    padding: 8px 15px;
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap; /* از شکستن متن جلوگیری می‌کند */
}


/* ======================= Course Meta (From User) ======================= */
.course-meta {
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.course-meta li {
    display: flex;
    align-items: center;
    background-color: #f1f5f9;
    color: #334155;
    padding: .5rem 1rem;
    border-radius: 50em;
    font-size: 0.9rem;
    font-weight: 500;
}
.course-meta i {
    color: var(--accent-color);
    font-size: 1.1rem;
    margin-left: .5rem;
}
.course-meta li strong {
    font-weight: 700;
    margin-left: .25rem;
}

/* ======================= Price Story V2 (From User - Unchanged) ======================= */
.price-story-v2 {
    background-color: #eef7f9;
    border-radius: 10px;
    padding: 10px 15px;
    margin-bottom: 15px;
    border: 1px solid #cce3e7;
}
.price-step-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}
.price-step-v2:not(:last-child) {
    border-bottom: 1px dashed #b8d5da;
}
.step-label-v2 {
    font-size: 14px;
    color: #5b8a8e;
    font-weight: 500;
}
.price-and-badge-v2 {
    display: flex;
    align-items: center;
    gap: 8px;
}
.step-value-v2 {
    font-size: 16px;
    font-weight: 600;
    color: #0A4045;
}
.step-value-v2.strikethrough {
    color: #90a4ae;
    text-decoration: line-through;
    text-decoration-color: #ff7e6b;
    text-decoration-thickness: 1.5px;
    font-size: 15px;
}
.step-value-v2.final {
    color: #d95a41;
    font-size: 20px;
    font-weight: 800;
}
.badge-v2 {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}
.badge-v2.discount {
    background-color: #26848C;
}
.badge-v2.special {
    background-color: #c5402c;
}

/* ======================= Injected Content Styling ======================= */
/* استایل‌دهی به محتوایی که از دیتابیس می‌آید */
.content-from-db {
    line-height: 1.9;
}
.content-from-db h2,
.content-from-db h3 {
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--text-dark);
}
.content-from-db ul {
    padding-right: 20px;
    margin-bottom: 20px;
}
.content-from-db li {
    margin-bottom: 10px;
    padding-right: 15px;
    position: relative;
}
.content-from-db li::before {
    content: '\f058'; /* Font Awesome check-circle */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--accent-color);
    position: absolute;
    right: -5px;
    top: 5px;
}


/* ======================= Episodes Section (From User - Unchanged) ======================= */
.episodes-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 768px) {
    .episodes-list {
        /* در ستون محتوای دسکتاپ، سرفصل‌ها را تک ستونه نگه می‌داریم تا خواناتر باشد */
        grid-template-columns: 1fr;
    }
}
.episode-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
    overflow: hidden;
}
.episode-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.episode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: default;
}
.episode-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.episode-status-icon {
    font-size: 1rem;
    color: var(--text-secondary);
}
.episode-status-icon.fa-unlock {
    color: #27ae60;
}
.episode-title {
    font-weight: 600;
    color: var(--text-dark);
}
.episode-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
}
.episode-time {
    font-size: 0.875rem;
    white-space: nowrap;
}
#toggleEpisodesBtn {
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: 2rem;
}

/* ======================= Post-Course (From User) ======================= */
.post-course-box {
    padding: 40px;
    background-color: var(--bg-light-pink);
    border-radius: var(--border-radius);
    position: relative;
}
.post-course-box .quote-icon {
    position: absolute;
    top: -25px;
    right: 50%;
    transform: translateX(50%);
    font-size: 3rem;
    color: var(--accent-color);
    background: var(--white);
    padding: 0 10px;
}
.post-course-box h3 {
    margin-bottom: 20px;
    font-size: 1.6rem;
}

/* ======================= Testimonials (From User) ======================= */
.testimonials-grid {
    display: grid;
    grid-template-columns: 1fr; /* همیشه تک ستونه برای خوانایی بهتر */
    gap: 20px;
}
.testimonial-card {
    background-color: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}
.author-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.author-name {
    margin: 0;
    font-weight: 700;
}
.author-handle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.testimonial-text {
    color: var(--text-secondary);
}


/* ======================= Final CTA / Guarantee Box ======================= */
.guarantee-box-section {
    border-bottom: none; /* این آخرین بخش است */
}
.final-cta-box {
    padding: 40px;
    border-radius: var(--border-radius);
    background-color: var(--bg-light-blue);
    text-align: center;
}
.final-cta-box h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 800;
}
.final-cta-box p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* ======================= FAQ (From User - Unchanged) ======================= */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.accordion-item {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius) !important;
    overflow: hidden;
    transition: all 0.3s ease;
}
.accordion-item.active {
    border-color: var(--accent-color);
    box-shadow: var(--shadow);
}
.accordion-header {
    width: 100%;
    background: none;
    border: none;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem; /* کمی کوچکتر برای هماهنگی */
    font-weight: 500;
    text-align: right;
    color: var(--text-dark);
}
.accordion-header i {
    transition: transform 0.3s ease;
    color: var(--accent-color);
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}
.accordion-content p {
    padding: 0 20px 20px;
    margin: 0;
    color: var(--text-secondary);
}
.accordion-item.active .accordion-header i {
    transform: rotate(180deg);
}
.accordion-item.active .accordion-content {
    max-height: 300px; /* Adjust if content is taller */
}
