/* Floating-Button unten rechts */
.chat-toggle-button {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
    z-index: 9999;
}

/* Chat-Fenster */
.chat-widget {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: clamp(450px, 30vw, 520px);
    max-width: calc(100vw - 32px);
    height: clamp(550px, 65vh, 820px);
    max-height: calc(100vh - 120px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    background: #fff;
    display: none;
    /* per default versteckt */
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
}

.chat-widget.open {
    display: flex;
}

.chat-header {
    padding: 10px 12px;
    background: #111827;
    color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-title {
    font-size: 14px;
    font-weight: 600;
}

.chat-header-subtitle {
    font-size: 11px;
    color: #9ca3af;
}

.chat-header-close {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 10px;
    background: #f3f4f6;
    overflow-y: auto;
    font-size: 14px;
}

.message-row {
    display: flex;
    margin-bottom: 6px;
}

.message-row.user {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 90%;
    padding: 8px 10px;
    border-radius: 12px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-bubble pre {
    overflow: auto;
    padding: 8px;
    border-radius: 8px;
    background: #f6f8fa;
}

.message-row.bot .message-bubble {
    background: #e5e7eb;
    border-bottom-left-radius: 4px;
}

.message-row.user .message-bubble {
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-footer {
    border-top: 1px solid #e5e7eb;
    padding: 8px;
    background: #fff;
    display: flex;
    gap: 6px;
}

.chat-input {
    flex: 1;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    outline: none;
}

.chat-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.chat-send-btn {
    border: none;
    padding: 0 14px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.chat-send-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.chat-status {
    font-size: 11px;
    color: #6b7280;
    padding: 4px 8px 8px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.typing-indicator {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
    padding-left: 4px;
}
