.ai-assistant-container {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 9999;
    font-family: 'Vazirmatn', sans-serif;
}

.ai-assistant-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6ECDA6 0%, #00A69B 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 166, 155, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    position: relative;
    overflow: hidden;
}

.ai-assistant-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 166, 155, 0.4);
}

.ai-assistant-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-assistant-btn:hover::before {
    opacity: 1;
}

.ai-assistant-btn i {
    font-size: 24px;
    color: white;
    transition: transform 0.3s ease;
}

.ai-assistant-btn:hover i {
    transform: scale(1.1);
}

/* Pulse animation for attention */
.ai-assistant-btn.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 8px 25px rgba(0, 166, 155, 0.3);
    }
    50% {
        box-shadow: 0 8px 25px rgba(0, 166, 155, 0.6), 0 0 0 10px rgba(110, 205, 166, 0.1);
    }
    100% {
        box-shadow: 0 8px 25px rgba(0, 166, 155, 0.3);
    }
}

/* Chat Window */
.ai-chat-window {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #e5e7eb;
}

.ai-chat-window.active {
    display: flex;
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Chat Header */
.ai-chat-header {
    background: linear-gradient(135deg, #6ECDA6 0%, #00A69B 100%);
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.ai-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.ai-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
    color: white;
}

.ai-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Chat Messages Area */
.ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #fafafa;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 10px;
    animation: messageSlideIn 0.3s ease-out;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, #6ECDA6 0%, #00A69B 100%);
    color: white;
}

.message.user .message-avatar {
    background: #f1f5f9;
    color: #64748b;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.message.ai .message-content {
    background: white;
    color: #374151;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f3f4f6;
}

.message.user .message-content {
    background: linear-gradient(135deg, #6ECDA6 0%, #00A69B 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    max-width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f3f4f6;
}

.typing-indicator.active {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
.ai-chat-input {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.ai-input-container {
    display: flex;
    gap: 10px;
    align-items: end;
}

.ai-input-wrapper {
    flex: 1;
    position: relative;
}

.ai-input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 25px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    min-height: 44px;
    transition: border-color 0.3s ease;
    font-family: inherit;
    outline: none;
    background: #f9fafb;
}

.ai-input:focus {
    border-color: #00A69B;
    background: white;
}

.ai-input::placeholder {
    color: #9ca3af;
}

.ai-send-btn {
    position: absolute;
    left: 8px;
    bottom: 8px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6ECDA6 0%, #00A69B 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.ai-send-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.ai-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

.welcome-message h4 {
    margin: 0 0 8px 0;
    color: #374151;
    font-size: 16px;
}

.welcome-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.quick-action {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b7280;
}

.quick-action:hover {
    background: linear-gradient(135deg, #6ECDA6 0%, #00A69B 100%);
    color: white;
    border-color: #00A69B;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .ai-chat-window {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 90px;
        height: 450px;
    }

    .ai-assistant-container {
        right: 20px;
        bottom: 20px;
    }

    .ai-assistant-btn {
        width: 55px;
        height: 55px;
    }

    .ai-assistant-btn i {
        font-size: 22px;
    }
}

/* Animation for initial appearance */
.ai-assistant-container.animate-in {
    animation: slideInFromRight 0.6s ease-out;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Permanent label */
.ai-assistant-label {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 14px;
    white-space: nowrap;
    font-family: 'Vazirmatn', sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 1;
    visibility: visible;
    transition: all 0.5s ease;
    animation: labelPulse 3s ease-in-out;
}

.ai-assistant-label.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateX(20px);
}

.ai-assistant-label::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #1f2937;
}

@keyframes labelPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}