/* CHAT TRIGGER */
.chat-trigger {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 60px;
    height: 60px;
    background: var(--rot)!important;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(232, 54, 42, 0.4);
    transition: transform 0.2s;
}

.chat-trigger:hover {
    transform: scale(1.08);
}

.chat-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--rot);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    70% {
        opacity: 0;
        transform: scale(1.4);
    }

    100% {
        opacity: 0;
        transform: scale(1.4);
    }
}

/* CHAT PANEL */
.chat-panel {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 350px;
    height: 520px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    display: none;
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
}

.chat-panel.open {
    display: flex;
}

/* HEADER */
.chat-header {
    background: var(--rot);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.chat-header-title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.3em;
}

.chat-header-sub {
    font-size: 11px;
    opacity: 0.85;
    line-height: 1.3em;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.8;
    line-height: 1;
}

.chat-close:hover {
    opacity: 1;
}

/* MESSAGES */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.bubble.ki {
    background: var(--color-bg);
    color: var(--color-primary);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.bubble.user {
    background: var(--rot);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

/* TYPING */
.typing {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    background: var(--color-primary);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: 56px;
}

.typing span {
    width: 8px;
    height: 8px;
    background: #aaa;
    border-radius: 50%;
    animation: dot 1.2s infinite;
}

.typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}

/* SUMMARY */
.chat-summary {
    background: var(--grau);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.6;
    align-self: stretch;
}

.summary-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 6px;
    display: block;
}

.chat-contact-btn {
    display: block;
    background: var(--rot);
    color: white;
    text-align: center;
    text-decoration: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    margin-top: 10px;
}

.chat-contact-btn:hover {
    opacity: 0.88;
}

/* INPUT */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

#chatInput {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 9px 16px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

#chatInput:focus {
    border-color: var(--rot);
}

#sendBtn {
    width: 38px;
    height: 38px;
    background: var(--rot)!important;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

#sendBtn:hover {
    opacity: 0.85;
}

#sendBtn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* RESPONSIVE */
@media (max-width: 480px) {
    .chat-panel {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 90px;
    }

    .hero-cards {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .chat-trigger {
        bottom: 20px;
        right: 16px;
    }
}