.chat-container {
    height: 537px;
    max-height: 537px;
}
.typing-indicator {
    animation: pulse 1.5s infinite;
}
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999999999;
    transition: all 0.3s ease;
}
.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #9333ea);
}
.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}
.chat-popup {
    position: absolute;
    width: 468px;
    height: 88vh;
    bottom: 0;
    right: 0;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;

}
.chat-popup.show {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}
.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    animation: bounce 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    font-weight: bold;
}
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}
@media (max-width: 480px) {
    .chat-popup {
        width: calc(100vw - 12px);
        height: 99vh;
        bottom: -10px;
        right: -10px;
    }
    .chat-widget {
        right: 15px;
        bottom: 15px;
    }
    .chat-container {
        height: 537px;
        max-height: 495px;
    }
}
/* Scrollbar Styling */
.chat-container::-webkit-scrollbar {
    width: 4px;
}
.chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.chat-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}
.chat-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}


/* استایل برای پیام‌ها */
.message {
    margin-bottom: 15px;
    position: relative;
}

.message-content {
    background: #f5f5f5;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
}

.user-message .message-content {
    background: #007bff;
    color: white;
    margin-left: auto;
}

.bot-message .message-content {
    background: #e9ecef;
    color: #333;
}

/* استایل برای زمان پیام */
.message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
    text-align: left;
}

.bot-message .message-time {
    color: rgba(0, 0, 0, 0.5);
}

/* استایل برای learning insight */
.learning-insight {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-style: italic;
}

.bot-message .learning-insight {
    background: rgba(0, 0, 0, 0.05);
}

/* استایل برای جداکننده پیام‌های قبلی */
.chat-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.chat-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
    z-index: 1;
}

.divider-text {
    display: inline-block;
    background: white;
    padding: 5px 15px;
    color: #666;
    font-size: 12px;
    border-radius: 12px;
    border: 1px solid #ddd;
    position: relative;
    z-index: 2;
}

/* استایل برای دکمه پاک کردن تاریخچه */
.clear-history-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.clear-history-btn:hover {
    background: #c82333;
}

/* انیمیشن برای پیام‌های جدید */
.message.new-message {
    animation: slideIn 0.3s ease-out;
}

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

/* استایل برای حالت موبایل */
@media (max-width: 768px) {
    .message-content {
        max-width: 90%;
    }

    .divider-text {
        font-size: 11px;
        padding: 4px 10px;
    }
}