/* Container */
#kk-ai-chat {
    max-width: 500px;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    background: #fff;
}

/* Header */
#kk-ai-chat-header {
    background: linear-gradient(135deg, #8b0000, #000);
    color: #fff;
    padding: 14px 18px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Nachrichtenbereich */
#kk-ai-chat-messages {
    height: 350px;
    overflow-y: auto;
    padding: 16px;
    background: #f7f7f7;
}

/* Nachricht Container */
.kk-ai-msg {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
}

/* User Nachricht */
.kk-ai-user {
    align-items: flex-end;
}
.kk-ai-user .bubble {
    background: #c62828; /* Liga-Rot */
    color: #fff;
    border-radius: 18px 18px 0 18px;
    padding: 10px 14px;
    max-width: 75%;
    word-wrap: break-word;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Bot Nachricht */
.kk-ai-bot {
    align-items: flex-start;
}
.kk-ai-bot .bubble {
    background: #e5e5e5;
    color: #222;
    border-radius: 18px 18px 18px 0;
    padding: 10px 14px;
    max-width: 75%;
    word-wrap: break-word;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Formular unten
   -> jetzt mit Padding, gap und vertikal zentriert,
      damit das Eingabefeld nicht direkt am Rand klebt */
#kk-ai-chat-form {
    display: flex;
    align-items: center;
    gap: 10px;                 /* Abstand zwischen Input und Button */
    border-top: 1px solid #ddd;
    background: #fff;
    padding: 10px;             /* Abstand links/rechts/unten/oben */
}

/* Eingabe
   -> vom input zum textarea gewechselt (im HTML!)
   -> mit Rand, abgerundet und automatisch wachsend (per JS) */
#kk-ai-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 18px;
    padding: 10px 14px;
    font-size: 15px;
    line-height: 1.4;
    min-height: 38px;          /* passt zur Button-Höhe */
    max-height: 160px;         /* damit es nicht unendlich wird */
    resize: none;              /* User soll nicht per Maus ziehen */
    background: #fff;
}
#kk-ai-chat-input:focus {
    outline: none;
    border-color: #c62828;
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.08);
}

/* Senden-Button */
#kk-ai-chat-form button {
    border: none;
    background: #8b0000; /* Liga-Rot */
    color: white;
    width: 52px;
    height: 38px;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
#kk-ai-chat-form button:hover {
    background: #a00000;
}

/* Tipp-Indikator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 10px 14px;
    background: #e5e5e5;
    border-radius: 18px 18px 18px 0;
    font-size: 14px;
    color: #555;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #555;
    border-radius: 50%;
    display: inline-block;
    animation: blink 1.4s infinite both;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0% { opacity: .2; }
    20% { opacity: 1; }
    100% { opacity: .2; }
}
