/* ════════════════════════════════════════
   Lilledekohus Chatbot — Storefront CSS
   Horizon-Theme Style · passt zu Stempel-Konfigurator
   ════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

#lh-chatbot {
    --lh-pink: #e8919a;
    --lh-pink-dark: color-mix(in srgb, var(--lh-pink) 85%, #000 15%);
    --lh-pink-soft: color-mix(in srgb, var(--lh-pink) 15%, #fff 85%);
    --lh-black: #1a1a1a;
    --lh-gray-light: #f5f5f5;
    --lh-gray: #e0e0e0;
    --lh-gray-mid: #9e9e9e;
    --lh-white: #ffffff;
    --lh-radius-lg: 10px;
    --lh-radius: 6px;
    --lh-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --lh-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.16);
    --lh-font: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --lh-transition: 0.2s ease;
    font-family: var(--lh-font);
    color: var(--lh-black);
}

/* ── Launcher ────────────────────────────── */
.lh-chatbot-launcher {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 9998;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--lh-pink);
    border: none;
    box-shadow: 0 8px 24px rgba(232, 145, 154, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--lh-transition), box-shadow var(--lh-transition);
    padding: 0;
    overflow: visible;
}
.lh-chatbot-launcher:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 30px rgba(232, 145, 154, 0.6);
}
.lh-chatbot-launcher-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}
.lh-chatbot-launcher-emoji {
    font-size: 28px;
    line-height: 1;
}
.lh-chatbot-launcher-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background: #4ade80;
    border: 2px solid var(--lh-white);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
    animation: lh-pulse 2s infinite;
}
@keyframes lh-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25); }
    50% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0.15); }
}

/* Launcher ausblenden wenn Panel offen */
#lh-chatbot.lh-open .lh-chatbot-launcher { display: none; }

/* ── Teaser-Sprechblase ──────────────────── */
.lh-chatbot-teaser {
    position: fixed;
    bottom: 108px;
    right: 96px;
    z-index: 9997;
    background: var(--lh-white);
    color: var(--lh-black);
    padding: 12px 36px 12px 16px;
    border-radius: 18px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    font-family: var(--lh-font);
    font-size: 14px;
    font-weight: 600;
    max-width: 240px;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(8px) scale(0.92);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.lh-chatbot-teaser::after {
    content: '';
    position: absolute;
    bottom: 14px;
    right: -6px;
    width: 14px;
    height: 14px;
    background: var(--lh-white);
    transform: rotate(45deg);
    box-shadow: 3px -3px 6px rgba(0, 0, 0, 0.05);
}
.lh-chatbot-teaser.lh-teaser-show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    cursor: pointer;
}
.lh-chatbot-teaser-close {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    color: var(--lh-gray-mid);
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
    transition: background var(--lh-transition), color var(--lh-transition);
}
.lh-chatbot-teaser-close:hover {
    background: var(--lh-gray-light);
    color: var(--lh-black);
}

#lh-chatbot.lh-open .lh-chatbot-teaser { display: none; }

/* ── Panel ────────────────────────────────── */
.lh-chatbot-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 48px);
    background: var(--lh-white);
    border-radius: var(--lh-radius-lg);
    box-shadow: var(--lh-shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: lh-slide-up 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
#lh-chatbot.lh-open .lh-chatbot-panel {
    display: flex;
}
@keyframes lh-slide-up {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ───────────────────────────────── */
.lh-chatbot-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--lh-white);
    border-bottom: 1px solid var(--lh-gray);
}
.lh-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--lh-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(232, 145, 154, 0.3);
}
.lh-chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lh-chatbot-head-text { flex: 1; min-width: 0; }
.lh-chatbot-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--lh-black);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}
.lh-chatbot-ki-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 10px;
    background: var(--lh-black);
    color: var(--lh-white);
    text-transform: uppercase;
    white-space: nowrap;
}
.lh-chatbot-sub {
    font-size: 12px;
    color: var(--lh-gray-mid);
    font-weight: 500;
}
.lh-chatbot-status {
    font-size: 11px;
    font-weight: 600;
    color: var(--lh-gray-mid);
    display: flex;
    align-items: center;
    gap: 5px;
}
.lh-chatbot-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}
.lh-chatbot-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: var(--lh-gray-mid);
    cursor: pointer;
    border-radius: 50%;
    transition: background var(--lh-transition), color var(--lh-transition);
    padding: 0;
}
.lh-chatbot-close:hover {
    background: var(--lh-gray-light);
    color: var(--lh-black);
}

/* ── Messages ─────────────────────────────── */
.lh-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--lh-gray-light);
    scrollbar-width: thin;
    scrollbar-color: var(--lh-gray) transparent;
}
.lh-chatbot-messages::-webkit-scrollbar { width: 6px; }
.lh-chatbot-messages::-webkit-scrollbar-thumb { background: var(--lh-gray); border-radius: 3px; }

.lh-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
    white-space: pre-wrap;
    word-wrap: break-word;
    animation: lh-msg-in 0.25s ease-out;
}
@keyframes lh-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.lh-msg-bot {
    background: var(--lh-white);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: var(--lh-shadow);
}
.lh-msg-user {
    background: var(--lh-pink);
    color: var(--lh-white);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 600;
}
.lh-msg-typing {
    background: var(--lh-white);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: var(--lh-shadow);
    display: inline-flex;
    gap: 4px;
    padding: 13px 15px;
}
.lh-msg-typing span {
    width: 6px;
    height: 6px;
    background: var(--lh-pink);
    border-radius: 50%;
    animation: lh-bounce 1.2s infinite;
}
.lh-msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.lh-msg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes lh-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-6px); opacity: 1; }
}
.lh-msg-error {
    background: #ffe6e6;
    border: 1px solid #ffb3b3;
    color: #a00;
    align-self: stretch;
    font-size: 13px;
    border-radius: var(--lh-radius);
}

/* ── Input ────────────────────────────────── */
.lh-chatbot-input-row {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--lh-gray);
    background: var(--lh-white);
}
.lh-chatbot-input {
    flex: 1;
    padding: 11px 16px;
    border: 1px solid var(--lh-gray);
    border-radius: 24px;
    font-family: var(--lh-font);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: border-color var(--lh-transition);
}
.lh-chatbot-input:focus { border-color: var(--lh-pink); }
.lh-chatbot-send {
    width: 42px;
    height: 42px;
    background: var(--lh-pink);
    color: var(--lh-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--lh-transition), transform var(--lh-transition);
    flex-shrink: 0;
}
.lh-chatbot-send:hover:not(:disabled) {
    background: var(--lh-pink-dark);
    transform: translateY(-1px);
}
.lh-chatbot-send:disabled { opacity: 0.4; cursor: not-allowed; }
.lh-chatbot-send svg {
    width: 18px;
    height: 18px;
    transform: translate(-1px, 1px);
}

.lh-chatbot-footer {
    font-size: 10px;
    color: var(--lh-gray-mid);
    text-align: center;
    padding: 6px;
    background: var(--lh-white);
    border-top: 1px solid var(--lh-gray);
    font-weight: 600;
}

/* ── Mobile ───────────────────────────────── */
@media (max-width: 480px) {
    .lh-chatbot-panel {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    .lh-chatbot-launcher {
        bottom: 80px;
        right: 16px;
    }
    .lh-chatbot-teaser {
        bottom: 92px;
        right: 88px;
        max-width: 180px;
        font-size: 13px;
    }
}
