/* چت ویجت استایل - نسخه نهایی با کلاس والد amitis */
@font-face {
    font-family: 'Yekan';
    src: url('https://chatbot.ameetis.ir/static/fonts/Yekan.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* کلاس والد برای جلوگیری از تداخل */
.amitis {
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    direction: rtl;
    text-align: right;
}

.amitis .chat-widget { 
    position: fixed; 
    bottom: 40px; 
    left: 15px; 
    z-index: 1000; 
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; 
}

/* دکمه چت ویجت - طراحی مدرن */
.amitis .chat-widget-button {
    width: 50px;
    height: 50px;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 0;
}

.amitis .chat-widget-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: none;
}

.amitis .chat-widget-button i {
    color: white;
    font-size: 20px;
    transition: all 0.3s ease;
}

.amitis .chat-widget-button-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    transition: all 0.3s ease;
    display: block;
}

/* کادر چت ویجت - طراحی مدرن */
.amitis .chat-widget-container { 
    position: fixed; 
    bottom: 90px; 
    left: 20px; 
    width: 380px; 
    height: 600px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 32px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideInModern 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.08);
    max-height: 600px;
    max-width: calc(100vw - 40px); /* جلوگیری از overflow افقی */
    box-sizing: border-box;
}

.amitis .chat-widget-container.active {
    display: flex;
}

@keyframes slideInModern {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* هدر چت ویجت - طراحی مدرن */
.amitis .chat-widget-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 24px 24px 0 0;
    position: relative;
    overflow: hidden;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.amitis .chat-widget-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.amitis .chat-widget-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.amitis .chat-widget-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* بدنه چت ویجت - طراحی مدرن */
.amitis .chat-widget-body {
    flex: 1;
    padding: 20px;
    padding-bottom: 120px; /* فضای اضافی برای سوالات پیشنهادی */
    overflow-y: auto;
    background: #fafafa;
    direction: rtl;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
    max-height: 350px;
    min-height: 200px;
    height: 350px;
    margin-bottom: 0; /* حذف margin-bottom */
}

/* پیام‌های چت ویجت - طراحی مدرن */
.amitis .chat-widget-message {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.amitis .chat-widget-message.user {
    flex-direction: column;
    align-items: flex-end;
}

.amitis .chat-widget-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.amitis .chat-widget-avatar.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.amitis .chat-widget-avatar.bot {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: #667eea;
    overflow: hidden;
    border: 2px solid #bae6fd;
}

.amitis .chat-widget-avatar.bot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.amitis .chat-widget-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.amitis .chat-widget-bubble.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

.amitis .chat-widget-bubble.bot {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.amitis .chat-widget-bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* دکمه‌های تعاملی - طراحی مدرن */
.amitis .chat-widget-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.amitis .chat-widget-message:hover .chat-widget-actions {
    opacity: 1;
}

.amitis .chat-widget-actions.user-actions {
    justify-content: flex-end;
}

.amitis .chat-widget-message.user .chat-widget-actions {
    justify-content: flex-end;
}

.amitis .chat-widget-icon-btn {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #6b7280;
    padding: 6px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.amitis .chat-widget-icon-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
    color: #374151;
    transform: translateY(-1px);
}

.amitis .chat-widget-icon-btn.active.like {
    color: #10b981;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.amitis .chat-widget-icon-btn.active.dislike {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.amitis .chat-widget-icon-btn i {
    font-size: 14px;
}

.amitis .chat-widget-icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* فرم ورودی - طراحی مدرن */
.amitis .chat-widget-input {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    flex-shrink: 0;
    min-height: 80px;
    z-index: 10;
}

.amitis .chat-widget-actions-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: space-between;
    align-items: center;
}

.amitis .chat-widget-clear-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.8;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.amitis .chat-widget-clear-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    opacity: 1;
    transform: translateY(-1px);
}

.amitis .chat-widget-form {
    display: flex;
    align-items: flex-end;
    position: relative;
}

.amitis .chat-widget-textarea {
    width: 100%;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    resize: none;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    max-height: 120px;
    direction: rtl;
    background: #f9fafb;
    color: #000000;
    box-sizing: border-box;
}

.amitis .chat-widget-textarea:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.amitis .chat-widget-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    font-size: 12px;
    font-weight: 600;
    gap: 4px;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.amitis .chat-widget-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.amitis .chat-widget-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}


.amitis .chat-widget-welcome {
    text-align: center;
    color: #6b7280;
    font-size: 12px;
    margin: 10px 0;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.amitis .chat-widget-welcome i {
    font-size: 16px;
    color: #667eea;
    display: inline-block;
    animation: welcomeIcon 2s ease-in-out infinite;
}

@keyframes welcomeIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* انیمیشن تایپینگ - طراحی مدرن */
.amitis .typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: white;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    width: fit-content;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.amitis .typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typingModern 1.4s infinite ease-in-out;
}

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

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

@keyframes typingModern {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-12px);
        opacity: 1;
    }
}

/* استایل‌های سوالات پیشنهادی - طراحی زیبا */
.amitis .suggested-questions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 20px; /* فاصله اضافی در پایین */
    padding: 0;
    position: relative;
    z-index: 1;
}

.amitis .suggestion-chip {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    word-wrap: break-word;
    line-height: 1.5;
    margin-bottom: 0;
    max-width: 100%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.amitis .suggestion-chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.amitis .suggestion-chip:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.amitis .suggestion-chip:active {
    transform: translateY(-1px) scale(1.01);
    background: linear-gradient(135deg, #553c9a 0%, #5a67d8 100%);
}

.amitis .suggestion-chip i {
    font-size: 18px;
    color: white;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.amitis .suggestion-chip span {
    position: relative;
    z-index: 1;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* New wrapper for avatar and bubble */
.amitis .chat-widget-message-body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.amitis .chat-widget-message.user .chat-widget-message-body {
    flex-direction: row-reverse;
}

.amitis .chat-widget-message.bot .chat-widget-message-body {
    flex-direction: row;
}

/* دکمه‌های انتخاب نوع در ویجت */
.amitis .chat-widget-mode-buttons {
    display: flex;
    gap: 8px;
    padding: 15px 20px 10px;
    border-bottom: 1px solid #e5e7eb;
}

.amitis .chat-widget-mode-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.amitis .chat-widget-mode-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.amitis .chat-widget-mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.amitis .chat-widget-mode-btn i {
    font-size: 16px;
}

/* محتوای ویجت */
.amitis .chat-widget-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
 /*   max-height: 350px;
    min-height: 200px;
    height: 350px;
    margin-bottom: 0;  حذف margin-bottom */
}

.amitis .chat-widget-salnameh-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    padding-bottom: 100px; /* فضای اضافی برای اسکرول */
    overflow-y: auto;
    min-height: 0;
    max-height: 350px;
    height: 350px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.amitis .chat-widget-salnameh-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 350px;
    min-height: 200px;
    height: 350px;
    padding-bottom: 80px; /* فضای اضافی برای اسکرول */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.amitis .salnameh-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: start;
}

.amitis .salnameh-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 60px;
}

.amitis .salnameh-form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    margin-bottom: 2px;
    height: 16px;
    display: flex;
    align-items: center;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.amitis .salnameh-form-control {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: white;
    transition: all 0.2s ease;
    outline: none;
    height: 36px;
    width: 100%;
    box-sizing: border-box;
}

.amitis .salnameh-form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.amitis .salnameh-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    height: 40px;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.amitis .salnameh-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.amitis .salnameh-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.amitis .salnameh-next-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
    height: 32px;
    width: 100%;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.amitis .salnameh-next-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.amitis .salnameh-result {
    margin-top: 8px;
    padding: 8px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    max-height: 150px;
    overflow-y: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 20; /* افزایش بیشتر z-index */
    display: block !important; /* اطمینان از نمایش */
    visibility: visible !important; /* اطمینان از نمایش */
    opacity: 1 !important; /* اطمینان از شفافیت */
}

/* کلاس اضافی برای اطمینان از نمایش */
.amitis .salnameh-result-visible {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 20 !important;
}

.amitis .salnameh-prompt {
    background: white;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    border-right: 3px solid #667eea;
    font-size: 11px;
    line-height: 1.3;
    word-wrap: break-word;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.amitis .salnameh-answer {
    background: white;
    padding: 6px 10px;
    border-radius: 6px;
    border-right: 3px solid #f5576c;
    font-size: 11px;
    line-height: 1.3;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ریسپانسیو - iPhone SE و موبایل‌های کوچک (زیر 400px) */
@media (max-width: 400px) {
    /* دکمه چت در iPhone SE */
    .amitis .chat-widget {
        bottom: 10px;
        left: 10px;
    }
    
    .amitis .chat-widget-button {
        width: 44px;
        height: 44px;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    
    .amitis .chat-widget-button i {
        font-size: 14px;
    }
    
    .amitis .chat-widget-button-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    /* کادر چت در iPhone SE */
    .amitis .chat-widget-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        max-height: 100vh;
        z-index: 9999;
        animation: slideInMobile 0.3s ease-out;
    }
    
    /* هدر در iPhone SE */
    .amitis .chat-widget-header {
        border-radius: 0;
        padding: 10px 12px;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .amitis .chat-widget-header h3 {
        font-size: 13px;
    }
    
    /* بدنه چت در iPhone SE */
    .amitis .chat-widget-body {
        flex: 1;
        padding: 10px;
        padding-bottom: 100px; /* کاهش فضای پایین برای iPhone SE */
        margin-bottom: 0;
        max-height: calc(100vh - 180px); /* برگشت به کد ریسپانسیو */
        min-height: 150px;
        height: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    /* پیام‌ها در iPhone SE */
    .amitis .chat-widget-bubble {
        max-width: 360px; /* تغییر به 360px */
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .amitis .chat-widget-avatar {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    /* سوالات پیشنهادی در iPhone SE */
    .amitis .suggested-questions {
        gap: 6px;
        margin-top: 10px;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }
    
    .amitis .suggestion-chip {
        padding: 8px 12px;
        font-size: 10px;
        border-radius: 14px;
    }
    
    /* فرم ورودی در iPhone SE */
    .amitis .chat-widget-input {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px;
        padding-bottom: max(15px, env(safe-area-inset-bottom));
        background: white;
        border-top: 1px solid #e5e7eb;
        z-index: 10000;
        margin-bottom: 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .amitis .chat-widget-textarea {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .amitis .chat-widget-actions-row {
        margin-top: 12px;
    }
    
    .amitis .chat-widget-send {
        padding: 5px 10px;
        font-size: 10px;
    }
    
    /* فرم سالنامه در iPhone SE */
    .amitis .chat-widget-salnameh-form {
        max-height: calc(100vh - 180px); /* برگشت به کد ریسپانسیو */
        min-height: 150px;
        height: auto;
        padding: 6px;
        padding-bottom: 100px;
        padding-top: 15px;
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        position: relative;
        z-index: 1;
    }
    
    .amitis .chat-widget-salnameh-body {
        max-height: none;
        min-height: auto;
        height: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .amitis .salnameh-form-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .amitis .salnameh-form-group {
        min-height: 40px;
    }
    
    .amitis .salnameh-form-control {
        height: 32px;
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .amitis .salnameh-submit-btn {
        height: 36px;
        font-size: 12px;
        margin-top: 6px;
    }
    
    .amitis .salnameh-next-btn {
        height: 28px;
        font-size: 11px;
    }
    
    /* نتیجه سالنامه در iPhone SE */
    .amitis .salnameh-result {
        max-height: 120px;
        margin-top: 8px;
        margin-bottom: 8px;
        padding: 6px;
        position: relative;
        z-index: 20;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #f9fafb;
        border-radius: 6px;
        border: 1px solid #e5e7eb;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* دکمه‌های انتخاب نوع در iPhone SE */
    .amitis .chat-widget-mode-buttons {
        padding: 8px 10px 4px;
        gap: 3px;
    }
    
    .amitis .chat-widget-mode-btn {
        padding: 5px 8px;
        font-size: 10px;
        gap: 3px;
    }
    
    .amitis .chat-widget-mode-btn i {
        font-size: 10px;
    }
}

/* ریسپانسیو - موبایل کوچک (400px تا 576px) */
@media (min-width: 401px) and (max-width: 576px) {
    /* دکمه چت در موبایل کوچک */
    .amitis .chat-widget {
        bottom: 15px;
        left: 15px;
    }
    
    .amitis .chat-widget-button {
        width: 48px;
        height: 48px;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    
    .amitis .chat-widget-button i {
        font-size: 16px;
    }
    
    .amitis .chat-widget-button-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    /* کادر چت در موبایل کوچک */
    .amitis .chat-widget-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        max-height: 100vh;
        z-index: 9999;
        animation: slideInMobile 0.3s ease-out;
    }
    
    /* هدر در موبایل کوچک */
    .amitis .chat-widget-header {
        border-radius: 0;
        padding: 12px 15px;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .amitis .chat-widget-header h3 {
        font-size: 14px;
    }
    
    /* بدنه چت در موبایل کوچک */
    .amitis .chat-widget-body {
        flex: 1;
        padding: 12px;
        padding-bottom: 120px; /* افزایش فضای پایین برای کادر ورودی فیکس */
        margin-bottom: 0;
        max-height: calc(100vh - 200px); /* کاهش محدودیت ارتفاع */
        min-height: 200px;
        height: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    /* پیام‌ها در موبایل کوچک */
    .amitis .chat-widget-bubble {
        max-width: 90%;
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .amitis .chat-widget-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    /* سوالات پیشنهادی در موبایل کوچک */
    .amitis .suggested-questions {
        gap: 8px;
        margin-top: 12px;
        margin-bottom: 20px; /* افزایش فاصله پایین */
        padding-bottom: 10px; /* فضای اضافی */
    }
    
    .amitis .suggestion-chip {
        padding: 10px 14px;
        font-size: 11px;
        border-radius: 16px;
    }
    
    /* فرم ورودی در موبایل کوچک */
    .amitis .chat-widget-input {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px;
        padding-bottom: max(20px, env(safe-area-inset-bottom)); /* پشتیبانی از safe area */
        background: white;
        border-top: 1px solid #e5e7eb;
        z-index: 10000;
        margin-bottom: 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .amitis .chat-widget-textarea {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .amitis .chat-widget-actions-row {
        margin-top: 16px; /* افزایش فاصله دکمه‌ها */
    }
    
    .amitis .chat-widget-send {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    /* فرم سالنامه در موبایل کوچک */
    .amitis .chat-widget-salnameh-form {
        max-height: calc(100vh - 200px); /* افزایش ارتفاع برای نمایش پاسخ */
        min-height: 200px;
        height: auto;
        padding: 8px;
        padding-bottom: 120px; /* افزایش فضای پایین برای کادر ورودی فیکس */
        padding-top: 20px; /* فضای اضافی در بالا */
        -webkit-overflow-scrolling: touch;
        overflow-y: auto; /* تغییر به auto برای اسکرول */
        position: relative;
        z-index: 1; /* کاهش z-index برای نمایش پاسخ */
    }
    
    .amitis .chat-widget-salnameh-body {
        max-height: none;
        min-height: auto;
        height: auto;
        /*padding-bottom: 50px;*/
        -webkit-overflow-scrolling: touch;
    }
    
    .amitis .salnameh-form-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .amitis .salnameh-form-group {
        min-height: 45px;
    }
    
    .amitis .salnameh-form-control {
        height: 36px;
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .amitis .salnameh-submit-btn {
        height: 40px;
        font-size: 13px;
        margin-top: 8px;
    }
    
    .amitis .salnameh-next-btn {
        height: 32px;
        font-size: 12px;
    }
    
    /* نتیجه سالنامه در موبایل کوچک */
    .amitis .salnameh-result {
        max-height: 150px; /* افزایش ارتفاع برای نمایش بهتر */
        margin-top: 10px; /* افزایش فاصله بالا */
        margin-bottom: 10px; /* اضافه کردن فاصله پایین */
        padding: 8px; /* افزایش padding */
        position: relative;
        z-index: 20; /* افزایش بیشتر z-index */
        overflow-y: auto; /* اسکرول برای محتوای طولانی */
        -webkit-overflow-scrolling: touch;
        background: #f9fafb; /* اضافه کردن پس‌زمینه */
        border-radius: 8px; /* اضافه کردن border-radius */
        border: 1px solid #e5e7eb; /* اضافه کردن border */
        display: block !important; /* اطمینان از نمایش */
        visibility: visible !important; /* اطمینان از نمایش */
        opacity: 1 !important; /* اطمینان از شفافیت */
        width: 100%; /* اطمینان از عرض کامل */
        box-sizing: border-box; /* اطمینان از محاسبه صحیح اندازه */
    }
    
    /* دکمه‌های انتخاب نوع در موبایل کوچک */
    .amitis .chat-widget-mode-buttons {
        padding: 10px 12px 6px;
        gap: 4px;
    }
    
    .amitis .chat-widget-mode-btn {
        padding: 6px 10px;
        font-size: 11px;
        gap: 4px;
    }
    
    .amitis .chat-widget-mode-btn i {
        font-size: 12px;
    }
}

/* ریسپانسیو - موبایل متوسط (576px تا 768px) */
@media (min-width: 577px) and (max-width: 768px) {
    /* دکمه چت در موبایل متوسط */
    .amitis .chat-widget {
        bottom: 20px;
        left: 20px;
    }
    
    .amitis .chat-widget-button {
        width: 50px;
        height: 50px;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    
    .amitis .chat-widget-button i {
        font-size: 18px;
    }
    
    .amitis .chat-widget-button-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    /* کادر چت در موبایل متوسط */
    .amitis .chat-widget-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        max-height: 100vh;
        z-index: 9999;
        animation: slideInMobile 0.3s ease-out;
    }
    
    /* هدر در موبایل متوسط */
    .amitis .chat-widget-header {
        border-radius: 0;
        padding: 15px 20px;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .amitis .chat-widget-header h3 {
        font-size: 16px;
    }
    
    /* بدنه چت در موبایل متوسط */
    .amitis .chat-widget-body {
        flex: 1;
        padding: 15px;
        padding-bottom: 120px; /* افزایش فضای پایین برای کادر ورودی فیکس */
        margin-bottom: 0;
        max-height: calc(100vh - 200px); /* ارتفاع محدود برای اسکرول */
        min-height: 200px;
        height: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    /* پیام‌ها در موبایل متوسط */
    .amitis .chat-widget-bubble {
        max-width: 85%;
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .amitis .chat-widget-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    /* سوالات پیشنهادی در موبایل متوسط */
    .amitis .suggested-questions {
        gap: 10px;
        margin-top: 15px;
        margin-bottom: 15px;
    }
    
    .amitis .suggestion-chip {
        padding: 12px 16px;
        font-size: 12px;
        border-radius: 18px;
    }
    
    /* فرم ورودی در موبایل متوسط */
    .amitis .chat-widget-input {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 15px;
        padding-bottom: max(20px, env(safe-area-inset-bottom)); /* پشتیبانی از safe area */
        background: white;
        border-top: 1px solid #e5e7eb;
        z-index: 10000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    /* فرم سالنامه در موبایل متوسط */
    .amitis .chat-widget-salnameh-form {
        max-height: calc(100vh - 200px); /* افزایش ارتفاع برای نمایش پاسخ */
        min-height: 200px;
        height: auto;
        padding: 10px;
        padding-bottom: 120px; /* افزایش فضای پایین برای کادر ورودی فیکس */
        padding-top: 20px; /* فضای اضافی در بالا */
        -webkit-overflow-scrolling: touch;
        overflow-y: auto; /* تغییر به auto برای اسکرول */
        position: relative;
        z-index: 1; /* کاهش z-index برای نمایش پاسخ */
    }
    
    .amitis .chat-widget-salnameh-body {
        max-height: none;
        min-height: auto;
        height: auto;
        padding-bottom: 60px;
        -webkit-overflow-scrolling: touch;
    }
    
    .amitis .salnameh-form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .amitis .salnameh-form-group {
        min-height: 50px;
    }
    
    .amitis .salnameh-form-control {
        height: 40px;
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .amitis .salnameh-submit-btn {
        height: 44px;
        font-size: 14px;
        margin-top: 10px;
    }
    
    .amitis .salnameh-next-btn {
        height: 36px;
        font-size: 13px;
    }
    
    /* نتیجه سالنامه در موبایل متوسط */
    .amitis .salnameh-result {
        max-height: 150px; /* افزایش ارتفاع برای نمایش بهتر */
        margin-top: 10px; /* افزایش فاصله بالا */
        margin-bottom: 10px; /* اضافه کردن فاصله پایین */
        padding: 8px;
        position: relative;
        z-index: 20; /* افزایش بیشتر z-index */
        overflow-y: auto; /* اسکرول برای محتوای طولانی */
        -webkit-overflow-scrolling: touch;
        background: #f9fafb; /* اضافه کردن پس‌زمینه */
        border-radius: 8px; /* اضافه کردن border-radius */
        border: 1px solid #e5e7eb; /* اضافه کردن border */
        display: block !important; /* اطمینان از نمایش */
        visibility: visible !important; /* اطمینان از نمایش */
        opacity: 1 !important; /* اطمینان از شفافیت */
        width: 100%; /* اطمینان از عرض کامل */
        box-sizing: border-box; /* اطمینان از محاسبه صحیح اندازه */
    }
    
    /* دکمه‌های انتخاب نوع در موبایل متوسط */
    .amitis .chat-widget-mode-buttons {
        padding: 12px 15px 8px;
        gap: 6px;
    }
    
    .amitis .chat-widget-mode-btn {
        padding: 8px 12px;
        font-size: 12px;
        gap: 6px;
    }
    
    .amitis .chat-widget-mode-btn i {
        font-size: 14px;
    }
}

/* انیمیشن اسلاید موبایل */
@keyframes slideInMobile {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تبلت */
@media (min-width: 769px) and (max-width: 1024px) {
    .amitis .chat-widget-container {
        width: 350px;
        height: 500px;
        position: fixed;
        bottom: 90px;
        left: 20px;
        border-radius: 24px;
        max-height: 500px;
    }
    
    .amitis .chat-widget-button {
        width: 52px;
        height: 52px;
    }
    
    .amitis .chat-widget-body {
        max-height: 350px;
        min-height: 200px;
        height: 350px;
        padding-bottom: 100px;
    }
    
    .amitis .chat-widget-input {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 20px;
        background: white;
        border-top: 1px solid #e5e7eb;
        z-index: 10;
    }
}

/* دسکتاپ کوچک */
@media (min-width: 1025px) and (max-width: 1200px) {
    .amitis .chat-widget-container {
        width: 360px;
        height: 550px;
        position: fixed;
        bottom: 90px;
        left: 20px;
        border-radius: 24px;
        max-height: 550px;
    }
    
    .amitis .chat-widget-body {
        max-height: 400px;
        min-height: 200px;
        height: 400px;
        padding-bottom: 100px;
    }
    
    .amitis .chat-widget-input {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 20px;
        background: white;
        border-top: 1px solid #e5e7eb;
        z-index: 10;
    }
}

/* دسکتاپ بزرگ */
@media (min-width: 1201px) {
    .amitis .chat-widget-container {
        width: 380px;
        height: 600px;
        position: fixed;
        bottom: 90px;
        left: 20px;
        border-radius: 24px;
        max-height: 600px;
    }
    
    .amitis .chat-widget-body {
        max-height: 450px;
        min-height: 200px;
        height: 450px;
        padding-bottom: 100px;
    }
    
    .amitis .chat-widget-input {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 20px;
        background: white;
        border-top: 1px solid #e5e7eb;
        z-index: 10;
    }
}