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

.chat-container {
    max-width: 350px;
    width: 100%;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    height: 500px;
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: bottom right;
    transform: scale(1);
    opacity: 1;
}

.chat-container.hidden {
    transform: scale(0);
    opacity: 0;
}

.chat-button-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.chat-bubble {
    background-color: #5682a3;
    color: white;
    padding: 3px 15px;
    border-radius: 18px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    font-size: 12px;
    font-weight: 500;
    max-width: 200px;
    animation: bounce 2s infinite;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-bubble:after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #5682a3;
}

.chat-bubble.hidden {
    opacity: 0;
    transform: translateY(-10px);
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.chat-toggle-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #5682a3;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border: none;
    outline: none;
    transition: background-color 0.2s ease, transform 0.3s ease;
    padding: 0;
}

.chat-toggle-button:hover {
    background-color: #4a739b;
    transform: scale(1.05);
}

.chat-container .chat-header {
    background-color: #5682a3; /* Telegram-Blau */
    color: white;
    padding: 12px 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.chat-container .chat-header-buttons {
    display: flex;
    gap: 8px;
}

.chat-container .chat-header span::before {
    content: '🤖';
    font-size: 24px;
    margin-right: 10px;
}

.chat-container #clear-chat,
.chat-container #close-chat {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.chat-container #clear-chat:hover,
.chat-container #close-chat:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-container .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: #e7ebf0; /* Telegram-Hintergrundfarbe */
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH4AkEEjIZty4/XAAAACpJREFUaN7t0jERACAMwMC4/5LpQQYuQE9U0xZ6LgAAAAAAAAAAAP6VV+UBdyEEVlX72BYAAAAASUVORK5CYII=');
    background-size: 50px;
}

.chat-container .message {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 16px;
    max-width: 80%;
    word-wrap: break-word;
    overflow-x: auto;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    font-size: 13px;
}

.chat-container .user-message {
    background-color: #effdde; /* Telegram-Grün für Benutzer */
    margin-left: auto;
    border-top-right-radius: 0;
}

.chat-container .bot-message {
    background-color: #fff; /* Telegram-Weiß für Bot */
    white-space: pre-wrap;
    border-top-left-radius: 0;
}

.chat-container .bot-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 8px;
}

.chat-container .chat-input {
    display: flex;
    padding: 8px 12px;
    background-color: #fff;
    border-top: 1px solid #e5e5e5;
}

.chat-container #user-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d4d4d4;
    border-radius: 18px;
    margin-right: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    outline: none;
}

.chat-container #user-input:focus {
    border-color: #5682a3; /* Telegram-Blau */
}
.chat-container #send-button {
    background-color: #5682a3; /* Telegram-Blau */
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.chat-container #send-button:hover {
    background-color: #4a739b;
}

.chat-container #send-button::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>');
    background-size: contain;
}

.chat-container .bot-link {
    color: #5682a3; /* Telegram-Blau */
    text-decoration: none;
    font-weight: 500;
}

.chat-container .feedback-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
    gap: 8px;
}

.chat-container .feedback-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    color: #a0aec0;
}

.chat-container .feedback-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #5682a3;
}

.chat-container .feedback-button.active {
    color: #5682a3;
}

/* Animierte Punkte für Ladeindikator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    margin: 0 2px;
    background-color: #5682a3;
    border-radius: 50%;
    display: inline-block;
    opacity: 0.7;
}

.typing-indicator span:nth-child(1) {
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation: typing 1.4s infinite ease-in-out 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation: typing 1.4s infinite ease-in-out 0.4s;
}

@keyframes typing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}
