/* ChatSBC 3.0 – sbc Corporate Design */

.chatsbc {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 720px;
    margin: 0 auto;
    color: #333;
}

/* Header */
.chatsbc-header {
    text-align: center;
    margin-bottom: 24px;
}

.chatsbc-title {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 2px;
    color: #7D7D7D;
    margin: 0 0 12px 0;
}

.chatsbc-subtitle {
    font-size: 15px;
    line-height: 1.6;
    color: #7D7D7D;
    margin: 0;
}

.chatsbc-subtitle strong {
    color: #333;
}

/* Nachrichten-Bereich */
.chatsbc-messages {
    padding: 8px 0;
}

.chatsbc-messages:empty {
    display: none;
}

/* Einzelne Nachricht */
.chatsbc-msg {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: chatsbc-fadein 0.25s ease;
}

@keyframes chatsbc-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* User-Nachricht (rechts) */
.chatsbc-msg.user {
    flex-direction: row-reverse;
}

.chatsbc-msg.user .chatsbc-bubble {
    background: #A0C51C;
    color: #fff;
    border-radius: 16px 16px 4px 16px;
    max-width: 75%;
}

/* KI-Nachricht (links) */
.chatsbc-msg.assistant .chatsbc-bubble {
    background: #f4f4f5;
    color: #333;
    border-radius: 16px 16px 16px 4px;
    max-width: 85%;
}

.chatsbc-bubble {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.65;
    word-break: break-word;
}

/* Markdown-Inhalte in der Bubble */
.chatsbc-bubble p {
    margin: 0 0 8px 0;
}

.chatsbc-bubble p:last-child {
    margin-bottom: 0;
}

.chatsbc-bubble ul,
.chatsbc-bubble ol {
    margin: 4px 0 8px 0;
    padding-left: 20px;
}

.chatsbc-bubble li {
    margin-bottom: 4px;
}

.chatsbc-bubble strong {
    font-weight: 600;
}

.chatsbc-bubble a {
    color: #A0C51C;
    text-decoration: underline;
}

.chatsbc-msg.user .chatsbc-bubble a {
    color: #fff;
}

/* Avatar-Icons */
.chatsbc-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    margin-top: 2px;
}

.chatsbc-msg.user .chatsbc-avatar {
    background: #E74890;
    color: #fff;
}

.chatsbc-msg.assistant .chatsbc-avatar {
    background: #7D7D7D;
    color: #fff;
}

/* Typing-Indikator */
.chatsbc-typing {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
}

.chatsbc-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #999;
    animation: chatsbc-bounce 1.2s infinite;
}

.chatsbc-typing span:nth-child(2) { animation-delay: 0.15s; }
.chatsbc-typing span:nth-child(3) { animation-delay: 0.3s; }

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

/* Eingabebereich */
.chatsbc-input-area {
    margin-top: 12px;
}

.chatsbc-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 6px 8px 6px 16px;
    background: #fff;
    transition: border-color 0.2s;
}

.chatsbc-input-wrapper:focus-within {
    border-color: #A0C51C;
}

.chatsbc-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    max-height: 120px;
    padding: 4px 0;
    background: transparent;
    color: #333;
}

.chatsbc-input::placeholder {
    color: #aaa;
}

.chatsbc-send {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #A0C51C;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, opacity 0.2s;
}

.chatsbc-send:hover:not(:disabled) {
    background: #8aab14;
}

.chatsbc-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Disclaimer */
.chatsbc-disclaimer {
    text-align: center;
    font-size: 11px;
    color: #aaa;
    margin: 8px 0 0 0;
    font-style: italic;
}

/* Error */
.chatsbc-error {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca;
}

/* Responsive */
@media (max-width: 600px) {
    .chatsbc {
        padding: 0 8px;
    }

    .chatsbc-title {
        font-size: 22px;
    }

    .chatsbc-msg.user .chatsbc-bubble,
    .chatsbc-msg.assistant .chatsbc-bubble {
        max-width: 88%;
    }

    .chatsbc-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}
