/* Ki Chat Widget Styles */
:root {
    --ki-primary-color: #28a745;
    --ki-text-color: #333;
    --ki-bg-color: #fff;
    --ki-border-color: #ddd;
    --ki-shadow: 0 5px 15px rgba(0,0,0,0.1);
    --ki-radius: 12px;
    --ki-header-height: 50px;
    --ki-footer-height: 60px;
}

[data-tooltip] {
    position: relative;
    cursor: pointer;
}

/* Der eigentliche Tooltip */
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
}

/* Tooltip anzeigen bei Hover */
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

.aiIconContainer {
    position: Fixed;
    bottom: 20px;
    left:50%;
    transform: translateX(-50%);
    height: 100px;
    width: 100px;
    z-index: 1000;
}

.aiIcon {
    width: 100%;
    height: 100%;
    transition: all 1s ease-in-out;
    transform: scale(var(--scale, 1));
    filter: brightness(var(--brightness, 1));
    opacity: 0.7;
    cursor: pointer;
}

/* Chat Button */
/*.ki-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background-color: var(--ki-primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--ki-shadow);
    border: none;
    font-size: 24px;
    transition: all 0.3s ease;
    z-index: 9999;
}

.ki-chat-button:hover {
    transform: scale(1.05);
}

.ki-chat-icon::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}
*/

.ki-close-icon::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}
svg#svg_send_icon {
    height: 30px;
}

/* Chat Widget */
.ki-chat-widget {
    position: fixed;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 10%, rgba(255, 255, 255, 0.8) 20%, rgba(255, 255, 255, 0.8) 90%, rgba(255, 255, 255, 0.2) 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 1s ease;
    z-index: 999;
    height: 100vh;
}

.ki-widget-hidden {
    /*transform: translateY(100%);*/
    opacity: 0;
    pointer-events: none;
}

/* Chat Widget Header */
.ki-chat-header {
    height: 100px;
    background: linear-gradient(to bottom, white, transparent);
    position: fixed;
    width: 100%;
    z-index: 1;
    top: 50px;
}

.ki-chat-actions {
    position: absolute;
    top: 10px;
    right: 10px;
}

.ki-chat-action-button {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 5px;
    font-size: 18px;
    transition: transform 0.2s;
}

.ki-chat-action-button:hover {
    transform: scale(1.1);
}

/* Chat Widget Body */
.ki-chat-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px 20%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 50px;
    margin-bottom: 140px;
    padding-bottom: 50px;
    padding-top: 100px;
}

/* Chat Messages */
.ki-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    line-height: 1.5;
    font-size: 14px;
}

.ki-user-message {
    align-self: flex-end;
    background-color: #29ede7;
    border-bottom-right-radius: 4px;
    color: #333;
}

.ki-assistant-message {
    align-self: flex-start;
    background-color: #f5f5f5;
    border-bottom-left-radius: 4px;
    color: #333;
}

.ki-message-time {
    font-size: 10px;
    color: #333;
    margin-top: 4px;
    text-align: right;
}

/* Chat Widget Footer */
.ki-chat-footer {
    height: 200px;
    position: fixed;
    align-items: center;
    padding: 10px 20%;
    bottom: 0px;
    width: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 10%),rgba(255, 255, 255, 1) 60%,rgba(255, 255, 255, 0) 100%));
}

.ki-chat-input-container {
    width: 100%;
    height: 50px;
    margin-top: 20px;
    gap: 10px;
    display: flex;
    position: relative;
}

.ki-chat-input {
    flex-grow: 1;
    border: 1px solid var(--ki-border-color);
    border-radius: 20px;
    padding: 8px 15px !important;
    outline: none;
    transition: border-color 0.3s;
}

.ki-chat-input:focus {
    border-color: var(--ki-primary-color);
}

.ki-send-button {
    width: 50px;
    height: 50px;
    border-radius: 20px;
    background-color: #29ede7;;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s;
    position: absolute;
    right: 0px;
    border: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.ki-send-button:hover {
    transform: scale(1.05);
}

.ki-send-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Typing indicator */
.ki-typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-radius: 18px;
    align-self: flex-start;
    max-width: 65px;
}

.ki-typing-dot {
    width: 8px;
    height: 8px;
    background-color: #999;
    border-radius: 50%;
    animation: kiTypingAnimation 1.4s infinite ease-in-out;
}

.ki-typing-dot:nth-child(1) { animation-delay: 0s; }
.ki-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ki-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes kiTypingAnimation {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}


.ki-loading-indicator {
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    text-align: center;
    color: #666;
    font-size: 12px;
    margin: 10px auto;
    width: fit-content;
}

.ki-no-more-messages {
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    text-align: center;
    color: #666;
    font-size: 12px;
    margin: 10px auto;
    width: fit-content;
}

/* Responsive */
@media (max-width: 480px) {
    .ki-chat-widget {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .ki-chat-button {
        bottom: 20px;
        right: 20px;
    }
}