/* ============================================
   Chatbot Widget - Gasthof Siebenstern
   ============================================ */

#chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Lato', sans-serif;
}

/* Toggle Button */
#chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #2C5530;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease;
    margin-left: auto;
}

#chatbot-toggle:hover {
    transform: scale(1.1);
    background: #1e3d22;
}

#chatbot-toggle svg {
    width: 28px;
    height: 28px;
    fill: white;
}

#chatbot-toggle .close-icon { display: none; }
#chatbot-toggle.open .chat-icon { display: none; }
#chatbot-toggle.open .close-icon { display: block; }

/* Notification Badge */
#chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: white;
    font-weight: bold;
}

/* Chat Window */
#chatbot-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 360px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideIn 0.3s ease;
}

#chatbot-window.visible {
    display: flex;
}

@keyframes chatSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
#chatbot-header {
    background: linear-gradient(135deg, #2C5530, #1e3d22);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

#chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

#chatbot-header-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: white;
}

#chatbot-header-info p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.85;
    color: white;
}

/* Messages */
#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f5f0;
}

.chatbot-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    animation: msgFadeIn 0.2s ease;
}

@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chatbot-msg.bot {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    align-self: flex-start;
}

.chatbot-msg.user {
    background: #2C5530;
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.chatbot-msg.typing {
    background: white;
    align-self: flex-start;
    padding: 12px 16px;
}

.typing-dots span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2C5530;
    margin: 0 2px;
    animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* Input Area */
#chatbot-input-area {
    padding: 12px 16px;
    border-top: 1px solid #e8e0d5;
    display: flex;
    gap: 8px;
    background: white;
}

#chatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: 'Lato', sans-serif;
    outline: none;
    resize: none;
    max-height: 100px;
    transition: border-color 0.2s;
}

#chatbot-input:focus { border-color: #2C5530; }

#chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2C5530;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
    align-self: flex-end;
}

#chatbot-send:hover { background: #1e3d22; }
#chatbot-send svg { width: 18px; height: 18px; fill: white; }

/* Mobile */
@media (max-width: 480px) {
    #chatbot-widget { bottom: 20px; right: 15px; }
    #chatbot-window { width: calc(100vw - 30px); right: -15px; height: 450px; }
}
