/* BonusKI Mistral Chat-Widget Styles */

/* Spracheingabe (Mikrofon) */
.bonuski-chat__mic {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--bki-text);
    padding: 6px;
    display: flex;
    align-items: center;
    border-radius: 8px;
}
.bonuski-chat__mic:hover { background: var(--bki-surface); }
.bonuski-chat__mic.is-recording {
    color: #ffffff;
    background: #d92d20;
    animation: bonuski-pulse 1s infinite;
}
@keyframes bonuski-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* KI-Hinweis (AI Act Art. 50) + Datenschutz-Link */
.bonuski-chat__disclaimer {
    padding: 6px 12px 10px;
    font-size: 11px;
    line-height: 1.4;
    color: #6b7280;
    text-align: center;
    border-top: 1px solid var(--bki-surface);
}
.bonuski-chat__disclaimer a {
    color: var(--bki-primary);
    text-decoration: underline;
    margin-left: 4px;
}

.bonuski-chat {
    --bki-primary: #0b6bcb;
    --bki-bg: #ffffff;
    --bki-text: #1a1a1a;
    --bki-surface: #f2f4f7;
    --bki-radius: 14px;
    --bki-shadow: 0 8px 32px rgba(0,0,0,0.12);
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--bki-text);
}

.bonuski-chat__launcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--bki-primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--bki-shadow);
    transition: transform 0.15s, box-shadow 0.15s;
}
.bonuski-chat__launcher:hover { transform: translateY(-1px); box-shadow: 0 12px 36px rgba(0,0,0,0.16); }
.bonuski-chat__launcher:active { transform: translateY(0); }

.bonuski-chat__window {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: min(380px, calc(100vw - 48px));
    height: min(560px, calc(100vh - 48px));
    background: var(--bki-bg);
    border-radius: var(--bki-radius);
    box-shadow: var(--bki-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.bonuski-chat__window[hidden] { display: none; }

.bonuski-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bki-primary);
    color: #fff;
}
.bonuski-chat__title { font-weight: 600; font-size: 15px; }
.bonuski-chat__close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.bonuski-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bki-surface);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bonuski-chat__msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.bonuski-chat__msg--user {
    align-self: flex-end;
    background: var(--bki-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.bonuski-chat__msg--bot {
    align-self: flex-start;
    background: #fff;
    color: var(--bki-text);
    border: 1px solid #e4e7ec;
    border-bottom-left-radius: 4px;
}

.bonuski-chat__typing { display: inline-flex; gap: 4px; }
.bonuski-chat__typing span {
    width: 7px; height: 7px;
    background: #aab1bd;
    border-radius: 50%;
    display: inline-block;
    animation: bki-blink 1.2s infinite;
}
.bonuski-chat__typing span:nth-child(2) { animation-delay: 0.2s; }
.bonuski-chat__typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bki-blink { 0%,60%,100% { opacity: 0.3; } 30% { opacity: 1; } }

.bonuski-chat__form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e4e7ec;
    background: var(--bki-bg);
}
.bonuski-chat__input {
    flex: 1;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    color: inherit;
    resize: none;
    max-height: 120px;
    outline: none;
}
.bonuski-chat__input:focus { border-color: var(--bki-primary); }

.bonuski-chat__send {
    background: var(--bki-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    width: 40px; height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.bonuski-chat__send:hover { filter: brightness(1.08); }
.bonuski-chat__send:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 520px) {
    .bonuski-chat__launcher span { display: none; }
    .bonuski-chat__launcher { padding: 14px; }
    .bonuski-chat__window {
        bottom: 0; right: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}
