/* Color Themes */
:root {
    --chatbot-color-1: #667eea;
    --chatbot-color-2: #764ba2;
}

body.chatbot-color-purple {
    --chatbot-color-1: #667eea;
    --chatbot-color-2: #764ba2;
}

body.chatbot-color-blue {
    --chatbot-color-1: #4facfe;
    --chatbot-color-2: #00f2fe;
}

body.chatbot-color-green {
    --chatbot-color-1: #56ab2f;
    --chatbot-color-2: #a8e063;
}

body.chatbot-color-red {
    --chatbot-color-1: #eb3349;
    --chatbot-color-2: #f45c43;
}

body.chatbot-color-orange {
    --chatbot-color-1: #f46b45;
    --chatbot-color-2: #eea849;
}

body.chatbot-color-pink {
    --chatbot-color-1: #ff6a88;
    --chatbot-color-2: #ff99ac;
}

body.chatbot-color-teal {
    --chatbot-color-1: #11998e;
    --chatbot-color-2: #38ef7d;
}

body.chatbot-color-indigo {
    --chatbot-color-1: #4776e6;
    --chatbot-color-2: #8e54e9;
}

body.chatbot-color-black {
    --chatbot-color-1: #2c3e50;
    --chatbot-color-2: #34495e;
}

body.chatbot-color-white {
    --chatbot-color-1: #ffffff;
    --chatbot-color-2: #f8f9fa;
}

/* Toggle Button */
.chatbot-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--chatbot-color-1) 0%, var(--chatbot-color-2) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: pulse 3s infinite;
}

body.chatbot-color-white .chatbot-toggle-btn {
    color: #333;
    border: 2px solid #e0e0e0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.chatbot-toggle-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.6);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.chatbot-icon {
    font-size: 24px;
}

/* Container */
#chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    transition: all 0.3s ease;
    overflow: hidden;
}

#chatbot-container.chatbot-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-color-1) 0%, var(--chatbot-color-2) 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

body.chatbot-color-white .chatbot-header {
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.chatbot-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.chatbot-color-white .chatbot-close-btn {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.chatbot-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.chatbot-message {
    margin-bottom: 15px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.user {
    text-align: right;
}

.chatbot-message.bot {
    text-align: left;
}

.chatbot-message-content {
    display: inline-block;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.5;
}

.chatbot-message.user .chatbot-message-content {
    background: linear-gradient(135deg, var(--chatbot-color-1) 0%, var(--chatbot-color-2) 100%);
    color: white;
}

body.chatbot-color-white .chatbot-message.user .chatbot-message-content {
    color: #333;
    border: 2px solid #e0e0e0;
    background: white;
}

.chatbot-message.bot .chatbot-message-content {
    background: white;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Input Area */
.chatbot-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

#chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
    background: white;
    outline: none;
    transition: border 0.3s ease;
}

#chatbot-input::placeholder {
    color: #999;
}

#chatbot-input:focus {
    border-color: var(--chatbot-color-1);
}

.chatbot-send-btn, .chatbot-voice-btn {
    background: linear-gradient(135deg, var(--chatbot-color-1) 0%, var(--chatbot-color-2) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.chatbot-color-white .chatbot-send-btn,
body.chatbot-color-white .chatbot-voice-btn {
    color: #333;
    border: 2px solid #e0e0e0;
    background: white;
}

.chatbot-send-btn:hover, .chatbot-voice-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.chatbot-voice-btn.listening {
    background: #ff4757 !important;
    animation: pulse-red 1s infinite;
}

@keyframes pulse-red {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--chatbot-color-1);
    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); opacity: 0.5; }
    30% { transform: translateY(-10px); opacity: 1; }
}

/* Scrollbar */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--chatbot-color-1);
    border-radius: 3px;
}

/* Mobile */
@media (max-width: 768px) {
    #chatbot-container {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
        bottom: 90px;
        height: 500px;
    }
    
    .chatbot-toggle-btn {
        right: 15px;
        bottom: 15px;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .chatbot-icon {
        font-size: 20px;
    }
}