/* ===========================================================================
   fastkart — bot/index.html
   ===========================================================================

   تا فاز ۶۶ این قاعده‌ها داخلِ خودِ قالب بودند، در یک `<style>`.

   سه هزینه داشت و هیچ‌کدام دیده نمی‌شد: مرورگر نمی‌توانست کشش کند
   (هر بار باز شدنِ صفحه، دوباره)، هیچ قالبِ دیگری نمی‌توانست
   بازنویسی‌اش کند، و یک Content-Security-Policyِ سخت‌گیر که
   `style-src 'unsafe-inline'` نداشته باشد کلِ صفحه را بی‌شکل
   می‌کرد.
   =========================================================================== */

        :root {
            --primary-color: var(--theme-accent, #3dcfff);
            --user-bubble: var(--theme-accent, #3dcfff);
            --bot-bubble: #f0f4f8;
            --text-color: #2d3748;
            --light-text: #718096;
            --border-color: #e2e8f0;
            --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --font-family: "IRANSans", -apple-system, BlinkMacSystemFont, sans-serif;
        }

        html, body {
            touch-action: pan-y;
            overscroll-behavior: none;
            -ms-touch-action: pan-y;
        }

        .chat-container,
        .chat-section {
            touch-action: manipulation;
        }

        .chat-section {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            min-height: calc(100vh - 200px);
        }

        .chat-container {
            background-color: white;
            border-radius: 1rem;
            box-shadow: var(--shadow);
            display: flex;
            flex-direction: column;
            width: 100%;
            max-width: 1200px;
            position: relative;
            transition: all 0.3s ease;
        }

        /* کاربرِ واردشده تاریخچهٔ گفتگو دارد، پس ظرف ارتفاعِ ثابت
           می‌گیرد و خودش اسکرول می‌شود. مهمان فقط معرفی را می‌بیند و
           ارتفاعش به اندازهٔ محتواست.

           تا فاز ۶۶ این دو حالت با یک شرطِ جنگو دربارهٔ ورودِ کاربر
           **داخلِ خودِ CSS** بودند — تنها دلیلی که کلِ ۸۸۷ خط نمی‌توانست
           یک فایلِ کش‌شونده باشد. */
        .chat-container.is-signed-in {
            overflow: hidden;
            height: 70vh;
        }

        .chat-messages {
            padding: 1rem;
            overflow-y: auto;
            flex: 1;
            background-color: #fafcff;
            scroll-behavior: smooth;
        }

        .chat-messages.no-smooth {
            scroll-behavior: auto !important;
        }

        .messages-list{
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .message {
            display: flex;
            max-width: 85%;
        }

        .message.new {
            opacity: 0;
            transform: translateY(10px);
            animation: fadeIn 0.3s ease forwards;
        }

        @keyframes fadeIn {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .message.bot {
            align-self: flex-end;
        }

        .message.user {
            align-self: flex-start;
        }

        .message pre code{
            word-break: break-all;
            white-space: break-spaces;
        }

        .bubble {
            padding: 0.75rem 1rem;
            border-radius: 1.125rem;
            font-size: 0.95rem;
            line-height: 1.4;
            word-wrap: break-word;
            font-family: var(--font-family);
            box-shadow: var(--shadow);
            position: relative;
        }

        .bubble li{
            display: block;
        }

        .bubble hr {
            margin-top: 10px;
            margin-bottom: 10px;
        }

        .message.bot .bubble {
            background-color: var(--bot-bubble);
            color: var(--text-color);
            border-bottom-left-radius: 0.25rem;
        }

        .message.user .bubble {
            background-color: var(--user-bubble);
            color: white;
            border-bottom-right-radius: 0.25rem;
        }

        .typing-indicator .bubble {
            background-color: var(--bot-bubble);
            padding: 0.75rem 1rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .typing-dots {
            display: flex;
            gap: 0.25rem;
        }

        .typing-dot {
            width: 8px;
            height: 8px;
            background-color: var(--light-text);
            border-radius: 50%;
            animation: bounce 1.4s infinite ease-in-out;
        }

        .typing-dot:nth-child(1) {
            animation-delay: 0s;
        }

        .typing-dot:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-dot:nth-child(3) {
            animation-delay: 0.4s;
        }

        @keyframes bounce {
            0%, 60%, 100% {
                transform: translateY(0);
            }
            30% {
                transform: translateY(-5px);
            }
        }

        .chat-input-area {
            border-top: 1px solid var(--border-color);
            display: flex;
            padding: 0.75rem;
            background-color: white;
            position: relative;
        }

        .chat-input-area input {
            flex: 1;
            border: 1px solid var(--border-color);
            border-radius: 2rem;
            padding: 0.75rem 1.25rem;
            font-size: 0.95rem;
            font-family: var(--font-family);
            transition: all 0.2s ease;
        }

        .chat-input-area input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(61, 207, 255, 0.2);
        }

        .chat-input-area button {
            margin-right: 0.75rem;
            border-radius: 2rem;
            padding: 0.5rem 1.25rem;
            background-color: var(--primary-color);
            color: white;
            border: none;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .chat-input-area button:hover {
            background-color: var(--theme-accent-strong, #2bb8e6);
            transform: translateY(-1px);
        }

        /* حالت لاگین نکرده */
        .login-prompt {
            padding: 2rem;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
        }

        .login-prompt h5 {
            color: var(--text-color);
            margin-bottom: 1rem;
            font-size: 1.25rem;
        }

        .login-prompt p {
            color: var(--light-text);
            margin-bottom: 1.5rem;
            max-width: 400px;
            line-height: 1.6;
        }

        .login-prompt .btn {
            background-color: var(--primary-color);
            border: none;
            padding: 0.5rem 1.5rem;
            border-radius: 2rem;
            font-weight: 500;
        }

        /* اسکرول بار سفارشی */
        .chat-messages::-webkit-scrollbar {
            width: 6px;
        }

        .chat-messages::-webkit-scrollbar-track {
            background: transparent;
        }

        .chat-messages::-webkit-scrollbar-thumb {
            background-color: rgba(0, 0, 0, 0.1);
            border-radius: 3px;
        }

        /* برای عنصر چت */
        .chat-container {
            -webkit-user-select: none; /* جلوگیری از انتخاب متن */
            user-select: none;
        }

        /* رسپانسیو */
        @media (max-width: 768px) {
            html, body {
                position: fixed;
                overflow: hidden;
                width: 100%;
                height: 100%;
            }

            .navbar-top .middle-box .center-box .searchbar-box {
                display: none !important;
            }

            .breadscrumb-contain nav {
                margin-top: 0;
            }

            .breadscrumb-section .breadscrumb-contain nav .breadcrumb {
                padding-top: 0;
            }

            .chat-section {
                padding: 0 !important;
                min-height: 100 dvh;
            }

            .chat-container {
                border-radius: 0;
                max-width: 100%;
                position: absolute;
                top: 10vh;
                height: 80%;
                display: flex;
                flex-direction: column;
            }

            .chat-messages {
                flex: 1;
                overflow-y: auto;
            }

            .message {
                max-width: 90%;
            }

            .chat-input-area {
                position: sticky;
                bottom: 0;
                background: white;
                padding: 10px;
                border-top: 1px solid #eee;
            }

            @supports (-webkit-touch-callout: none) {
                /* استایل‌های خاص iOS */
                html, body {
                    position: fixed;
                    overflow: hidden;
                    width: 100%;
                    height: 100%;
                }

                .chat-section {
                    height: 100vh;
                    height: -webkit-fill-available;
                    min-height: unset;
                    touch-action: none;
                }

                .chat-container {
                    height: 80%;
                    max-height: -webkit-fill-available;
                    overflow: hidden;
                }

                .chat-messages {
                    -webkit-overflow-scrolling: touch;
                    overscroll-behavior: contain;
                }
            }

            .chat-input-area input {
                padding: 0.65rem 1rem;
            }

            .login-prompt {
                padding: 1.5rem;
            }

            .bubble {
                font-size: 0.9rem;
                padding: 0.65rem 0.9rem;
            }

            .chat-input-area button {
                padding: 0.5rem 1rem;
                font-size: 0.9rem;
            }

            footer {
                display: none;
            }

            .breadscrumb-section {
                display: none;
            }

            .mobile-search {
                display: none;
            }
        }

        .chat-intro-article {
            padding: 10px;
        }

        .chat-intro-article h5 {
            font-size: 20px;
            color: #2a2a2a;
            font-weight: bold;
            margin-bottom: 16px;
            border-bottom: 1px solid #e0e0e0;
            padding-bottom: 8px;
        }

        .chat-intro-article h6 {
            font-size: 18px;
            margin-top: 24px;
            margin-bottom: 8px;
            color: #198754;
            font-weight: bold;
            border-right: 4px solid #009688;
            padding-right: 8px;
        }

        .chat-intro-article p {
            margin-bottom: 16px;
            text-align: justify;
            color: #444;
            font-size: 16px;
            line-height: 1.8;
        }

        .chat-intro-article ul {
            list-style: none;
            padding-right: 10px;
            margin-bottom: 16px;
            margin-top: 16px;
        }

        .chat-intro-article li {
            position: relative;
            padding-right: 28px;
            margin-bottom: 10px;
            line-height: 1.8;
            color: #444;
            display: block;
            font-size: 16px;
        }

        .chat-intro-article .btn {
            font-size: 15px;
            padding: 10px 24px;
            border-radius: 8px;
        }

        .chat-intro-article .text-center {
            margin-top: 12px;
        }

        @media (max-width: 768px) {

        .chat-container:not(.is-signed-in) { overflow-y: scroll; }

            .chat-intro-article p {
                text-align: right;
            }

            .chat-intro-article li {
                padding-right: 8px;
                font-size: 14px;
            }

            .chat-intro-article .text-center {
                margin-top: 0;
            }
        }

      .chat-header {
    background: linear-gradient(135deg, #3dcfff, #2bb8e6);
    color: white;
    padding: 0.9rem 1.4rem;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.chat-header-title {
    margin: 0;
    letter-spacing: 0.5px;
}

.subscription-header-btn {
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 1rem;
    border: 1.5px solid rgba(255,255,255,0.55);
    border-radius: 50px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    transition: all 0.25s ease;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subscription-header-btn:hover,
.subscription-header-btn:focus {
    background: rgba(255,255,255,0.9);
    color: #0277bd;
    border-color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.subscription-header-btn i {
    font-size: 1.1rem;
}

/* ── دو تعریفِ `.plan-card` که تا فاز ۶۹ اینجا بودند ────────────────

   این فایل **دو بار** `.plan-card` را تعریف کرده بود، با دو مقدارِ
   متفاوت — یکی اینجا و یکی پایین‌تر، داخلِ بخشِ مودال. برندهٔ عملی
   دومی بود، پس این یکی فقط بایت بود.

   هر دو رفتند: نامِ کلاس از فاز ۷۰ `plans__card` است و چیدمانش در
   `_shared/css/assistant-plans.css` — چون ساختارش را پاسخِ سرور
   تعیین می‌کند و نه قالب. آنچه از این قالب مانده پایینِ همین فایل
   است و فقط رنگ و سایه. D60. */

    /* مودال تمام صفحه حرفه‌ای */
#subscription-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    overflow-y: auto;
    padding: 0;
    animation: fadeIn 0.3s ease;
}

#subscription-modal.active {
    display: block;
}

.modal-content {
    max-width: 900px;
    width: 95%;
    margin: 2rem auto;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header-custom {
    background: linear-gradient(135deg, var(--primary-color), #2bb8e6);
    color: white;
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.modal-header-custom h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.4rem;
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: white;
    opacity: 0.8;
    cursor: pointer;
    transition: opacity 0.2s;
}

.modal-close-btn:hover {
    opacity: 1;
}

.modal-body-custom {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── آنچه ماژول می‌سازد ──────────────────────────────────────────
   چیدمانشان در `_shared/css/assistant-plans.css` است — `bot/index.html`
   بارش می‌کند — و اینجا فقط رنگ و سایه، که زبانِ همین قالب است: کارتِ
   شناور با گوشهٔ نرم، و برجسته‌شدن با سایه در حالتِ hover. */

.modal-body-custom .plans__row { background: #f5f9ff; }

.modal-body-custom .plans__card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgb(0 0 0 / 8%);
    transition: box-shadow var(--ds-normal, 220ms) var(--ds-ease, ease);
}

.modal-body-custom .plans__card:hover {
    box-shadow: 0 12px 30px rgb(61 207 255 / 20%);
}

/* پلنِ پیشنهادی با **رنگ** جدا می‌شود و نه با `transform: scale()`.
   نسخهٔ قبلی کارت را ۵٪ بزرگ می‌کرد و یک نوارِ چرخیدهٔ «توصیه شده» با
   `position: absolute` رویش می‌گذاشت؛ در شبکه‌ای که کارت‌ها هم‌قدند،
   کارتِ بزرگ‌ترِ چرخیده از کارتِ بغلی می‌زد بیرون. */
.modal-body-custom .plans__card.is-recommended {
    border-color: var(--primary-color, #3dcfff);
    border-width: 2px;
}

.modal-body-custom .plans__duration { border-color: #e0e0e0; }

.modal-body-custom .plans__buy {
    background: linear-gradient(135deg, var(--primary-color, #3dcfff), #2bb8e6);
    border-radius: 50px;
    box-shadow: 0 8px 20px rgb(61 207 255 / 30%);
}

.modal-body-custom .plans__buy:hover:not(.is-locked) {
    box-shadow: 0 12px 25px rgb(61 207 255 / 40%);
}

.modal-body-custom .plans__buy.is-locked {
    background: none;
    border-color: #e0e0e0;
    border-radius: 50px;
    box-shadow: none;
}

/* اسکرول نرم در مودال */
.modal-body-custom::-webkit-scrollbar {
    width: 8px;
}

.modal-body-custom::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-body-custom::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        margin: 0rem auto;
        border-radius: 0;
        max-height: 100vh;
    }

    .modal-body-custom {
        padding: 1.5rem;
    }

    .modal-body-custom .plans__card {
        padding: 0.8rem 1.5rem;
    }
}

    .user-profile-card {
    background: linear-gradient(135deg, #2ebcea 0%, #0b4152 100%);
    border-radius: 20px;
    padding: 20px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.user-profile-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.profile-avatar i {
    font-size: 40px;
    color: white;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
    color: white;
}

.profile-phone {
    font-size: 0.9rem;
    opacity: 0.9;
    direction: ltr;
    display: inline-block;
}

.profile-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.profile-action-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    color: white;
}

.profile-action-btn.logout-profile-btn:hover {
    background: rgba(255, 87, 87, 0.5);
    border-color: #ff5757;
}

.profile-plan-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 50px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.profile-plan-badge i {
    color: #ffd700;
}

/* نسخه موبایل */
@media (max-width: 768px) {
    .user-profile-card {
        padding: 15px;
    }

    .profile-avatar {
        width: 50px;
        height: 50px;
    }

    .profile-avatar i {
        font-size: 30px;
    }

    .profile-name {
        font-size: 1rem;
    }

    .profile-actions {
        flex-direction: row-reverse;
    }

    .profile-action-btn {
        padding: 8px;
    }
}

    
