body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #f0f0f0;
    padding: 1rem;
    text-align: center;
}

#logo {
    max-width: 200px;
    width: 200%;
    height: auto;
    margin-bottom: 0.5rem;
}

main {
    flex-grow: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

#controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

select {
    padding: 0.5rem;
    font-size: 1rem;
}


#chatContainer {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#chatHistory {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

#loadingIndicator {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid #ccc;
}

#inputContainer {
    display: flex;
    padding: 1rem;
    border-top: 1px solid #ccc;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#userInput {
    flex-grow: 1;
    padding: 0.5rem;
    font-size: 1rem;
    resize: none;
}

#sendButton {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    margin-left: 0.5rem;
}

#downloads {
    margin-top: 1rem;
}

#downloadLinks {
    list-style-type: none;
    padding: 0;
}

#downloadLinks li {
    margin-bottom: 0.5rem;
}

.message {
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 5px;
}

.user-message {
    background-color: #e6f2ff;
    align-self: flex-end;
}

.llm-message {
    background-color: #f0f0f0;
    align-self: flex-start;
}

.message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.message-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.message-content {
    background-color: #f0f0f0;
    padding: 0.5rem;
    border-radius: 5px;
    max-width: 80%;
    white-space: pre-wrap;  /* This preserves newlines and allows wrapping */
    word-break: break-word; /* This ensures long words don't overflow */
}

.user-message .message-content {
    background-color: #e6f2ff;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-icon {
    margin-right: 0;
    margin-left: 0.5rem;
}