/* ZudoZu Chatbot Styles */
#zudozu-chatbot {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: fixed;
    bottom: 110px;
    right: 20px;
    z-index: 999999;
}

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

.chatbot-toggle:hover {
    transform: scale(1.1);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
    color: #ffffff;
    transition: opacity 0.3s ease;
}

.chatbot-toggle .close-icon {
    position: absolute;
    opacity: 0;
}

.chatbot-toggle.active .chat-icon {
    opacity: 0;
}

.chatbot-toggle.active .close-icon {
    opacity: 1;
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 370px;
    height: 500px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-window.active {
    display: flex;
}

/* Header */
#zudozu-chatbot .chatbot-header {
    background: #000000 !important;
    color: #ffffff !important;
    padding: 10px 15px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-shrink: 0 !important;
    height: 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
    box-sizing: border-box !important;
}

#zudozu-chatbot .header-info {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    overflow: hidden !important;
    height: 40px !important;
}

#zudozu-chatbot .bot-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    display: inline-block !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    line-height: 0 !important;
}

#zudozu-chatbot .bot-avatar img {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
}

.bot-details {
    display: flex;
    flex-direction: column;
}

.bot-name {
    font-weight: 600;
    font-size: 15px;
}

.bot-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
}

.close-chat {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f5f5f5;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Messages */
.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

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

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #000000;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #e0e0e0;
    color: #333;
}

.message-content {
    background: #ffffff;
    padding: 12px 15px;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.bot .message-content {
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background: #000000;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-text a {
    color: #0066cc;
    text-decoration: underline;
}

.message.user .message-text a {
    color: #99ccff;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.message.user .message-time {
    color: rgba(255,255,255,0.7);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 5px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* Quick Replies */
.chatbot-quick-replies {
    padding: 10px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #ffffff;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.quick-reply {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-reply:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

/* Input Area - FIXED */
.chatbot-input {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #ffffff;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    align-items: center;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    padding: 12px 18px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
    color: #333333;
    min-width: 0;
    height: 45px;
    box-sizing: border-box;
}

.chatbot-input input:focus {
    border-color: #000000;
}

.chatbot-input input::placeholder {
    color: #999999;
}

#chatbot-send {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 50%;
    background: #000000;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#chatbot-send:hover {
    background: #333333;
}

#chatbot-send svg {
    width: 20px;
    height: 20px;
    color: #ffffff;
    fill: #ffffff;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #zudozu-chatbot {
        bottom: 80px;
        right: 10px;
        left: auto;
    }
    
    .chatbot-window {
        width: calc(100vw - 20px);
        height: 70vh;
        max-height: 500px;
        right: -10px;
        bottom: 70px;
    }
    
    .chatbot-toggle {
        width: 55px;
        height: 55px;
    }
    
    .chatbot-input input {
        padding: 10px 15px;
    }
}