* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.chat-container {
    width: 90%;
    max-width: 600px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-header {
    background-color: #4a90e2;
    color: white;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.api-key-section {
    display: flex;
    gap: 10px;
}

.api-key-section input {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
}

.api-key-section button {
    padding: 8px 15px;
    background-color: white;
    color: #4a90e2;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.chat-body {
    height: 400px;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 10px;
    border-radius: 10px;
}

.user-message {
    align-self: flex-end;
    background-color: #e1f5fe;
}

.bot-message {
    align-self: flex-start;
    background-color: #f1f1f1;
}

.message-content {
    word-wrap: break-word;
}

.chat-footer {
    display: flex;
    padding: 15px;
    border-top: 1px solid #eee;
}

.chat-footer input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.chat-footer button {
    padding: 10px 20px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.chat-footer button:hover {
    background-color: #357abd;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}