@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap');

:root {
    --primary-color: #007bff;
    --assistant-bg: #f1f3f5;
    --user-bg: #e9f5ff;
    --text-color: #212529;
    --bg-color: #ffffff;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#chat-container {
    width: 100%;
    max-width: 700px;
    height: 90vh;
    max-height: 800px;
    background-color: var(--bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

h2 {
    font-size: 1.2rem;
    font-weight: 500;
    padding: 20px;
    margin: 0;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
}

#chat-window {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.5;
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    background-color: var(--user-bg);
    color: var(--text-color);
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.message.assistant {
    background-color: var(--assistant-bg);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

#chat-form {
    display: flex;
    padding: 15px;
    border-top: 1px solid #e9ecef;
}

#chat-input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 20px;
    font-size: 1rem;
    margin-right: 10px;
}
#chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

button {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 20px;
    font-size: 1rem;
    transition: background-color 0.2s;
}
button:hover {
    background-color: #0056b3;
}
button:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

/* --- NEU: Schreib-Animation --- */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 18px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #9db2bf;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1.0);
    }
}
