/* Custom Chatbot Styles */
#custom-chatbot-widget {
    position: fixed;
    width: 380px;
    height: 600px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Position Classes */
#custom-chatbot-widget.custom-chatbot-bottom-right {
    bottom: 20px;
    right: 20px;
}

#custom-chatbot-widget.custom-chatbot-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Minimized State */
#custom-chatbot-widget.minimized {
    height: 60px;
    width: 300px;
}

#custom-chatbot-widget.minimized .chatbot-body {
    display: none;
}

#custom-chatbot-widget.minimized .chatbot-toggle .chatbot-expand {
    display: inline;
}

#custom-chatbot-widget.minimized .chatbot-toggle .chatbot-minimize {
    display: none;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background-color 0.2s ease;
}

.chatbot-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-toggle .chatbot-expand {
    display: none;
}

/* Body */
.chatbot-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
}

.chat-message {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.4;
    animation: messageAppear 0.3s ease-out;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background: #007cba;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.bot-message {
    background: white;
    border: 1px solid #e0e0e0;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.typing-indicator {
    background: #f1f3f4;
    color: #666;
    font-style: italic;
}

/* Input Area */
.chatbot-input-area {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
    display: flex;
    gap: 12px;
    align-items: center;
}

.chatbot-user-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.chatbot-user-input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.chatbot-send-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-send-btn:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-1px);
}

.chatbot-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.chatbot-send-btn .loading-spinner {
    display: none;
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive Design */
@media (max-width: 768px) {
    #custom-chatbot-widget {
        width: calc(100vw - 40px);
        height: 70vh;
        bottom: 0;
        right: 0;
        left: 0;
        margin: 0 auto;
        border-radius: 12px 12px 0 0;
    }
    
    #custom-chatbot-widget.minimized {
        width: calc(100vw - 40px);
        height: 60px;
        bottom: 0;
    }
    
    #custom-chatbot-widget.custom-chatbot-bottom-right,
    #custom-chatbot-widget.custom-chatbot-bottom-left {
        bottom: 0;
        right: 0;
        left: 0;
        margin: 0 auto;
    }
    
    .chatbot-messages {
        padding: 15px;
    }
    
    .chatbot-input-area {
        padding: 15px;
    }
}