/* Main Chat App Container */
#n8n-ai-chat-app {
    font-family: 'Syne', "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 600px;
    margin: 20px auto;
    border: 3px solid #ffffff;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Messages Area */
#n8n-ai-chat-messages {
    padding: 20px 20px 10px;
    height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

/* Individual Message Bubbles */
.n8n-chat-message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
    animation: n8n-fade-in 0.4s ease-out;
}

.n8n-chat-message.user-message {
    background-color: #000;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.n8n-chat-message.ai-message {
    background-color: #fff;
    color: #1f2937;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.n8n-chat-message.ai-typing {
    color: #6b7280;
    font-style: italic;
    align-self: flex-start;
    background: transparent;
    padding-left: 0;
}

.n8n-chat-message.ai-typing .dot-flashing {
    position: relative;
    width: 6px; height: 6px;
    border-radius: 5px;
    background-color: #9880ff;
    color: #9880ff;
    animation: dot-flashing 1s infinite linear alternate;
    animation-delay: .5s;
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
}
.n8n-chat-message.ai-typing .dot-flashing::before, 
.n8n-chat-message.ai-typing .dot-flashing::after {
    content: '';
    display: inline-block;
    position: absolute;
    top: 0;
    width: 6px; height: 6px;
    border-radius: 5px;
    background-color: #9880ff;
    color: #9880ff;
}
.n8n-chat-message.ai-typing .dot-flashing::before {
    left: -12px;
    animation: dot-flashing 1s infinite alternate;
    animation-delay: 0s;
}
.n8n-chat-message.ai-typing .dot-flashing::after {
    left: 12px;
    animation: dot-flashing 1s infinite alternate;
    animation-delay: 1s;
}

/* Input Form Area */
#n8n-ai-chat-form {
    display: flex;
    padding: 15px;
    gap: 10px;
    border-top: 3px solid #ffffff;

}

#n8n-ai-chat-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #fff;
    border-radius: 20px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#n8n-ai-chat-input:focus {
    outline: none;
    border-color: #000;
}

#n8n-ai-chat-submit {
    font-family: 'Syne';
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background-color: #000;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#n8n-ai-chat-submit:hover {
    background-color: #005a87;
    transform: scale(1.05);
}

#n8n-ai-chat-submit:disabled {
    background-color: #a0a5aa;
    cursor: not-allowed;
    transform: none;
}
#n8n-ai-chat-submit:disabled svg {
    opacity: 0.7;
}

/* Warning Message */
#n8n-ai-chat-warning {
    margin: 15px 25px 25px;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ff8f95;
    color: #850404;
    border-radius: 50px;
    text-align: center;
    font-size: 14px;
}

/* Animations */
@keyframes n8n-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes dot-flashing {
    0% { background-color: #9880ff; }
    50%, 100% { background-color: rgba(152, 128, 255, 0.2); }
}