/* Custom fix: floating chat bubble connected to an n8n webhook. Not part of the original IONOS export. */

:root {
    --cb-brand: #8d0c2c;
    --cb-brand-dark: #6b0921;
}

.cb-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background-color: var(--cb-brand);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
    transition: transform .2s ease, box-shadow .2s ease;
    border: 0;
}
.cb-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}
.cb-bubble svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

.cb-container {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 360px;
    height: 520px;
    background: #fff;
    border-radius: 14px;
    display: none;
    flex-direction: column;
    z-index: 10000;
    border: 1px solid #ddd;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    overflow: hidden;
    font-family: inherit;
}
.cb-container.cb-open {
    display: flex;
}

.cb-header {
    background-color: var(--cb-brand);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    flex-shrink: 0;
}
.cb-header-title {
    font-size: 14px;
}
.cb-clear {
    background-color: var(--cb-brand-dark);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
}
.cb-clear:hover {
    background-color: #4d0617;
}

.cb-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    overflow-y: auto;
    background-color: #f7f7f7;
}
.cb-msg-user,
.cb-msg-ia {
    max-width: 85%;
    padding: 8px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    white-space: pre-wrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}
.cb-msg-user {
    align-self: flex-end;
    background-color: var(--cb-brand);
    color: #fff;
    border-radius: 14px 14px 0 14px;
}
.cb-msg-ia {
    align-self: flex-start;
    background-color: #fff;
    color: #222;
    border-left: 4px solid var(--cb-brand);
    border-radius: 14px 14px 14px 0;
}
.cb-msg-ia.cb-error {
    border-left-color: #b00020;
    color: #b00020;
}
.cb-typing {
    align-self: flex-start;
    font-size: 12px;
    color: #999;
    padding: 0 4px;
}

.cb-input-row {
    padding: 10px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.cb-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
}
.cb-input:focus {
    border-color: var(--cb-brand);
}
.cb-send {
    width: 42px;
    height: 42px;
    min-width: 42px;
    background-color: var(--cb-brand);
    color: #fff;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .2s ease;
}
.cb-send:hover {
    background-color: var(--cb-brand-dark);
}
.cb-send svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}
.cb-send:disabled {
    opacity: .5;
    cursor: default;
}

@media (max-width: 480px) {
    .cb-bubble {
        right: 16px;
        bottom: 16px;
        width: 56px;
        height: 56px;
    }
    .cb-container {
        right: 8px;
        left: 8px;
        bottom: 84px;
        width: auto;
        top: 60px;
        height: auto;
        border-radius: 12px;
    }
}
