/* ==========================================
   ParsChat - Isolated & Conflict-Free Styles
   ========================================== */

:root {
    --parschat-theme-color: #0672e6;
    --parschat-theme-color-dark: #044A86;
    --parschat-chat-width: clamp(400px, 26vw, 420px);
    --parschat-chat-height: clamp(600px, 72vh, 680px);
    --parschat-font-family: 'Vazir', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --parschat-border-radius: 18px;
    --parschat-box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --parschat-transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --parschat-animation-duration: 0.35s;
    --parschat-gradient: linear-gradient(135deg, var(--parschat-theme-color) 0%, var(--parschat-theme-color-dark) 100%);
    --parschat-glass-bg: rgba(255, 255, 255, 0.95);
    --parschat-glass-border: rgba(255, 255, 255, 0.18);
    --parschat-z-index-base: 999999;
}

/* Reset کامل برای جلوگیری از تداخل با قالب */
.parschat-icon,
.parschat-icon *,
.parschat-container,
.parschat-container *,
.parschat-welcome-popup,
.parschat-welcome-popup * {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    box-sizing: border-box;
    text-decoration: none;
    list-style: none;
    background: transparent;
    color: inherit;
}

.parschat-icon,
.parschat-container {
    display: none;
}

/* Chat Icon - با z-index قابل تنظیم */
.parschat-icon {
    position: fixed;
    z-index: var(--parschat-z-index-base);
    cursor: pointer;
    transition: var(--parschat-transition);
    transform: scale(1) translateZ(0);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* موقعیت‌های مختلف آیکون */
.parschat-icon[style*="bottom-right"] {
    bottom: 20px;
    right: 20px;
}

.parschat-icon[style*="bottom-left"] {
    bottom: 20px;
    left: 20px;
}

.parschat-icon[style*="top-right"] {
    top: 20px;
    right: 20px;
}

.parschat-icon[style*="top-left"] {
    top: 20px;
    left: 20px;
}

.parschat-icon:hover {
    transform: scale(1.08) translateY(-2px);
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.2));
}

.parschat-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--parschat-theme-color);
    animation: iconPulse 2s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

.parschat-icon.no-animation::before {
    animation: none;
    display: none;
}

.parschat-icon img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: var(--parschat-transition);
    border: none !important;
    outline: none !important;
    display: block;
    max-width: none !important;
    height: auto;
    position: relative;
    z-index: 1;
}

@keyframes iconPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0;
    }
}

.parschat-welcome-popup {
    position: absolute;
    bottom: 120%;
    background: white;
    padding: 9px 14px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    font-size: 12px;
    color: #374151;
    font-family: var(--parschat-font-family);
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
    text-align: right;
    max-width: 160px;
    white-space: normal;
    word-wrap: break-word;
    z-index: calc(var(--parschat-z-index-base) + 1);
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.05);
    line-height: 1.4;
}

/* برای آیکون در سمت راست صفحه */
.parschat-icon[style*="right"] .parschat-welcome-popup {
    left: -140px;
    margin-left: 20px;
}

/* برای آیکون در سمت چپ صفحه */
.parschat-icon[style*="left"] .parschat-welcome-popup {
    right: -140px;
    margin-right: 20px;
}


.parschat-welcome-popup span {
    display: inline-block;
    margin-left: 5px;
    /* فاصله بین کلمات */
}

/* استایل آیکون و پاپ‌آپ خوش‌آمدگویی هنگام کلیک */
.parschat-icon.hide-welcome .parschat-welcome-popup {
    opacity: 0;
    visibility: hidden;
}

/* Chat Container - با ایزوله‌سازی کامل */
.parschat-container {
    position: fixed;
    width: var(--parschat-chat-width);
    height: var(--parschat-chat-height);
    background: var(--parschat-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--parschat-border-radius);
    border: 1px solid var(--parschat-glass-border);
    box-shadow: var(--parschat-box-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: var(--parschat-z-index-base);
    transform: translateY(100%) scale(0.95) translateZ(0);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--parschat-transition), opacity var(--parschat-transition);
    font-family: var(--parschat-font-family);
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    direction: rtl;
    text-align: right;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* موقعیت‌های مختلف کانتینر چت بات */
.parschat-container[style*="bottom-right"] {
    bottom: 20px;
    right: 20px;
}

.parschat-container[style*="bottom-left"] {
    bottom: 20px;
    left: 20px;
}

.parschat-container[style*="top-right"] {
    top: 20px;
    right: 20px;
}

.parschat-container[style*="top-left"] {
    top: 20px;
    left: 20px;
}


.parschat-header .header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.parschat-container .parschat-header .parschat-new-chat,
.parschat-container .parschat-header .parschat-close {
    all: unset;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    cursor: pointer;
    color: white;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    flex-shrink: 0;
}

.parschat-container .parschat-header .parschat-new-chat:hover,
.parschat-container .parschat-header .parschat-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.parschat-container .parschat-header .parschat-new-chat svg {
    width: 17px;
    height: 17px;
    stroke: white;
    fill: none;
    stroke-width: 2;
    display: block;
    margin: 0 auto;
    margin-top: 1px;
    transform: translateX(2px);
}

.parschat-container .parschat-header .parschat-close svg {
    width: 18px;
    height: 18px;
    stroke: white;
    fill: none;
    stroke-width: 2;
    display: block;
    margin: 0 auto;
}

.parschat-container.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Chat Header */
.parschat-container .parschat-header {
    background: var(--parschat-gradient);
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    border-top-left-radius: var(--parschat-border-radius);
    border-top-right-radius: var(--parschat-border-radius);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    flex-shrink: 0;
}

.parschat-container .parschat-header .header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.parschat-container .parschat-header .header-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    margin-right: 10px;
}

/* استایل عنوان چت */
.parschat-container .parschat-header h3 {
    margin: 0;
    font-size: 15px;
    color: white;
    font-weight: 600;
    font-family: var(--parschat-font-family);
    line-height: 1.3;
    letter-spacing: -0.3px;
}

/* استایل توضیحات چت */
.parschat-container .parschat-header small {
    display: block;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
    margin-top: 3px;
    font-family: var(--parschat-font-family);
    font-weight: 400;
}

/* حالت‌هایی که توضیحات خالی است */
.parschat-container .parschat-header small:empty {
    display: none;
}

/* تنظیم موقعیت آواتار ربات و عنوان در حالت‌هایی که توضیحات خالی است */
.parschat-container .parschat-header .header-text:has(small:empty) {
    justify-content: center;
    align-items: center;
}

/* استایل آواتار ربات و نشانگر وضعیت */
.parschat-container .bot-avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-top: 0;
    flex-shrink: 0;
}

/* استایل آیکون هدر */
.parschat-container .bot-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: none;
}

.parschat-container .bot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--parschat-theme-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.parschat-container .status-indicator {
    position: absolute;
    top: 23px;
    left: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 2.5px solid white;
    z-index: 1;
    box-sizing: border-box;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
        transform: scale(1.1);
    }
}


/* Chat Messages Area */
.parschat-container .parschat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
    background-image: url(../images/bg-chat.png);
    background-repeat: repeat;
    background-size: auto;
    background-position: center;
    -webkit-overflow-scrolling: touch;
}

.parschat-container .parschat-messages::-webkit-scrollbar {
    width: 5px;
}

.parschat-container .parschat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.parschat-container .parschat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
}

.parschat-container .parschat-messages::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.18);
}

/* Messages */
.parschat-container .message {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.55;
    word-wrap: break-word;
    word-break: break-word;
    position: relative;
    animation: fadeIn var(--parschat-animation-duration) cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    white-space: pre-wrap;
    font-family: var(--parschat-font-family);
}

.parschat-container .user-message,
.parschat-container .bot-message {
    white-space: pre-wrap;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* پیام کاربر (سمت راست) */
.parschat-container .user-message {
    background: var(--parschat-gradient);
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border-top-right-radius: 14px;
    border-top-left-radius: 14px;
    border-bottom-right-radius: 14px;
    box-shadow: 0 2px 8px rgba(6, 114, 230, 0.25);
    margin-right: auto;
    margin-left: 0;
    width: fit-content;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
}

/* پیام هوش مصنوعی (سمت چپ) */
.parschat-container .bot-message {
    background: #f5f7fa;
    color: #1f2937;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    border-bottom-left-radius: 14px;
    box-shadow: 0 1px 3px #00000029;
    margin-left: auto;
    margin-right: 36px;
    width: fit-content;
    display: inline-block;
    position: relative;
    white-space: normal;
    margin-top: 10px;
}



.parschat-container .bot-emoji {
    position: absolute;
    bottom: 0px;
    right: -36px;
    font-size: 14px;
    z-index: 1;
    background: var(--parschat-gradient);
    color: white;
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(6, 114, 230, 0.2);
    width: 28px;
    height: 28px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.parschat-container .bot-emoji svg {
    width: 32px;
    height: 32px;
    fill: white;
}


/* استایل زمان ارسال پیام و آیکون کپی */
.message-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    justify-content: flex-start;
    margin-right: 36px;
    position: relative;
}

/* زمان ارسال پیام */
.message-timestamp {
    font-size: 9.5px;
    color: #9ca3af;
    font-weight: 400;
    display: flex;
    align-items: center;
}

.user-message-timestamp {
    display: block;
    font-size: 9.5px;
    color: #9ca3af;
    position: absolute;
    left: 0;
    margin-left: 12px;
    margin-top: 12px;
    text-align: left;
    font-weight: 400;
}

.user-message .message-footer {
    justify-content: flex-start;
    margin-left: 0;
    margin-right: 0;
    margin-top: 12px;
}

.bot-message .message-timestamp {
    display: flex;
    align-items: center;
    font-size: 10px;
    color: #9ca3af;
    font-weight: 400;
}

/* آیکون کپی */
.like-button,
.dislike-button,
.copy-icon {
    width: 12px;
    height: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.like-button:hover,
.dislike-button:hover,
.copy-icon:hover {
    transform: scale(1.15);
    opacity: 1;
}

.like-button svg,
.dislike-button svg,
.copy-icon svg {
    width: 100%;
    height: 100%;
    fill: #9ca3af;
    transition: fill 0.2s ease;
}

.like-button:hover svg,
.dislike-button:hover svg,
.copy-icon:hover svg {
    fill: #6b7280;
}

.like-button.active svg {
    fill: #10b981;
}

.dislike-button.active svg {
    fill: #ef4444;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding: 10px;
    background: #f0f2f5;
    border-radius: 12px;
    width: fit-content;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-left: auto;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: var(--parschat-theme-color);
    border-radius: 50%;
    animation: typing 1.2s infinite;
    transform: scale(0.8);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
    background: #f5f7fa;
    border-radius: 14px;
    width: fit-content;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-left: auto;
    margin-right: 36px;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    background-color: var(--parschat-theme-color);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: scale(0.7);
        opacity: 0.4;
    }

    50% {
        transform: scale(1);
        opacity: 1;
    }
}

/* استایل برای streaming content */
.streaming-content {
    display: inline-block;
    white-space: normal;
    word-wrap: break-word;
    animation: fadeIn 0.2s ease;
}

/* استایل لینک‌های پیام - مینیمال و ساده */
.message-link {
    color: var(--parschat-theme-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(6, 114, 230, 0.3);
    transition: all 0.2s ease;
    word-break: break-word;
}

.message-link:hover {
    color: var(--parschat-theme-color-dark);
    border-bottom-color: var(--parschat-theme-color);
    opacity: 0.8;
}

/* Input Area */
.parschat-container .parschat-input {
    border-top: 1px solid #f3f4f6;
    padding: 14px 16px;
    background: #fff;
    border-bottom-left-radius: var(--parschat-border-radius);
    border-bottom-right-radius: var(--parschat-border-radius);
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.03);
    position: relative;
    pointer-events: auto;
    z-index: 1;
    flex-shrink: 0;
}

/* استایل سوالات متداول */
.parschat-faq {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background-image: url(../images/bg-chat.png);
    background-repeat: repeat;
    background-size: auto;
    background-position: center;
    border-bottom: 1px solid #f3f4f6;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.parschat-faq::-webkit-scrollbar {
    height: 4px;
}

.parschat-faq::-webkit-scrollbar-track {
    background: transparent;
}

.parschat-faq::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
}

.parschat-faq::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.18);
}

.faq-item {
    background: #fff;
    color: #374151;
    padding: 7px 13px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    flex: 0 0 auto;
    font-weight: 500;
}

.faq-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    border-color: var(--parschat-theme-color);
    color: var(--parschat-theme-color);
}


.input-container {
    display: flex;
    align-items: center;
    width: 85%;
    position: relative;
}

.input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.emoji-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 1;
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.emoji-icon:hover {
    opacity: 1;
}

.emoji-icon svg {
    width: 17px;
    height: 17px;
    stroke: #9ca3af;
    transition: all 0.2s ease;
}

.emoji-icon:hover svg {
    stroke: var(--parschat-theme-color);
    transform: scale(1.1);
}

#parschat-message-input {
    padding-left: 40px;
    /* فضای کافی برای آیکون در سمت چپ */
    width: 100%;
    box-sizing: border-box;
}

.emoji-picker {
    position: absolute;
    bottom: 52px;
    left: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.emoji-picker .emoji {
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s ease;
    opacity: 0.8;
}

.emoji-picker .emoji:hover {
    transform: scale(1.15);
    opacity: 1;
}

#parschat-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.parschat-container #parschat-message-input {
    flex: 1;
    min-height: 42px;
    max-height: 110px;
    padding: 11px 12px 11px 38px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    resize: none;
    font-family: var(--parschat-font-family);
    font-size: 13px;
    line-height: 1.5;
    transition: all 0.2s ease;
    background: #fafafa;
    overflow-y: hidden;
    width: 100%;
    pointer-events: auto;
    user-select: text;
    color: #1f2937;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.parschat-container #parschat-message-input:focus {
    border-color: var(--parschat-theme-color);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(6, 114, 230, 0.08);
}

.parschat-container #parschat-message-input::placeholder {
    color: #9ca3af;
}

.parschat-container #parschat-form button[type="submit"] {
    width: 42px;
    height: 42px;
    background: var(--parschat-gradient);
    color: white;
    border: none;
    border-radius: 11px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(6, 114, 230, 0.25);
    flex-shrink: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.parschat-container #parschat-form button[type="submit"]:hover {
    box-shadow: 0 3px 12px rgba(6, 114, 230, 0.45);
    filter: brightness(1.05);
}

.parschat-container #parschat-form button[type="submit"]:active {
    box-shadow: 0 2px 6px rgba(6, 114, 230, 0.3);
    transform: scale(0.98);
}

.parschat-container #parschat-form button[type="submit"] svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.parschat-container #parschat-form button[type="submit"]:hover svg {
    transform: translateX(-1.5px);
}


/* استایل فرم لید جنریشن - نسخه مینیمال */
.parschat-lead-form-container {
    padding: 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Vazir', sans-serif;
    direction: rtl;
    background-image: url(../images/bg-chat.png);
    background-repeat: repeat;
    background-size: auto;
    background-position: center;
}

.parschat-lead-form-container .lead-form-wrapper {
    width: 100%;
    max-width: 290px;
    padding: 22px 20px 16px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f3f4f6;
}

.parschat-lead-form-container .lead-form-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    margin: 0 0 18px 0;
    letter-spacing: -0.2px;
    line-height: 1.4;
}

/* ریست استایل‌های عمومی برای ورودی‌ها */
.parschat-lead-form-container .lead-field input[type="text"],
.parschat-lead-form-container .lead-field input[type="email"],
.parschat-lead-form-container .lead-field input[type="tel"] {
    all: unset;
    box-sizing: border-box;
}

/* استایل فیلدهای ورودی */
.parschat-lead-form-container .lead-field {
    margin-bottom: 13px;
}

.parschat-lead-form-container .lead-field label {
    font-size: 11.5px;
    color: #374151;
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
}

.parschat-lead-form-container .lead-field label .required {
    color: #ef4444;
}

.parschat-lead-form-container .lead-field input[type="text"],
.parschat-lead-form-container .lead-field input[type="email"],
.parschat-lead-form-container .lead-field input[type="tel"] {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12.5px;
    font-family: 'Vazir', sans-serif;
    background: #fafafa;
    color: #1f2937;
    transition: all 0.2s ease;
    text-align: right;
}

.parschat-lead-form-container .lead-field input[type="text"]:focus,
.parschat-lead-form-container .lead-field input[type="email"]:focus,
.parschat-lead-form-container .lead-field input[type="tel"]:focus {
    border-color: var(--parschat-theme-color);
    box-shadow: 0 0 0 3px rgba(6, 114, 230, 0.08);
    background: #fff;
    outline: none;
}

.parschat-lead-form-container .lead-field input[type="text"]::placeholder,
.parschat-lead-form-container .lead-field input[type="email"]::placeholder,
.parschat-lead-form-container .lead-field input[type="tel"]::placeholder {
    color: #9ca3af;
}

/* استایل دکمه ثبت */
.parschat-lead-form-container #parschat-lead-form button.lead-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px;
    background: var(--parschat-gradient);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-family: 'Vazir', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(6, 114, 230, 0.25);
    margin-top: 4px;
}

.parschat-lead-form-container #parschat-lead-form button.lead-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 114, 230, 0.35);
}

.parschat-lead-form-container #parschat-lead-form button.lead-submit-btn:active {
    transform: translateY(0);
}

/* پیام بعد از ارسال */
.parschat-lead-form-container .lead-form-message {
    font-size: 11px;
    text-align: center;
    margin-top: 10px;
    color: #10b981;
    min-height: 18px;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease;
    font-weight: 500;
}

.parschat-lead-form-container .lead-form-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* تنظیمات ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    .parschat-lead-form-container {
        padding: 20px;
    }

    .parschat-lead-form-container .lead-form-wrapper {
        max-width: 280px;
        padding: 20px 18px 14px;
    }

    .parschat-lead-form-container .lead-form-title {
        font-size: 13.5px;
        margin-bottom: 16px;
    }

    .parschat-lead-form-container .lead-field {
        margin-bottom: 12px;
    }

    .parschat-lead-form-container .lead-field label {
        font-size: 11px;
    }

    .parschat-lead-form-container .lead-field input[type="text"],
    .parschat-lead-form-container .lead-field input[type="email"],
    .parschat-lead-form-container .lead-field input[type="tel"] {
        font-size: 12px;
        padding: 8px 11px;
    }

    .parschat-lead-form-container #parschat-lead-form button.lead-submit-btn {
        font-size: 12.5px;
        padding: 10px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .parschat-container {
        width: clamp(320px, 92vw, 400px) !important;
        height: clamp(75vh, 85vh, 600px) !important;
        bottom: 8px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) translateY(100%) scale(0.95) !important;
    }

    .parschat-container.open {
        transform: translateX(-50%) translateY(0) scale(1) !important;
    }

    .parschat-header {
        padding: 12px 16px;
    }

    .parschat-header h3 {
        font-size: 14px;
    }

    .parschat-header small {
        font-size: 10px;
    }

    .parschat-messages {
        padding: 14px 12px;
        gap: 14px;
    }

    .message {
        font-size: 12.5px;
        padding: 9px 12px;
    }

    .parschat-icon::before {
        width: 50px;
        height: 50px;
    }
    
    .parschat-icon img {
        width: 50px;
        height: 50px;
    }

    .parschat-input {
        padding: 12px 14px;
    }

    #parschat-message-input {
        font-size: 12.5px;
        min-height: 40px;
    }

    #parschat-form button[type="submit"] {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 380px) {
    .parschat-container {
        width: 96% !important;
        height: 88vh !important;
    }

    .parschat-messages {
        padding: 12px 10px;
    }

    .message {
        max-width: 82%;
    }
}

@media (max-width: 768px) {
    .bot-emoji {
        width: 26px;
        height: 26px;
        font-size: 13px;
        padding: 3px;
        right: -32px;
        box-sizing: border-box;
    }

    .bot-emoji svg {
        width: 28px;
        height: 28px;
    }

    .bot-message {
        margin-right: 32px;
    }

    .message-footer {
        margin-right: 32px;
    }

    .parschat-header .parschat-new-chat,
    .parschat-header .parschat-close {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .parschat-header .parschat-new-chat svg {
        width: 15px;
        height: 15px;
    }

    .parschat-header .parschat-close svg {
        width: 16px;
        height: 16px;
    }

    .bot-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .status-indicator {
        width: 9px;
        height: 9px;
        top: 20px;
    }
}

/* استایل‌های مربوط به نمایش در موبایل */
@media (max-width: 768px) {

    .parschat-icon.mobile-disabled,
    .parschat-container.mobile-disabled {
        display: none !important;
    }

    .parschat-icon[style*="bottom-right"] {
        bottom: 16px !important;
        right: 16px !important;
    }

    .parschat-icon[style*="bottom-left"] {
        bottom: 16px !important;
        left: 16px !important;
    }

    .parschat-icon[style*="top-right"] {
        top: 16px !important;
        right: 16px !important;
    }

    .parschat-icon[style*="top-left"] {
        top: 16px !important;
        left: 16px !important;
    }
}