/* Main styles for Bombay Chat */
body {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f0f0f0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

h1 {
    color: #333;
    text-align: center;
    margin: 20px 0;
    flex-shrink: 0;
}

.chat-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 0;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f5f5f5;
}

.message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    background-color: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease-in;
}

.user-message {
    background-color: #e3f2fd;
    margin-left: 20%;
    text-align: right;
}

.assistant-message {
    background-color: #f5f5f5;
    margin-right: 20%;
}

.user-message strong,
.assistant-message strong {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 0.9em;
}

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

.chat-input {
    display: flex;
    padding: 20px;
    border-top: 1px solid #ddd;
    background-color: white;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-right: 10px;
    font-size: 14px;
}

.chat-input button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.chat-input button:hover {
    background-color: #0056b3;
}

/* Thinking dots inside message bubble */
.thinking-dots {
    display: inline-flex;
    gap: 4px;
    margin-left: 10px;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.thinking-message {
    opacity: 0.8;
}

/* Disable input during request */
.htmx-request .chat-input button {
    opacity: 0.6;
    cursor: wait;
}

.htmx-request .chat-input input {
    opacity: 0.6;
    pointer-events: none;
}

/* MCP Form Styles */
/* Wrapper for form message bubble */
.mcp-form-wrapper {
    max-width: 80%;
    margin-right: 20%;
    animation: fadeIn 0.3s ease-in;
}

.mcp-form-container {
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
    max-width: 100%;
}

.mcp-form-container h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #333;
    font-size: 1em;
    font-weight: 600;
}

.mcp-form-container form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mcp-form-container .form-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mcp-form-container label {
    font-weight: 500;
    color: #555;
    font-size: 12px;
}

.mcp-form-container input[type="text"],
.mcp-form-container input[type="number"],
.mcp-form-container textarea,
.mcp-form-container select {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background-color: white;
}

.mcp-form-container textarea {
    resize: vertical;
    min-height: 40px;
    max-height: 80px;
}

.mcp-form-container input[type="checkbox"] {
    margin-right: 5px;
}

.mcp-form-container button[type="submit"] {
    padding: 8px 16px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    align-self: flex-start;
    transition: background-color 0.2s;
}

.mcp-form-container button[type="submit"]:hover {
    background-color: #218838;
}

.mcp-form-container button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #6c757d;
}

/* Success state styles */
.mcp-success-container {
    padding: 15px;
    background-color: #d4edda;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
    animation: fadeIn 0.3s ease-in;
}

.mcp-success-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #155724;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mcp-success-container .success-icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
    background-color: #28a745;
    color: white;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.mcp-success-container .item-details {
    margin: 12px 0;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    font-size: 13px;
}

.mcp-success-container .item-details div {
    margin: 4px 0;
    color: #495057;
}

.mcp-success-container .item-details strong {
    color: #212529;
    font-weight: 600;
}

.mcp-success-container button {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.mcp-success-container button:hover {
    background-color: #0056b3;
}

#form-result {
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    font-size: 13px;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 8px;
    border-radius: 4px;
    font-size: 13px;
}