/**
 * Chat-Widget Styles
 */

/* Widget Container */
.lkb-chat-widget {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.lkb-chat-widget.position-right {
    right: 20px;
}

.lkb-chat-widget.position-left {
    left: 20px;
}

/* Chat Button */
.lkb-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--lkb-primary-color, #0073aa);
    color: var(--lkb-secondary-color, #ffffff);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    outline: none;
}

.lkb-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.lkb-chat-button svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

/* Chat Container */
.lkb-chat-container {
    position: absolute;
    bottom: 80px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.position-right .lkb-chat-container {
    right: 0;
}

.position-left .lkb-chat-container {
    left: 0;
}

.lkb-chat-widget.active .lkb-chat-container {
    display: flex;
}

/* Chat Header */
.lkb-chat-header {
    background: var(--lkb-primary-color, #0073aa);
    color: var(--lkb-secondary-color, #ffffff);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lkb-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.lkb-close-chat {
    background: none;
    border: none;
    color: inherit;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.lkb-close-chat:hover {
    opacity: 1;
}

/* Messages Area */
.lkb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

/* Message Bubbles */
.lkb-message {
    margin-bottom: 15px;
    max-width: 80%;
    clear: both;
}

.lkb-message.bot {
    float: left;
}

.lkb-message.user {
    float: right;
}

.lkb-message-content {
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

.lkb-message.bot .lkb-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.lkb-message.user .lkb-message-content {
    background: var(--lkb-primary-color, #0073aa);
    color: var(--lkb-secondary-color, #ffffff);
    border-bottom-right-radius: 4px;
}

.lkb-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

/* Typing Indicator */
.lkb-typing-indicator {
    display: none;
    padding: 10px;
}

.lkb-typing-indicator.active {
    display: block;
}

.lkb-typing-dots {
    display: flex;
    align-items: center;
    gap: 5px;
}

.lkb-typing-dots span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    display: inline-block;
    animation: lkb-typing 1.4s infinite ease-in-out both;
}

.lkb-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.lkb-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes lkb-typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input Area */
.lkb-chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.lkb-chat-input-area input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s;
}

.lkb-chat-input-area input:focus {
    border-color: var(--lkb-primary-color, #0073aa);
}

.lkb-chat-input-area button {
    padding: 10px 20px;
    background: var(--lkb-primary-color, #0073aa);
    color: var(--lkb-secondary-color, #ffffff);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    white-space: nowrap;
}

.lkb-chat-input-area button:hover {
    opacity: 0.9;
}

.lkb-chat-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Fehlermeldungen */
.lkb-error {
    color: #d63638;
    font-size: 12px;
    padding: 5px 15px;
    background: #fcf0f1;
    border-top: 1px solid #f1c6c9;
}

/* Quellenangaben */
.lkb-sources {
    padding: 10px 15px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    font-size: 12px;
}

.lkb-sources p {
    margin: 0 0 5px 0;
    color: #666;
}

.lkb-sources ul {
    margin: 0;
    padding-left: 20px;
}

.lkb-sources a {
    color: var(--lkb-primary-color, #0073aa);
    text-decoration: none;
}

.lkb-sources a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 480px) {
    .lkb-chat-container {
        width: calc(100vw - 40px);
        height: calc(100vh - 150px);
        bottom: 100px;
    }
}