/* AI Chat Widget */
#ai-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#ai-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: transform 0.2s;
}

#ai-chat-button:hover {
    transform: scale(1.05);
}

#ai-chat-window {
    display: none;
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: #1e1e24;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: #15151a;
    padding: 15px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    color: white;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-model-select {
    background: #2a2a2e;
    color: white;
    border: 1px solid #444;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.msg-user {
    background: #6366f1;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.msg-ai {
    background: #2a2a2e;
    color: #e0e0e0;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.msg-image-preview {
    max-width: 100%;
    border-radius: 4px;
    margin-bottom: 5px;
}

.chat-input-area {
    padding: 15px;
    background: #15151a;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
}

#chat-upload-btn {
    color: #888;
    cursor: pointer;
    font-size: 20px;
    transition: color 0.2s;
}

#chat-upload-btn:hover {
    color: #6366f1;
}

#chat-input {
    flex: 1;
    background: #2a2a2e;
    border: 1px solid #444;
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

#chat-send-btn {
    background: #6366f1;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-preview-container {
    display: none;
    position: absolute;
    bottom: 60px;
    left: 15px;
    background: #2a2a2e;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #444;
}

#chat-preview-img {
    height: 50px;
    border-radius: 4px;
}

#chat-preview-close {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Typing indicator */
.typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
    margin: 0 2px;
}
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
