/* ============================================================
   Nachbrand AI Chat – Helpbot Inline-Widget
   Alle Styles unter .nbac-helpbot gescoped.
   Farben + Maße via CSS Custom Properties.
   ============================================================ */

.nbac-helpbot {
    width: var(--nbac-hb-width, 700px);
    max-width: 100%;
    background: var(--nbac-hb-bg, #1e1e1e);
    color: var(--nbac-hb-color, #ffffff);
    border-radius: var(--nbac-hb-radius, 12px);
    font-size: var(--nbac-hb-font, 14px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
}

/* ── Header ──────────────────────────────────────────────── */
.nbac-hb-header {
    padding: 14px 18px;
    font-weight: 600;
    font-size: calc(var(--nbac-hb-font, 14px) + 2px);
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

/* ── Nachrichtenbereich ──────────────────────────────────── */
.nbac-hb-messages {
    flex: 1;
    min-height: 280px;
    max-height: 480px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.nbac-hb-messages::-webkit-scrollbar {
    width: 5px;
}
.nbac-hb-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* ── Chat-Bubbles ────────────────────────────────────────── */
.nbac-hb-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: var(--nbac-hb-radius, 12px);
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.nbac-hb-bubble-bot {
    background: var(--nbac-hb-bot-bg, #2a2a2a);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.nbac-hb-bubble-user {
    background: var(--nbac-hb-user-bg, #3a3a5c);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Tipp-Indikator */
.nbac-hb-typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin: 0 2px;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.4;
    animation: nbac-hb-bounce 1.2s infinite;
}
.nbac-hb-typing span:nth-child(2) { animation-delay: 0.2s; }
.nbac-hb-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes nbac-hb-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40%            { transform: translateY(-6px); opacity: 1; }
}

/* ── Eingabebereich ──────────────────────────────────────── */
.nbac-hb-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    flex-shrink: 0;
}

.nbac-hb-input {
    flex: 1;
    resize: none;
    background: transparent;
    color: inherit;
    border: none;
    outline: none;
    font-size: inherit;
    font-family: inherit;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
    padding: 4px 0;
}

.nbac-hb-input::placeholder {
    opacity: 0.5;
}

.nbac-hb-send {
    background: var(--nbac-hb-btn-bg, #0073aa);
    color: var(--nbac-hb-btn-color, #ffffff);
    border: none;
    border-radius: calc(var(--nbac-hb-radius, 12px) - 4px);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.nbac-hb-send:hover:not(:disabled) {
    opacity: 0.85;
}

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

/* ── Gesperrt-Hinweis ────────────────────────────────────── */
.nbac-hb-blocked {
    padding: 10px 16px;
    font-size: 13px;
    opacity: 0.7;
    text-align: center;
    flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .nbac-helpbot {
        border-radius: calc(var(--nbac-hb-radius, 12px) / 2);
    }
    .nbac-hb-bubble {
        max-width: 92%;
    }
}
