@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

#simple-ai-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: 'Inter', sans-serif;
}

#simple-ai-chat-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
}

#simple-ai-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

#simple-ai-chat-toggle svg {
    width: 30px;
    height: 30px;
}

#simple-ai-chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#simple-ai-chat-container.hidden {
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
}

#simple-ai-chat-header {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    padding: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#simple-ai-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

#simple-ai-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#simple-ai-chat-close:hover {
    opacity: 1;
}

#simple-ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 4px;
}

.chat-message-wrapper.user {
    align-items: flex-end;
}

.chat-message-wrapper.assistant {
    align-items: flex-start;
}

.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
    word-break: break-word;
}

.chat-message.user {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.chat-copy-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    padding: 0 4px;
}

.chat-message-wrapper:hover .chat-copy-btn {
    opacity: 1;
}

.chat-copy-btn:hover {
    color: #4b5563;
}

.chat-message.assistant a {
    color: #e0e7ff;
    text-decoration: underline;
}

.chat-message.loading {
    background: transparent;
    color: #6b7280;
    align-self: flex-start;
    font-style: italic;
    box-shadow: none;
    padding: 0;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #6b7280;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

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

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

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

#simple-ai-chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #f3f4f6;
    display: flex;
    gap: 10px;
}

#simple-ai-chat-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Inter', sans-serif;
}

#simple-ai-chat-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#simple-ai-chat-send {
    background: #6366f1;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

#simple-ai-chat-send:hover {
    background: #4f46e5;
    transform: scale(1.05);
}

#simple-ai-chat-send svg {
    width: 18px;
    height: 18px;
}
