/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* Chat Container */
.ai-chat-bedrock-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Chat Header */
.ai-chat-bedrock-header {
    background-color: #232f3e;
    color: white;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
}

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

/* Messages Container */
.ai-chat-bedrock-messages {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
}

/* Individual Message */
.ai-chat-bedrock-message {
    display: flex;
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* User Message */
.user-message {
    flex-direction: row-reverse;
}

.ai-chat-bedrock-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.user-message .ai-chat-bedrock-avatar {
    margin-right: 0;
    margin-left: 10px;
    background-color: #232f3e;
    color: white;
}

.ai-message .ai-chat-bedrock-avatar {
    background-color: #ff9900;
    color: white;
}

.ai-chat-bedrock-message-content {
    background-color: white;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    line-height: 1.5;
}

.user-message .ai-chat-bedrock-message-content {
    background-color: #232f3e;
    color: white;
}

.ai-message .ai-chat-bedrock-message-content {
    background-color: white;
}

/* Typing Indicator */
.ai-chat-bedrock-typing {
    display: flex;
    padding: 10px 15px;
}

.ai-chat-bedrock-typing-indicator {
    display: flex;
    align-items: center;
}

.ai-chat-bedrock-typing-dot {
    width: 8px;
    height: 8px;
    background-color: #bbb;
    border-radius: 50%;
    margin-right: 4px;
    animation: typingAnimation 1.5s infinite ease-in-out;
}

.ai-chat-bedrock-typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.ai-chat-bedrock-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-chat-bedrock-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
    margin-right: 0;
}

@keyframes typingAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* Input Area */
.ai-chat-bedrock-input {
    border-top: 1px solid #ddd;
    padding: 10px;
    background-color: white;
}

.ai-chat-bedrock-form {
    display: flex;
    flex-direction: column;
}

.ai-chat-bedrock-textarea {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
}

.ai-chat-bedrock-textarea:focus {
    outline: none;
    border-color: #ff9900;
    box-shadow: 0 0 0 1px #ff9900;
}

.ai-chat-bedrock-buttons {
    display: flex;
    justify-content: space-between;
}

.ai-chat-bedrock-submit {
    background-color: #ff9900 !important;
    border-color: #ff9900 !important;
}

.ai-chat-bedrock-submit:hover {
    background-color: #e88a00 !important;
    border-color: #e88a00 !important;
}

.ai-chat-bedrock-clear {
    color: #555 !important;
}

/* Footer */
.ai-chat-bedrock-footer {
    padding: 5px 10px;
    text-align: center;
    font-size: 12px;
    color: #777;
    border-top: 1px solid #eee;
    background-color: #f9f9f9;
}

/* Error Message */
.ai-chat-bedrock-error {
    background-color: #fff0f0;
    border-left: 4px solid #ff5252;
    padding: 10px 15px;
    margin-bottom: 15px;
    color: #d32f2f;
    border-radius: 4px;
}

/* Code Blocks in Messages */
.ai-chat-bedrock-message-content pre {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
    font-family: monospace;
    border: 1px solid #ddd;
}

.ai-chat-bedrock-message-content code {
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 600px) {
    .ai-chat-bedrock-message-content {
        max-width: 90%;
    }
}
/* Tool usage styling */
.ai-chat-bedrock-tool-indicator {
    margin-top: 10px;
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 0.9em;
}

.ai-chat-bedrock-tool-name {
    font-weight: bold;
    color: #555;
}

.ai-chat-bedrock-tool-loading {
    margin-top: 5px;
    display: flex;
    justify-content: center;
}

.ai-chat-bedrock-tool-result {
    margin-top: 5px;
}

.ai-chat-bedrock-tool-success {
    color: #28a745;
}

.ai-chat-bedrock-tool-error {
    color: #dc3545;
}
