/* Bot Support Styles */
.support-bot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 64px;
    height: 64px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    transition: all 0.3s ease;
}

.support-bot.bot-open {
    width: 350px;
    height: 500px;
    border-radius: 15px;
    transform: translateY(0);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Bot Bubble (khi đóng) */
.bot-bubble {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.bot-bubble .bubble-info {
    display: none;
}

.bot-bubble .bubble-toggle {
    background: none;
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Bot Header */
.bot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    display: none;
    align-items: center;
    justify-content: space-between;
    border-radius: 15px 15px 0 0;
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bubble-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.bubble-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bot-details {
    display: flex;
    flex-direction: column;
}

.bot-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 2px;
}

.bot-status {
    font-size: 12px;
    opacity: 0.8;
}

.bot-controls {
    display: flex;
    gap: 8px;
}

.bot-toggle {
    background: none;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.bot-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Bot Body */
.bot-body {
    display: none;
    height: calc(100% - 70px);
    flex-direction: column;
    background: #fff;
    transition: all 0.3s ease;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
}

.message {
    margin-bottom: 15px;
    max-width: 85%;
    word-wrap: break-word;
}

.user-message {
    margin-left: auto;
    text-align: right;
}

.bot-message {
    margin-right: auto;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    display: inline-block;
    max-width: 100%;
    line-height: 1.4;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Authentication Section */
.auth-section {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* Removed welcome message from CSS to prevent spam */

.auth-message {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
}

.auth-input-group, .otp-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.auth-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.auth-input:focus {
    outline: none;
    border-color: #667eea;
}

.auth-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Chat Input Section */
.chat-input-section {
    border-top: 1px solid #e9ecef;
    background: white;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    padding: 15px;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
}

.send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Chat Actions */
.chat-actions {
    padding: 10px 15px;
    border-top: 1px solid #f1f3f4;
    display: flex;
    justify-content: center;
}

.clear-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.clear-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .support-bot.bot-open {
        width: 320px;
        height: 450px;
        right: 10px;
        bottom: 10px;
    }
    
    .auth-input-group, .otp-input-group {
        flex-direction: column;
    }
    
    .auth-btn {
        width: 100%;
    }
    
    .chat-input-container {
        padding: 10px;
    }
    
    .chat-actions {
        padding: 8px 10px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .support-bot {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .bot-body {
        background: #34495e;
    }
    
    .chat-messages {
        background: #2c3e50;
    }
    
    .bot-message .message-content {
        background: #34495e;
        color: #ecf0f1;
        border-color: #4a5568;
    }
    
    .auth-section {
        background: #2c3e50;
        border-top-color: #4a5568;
    }
    
    .auth-message {
        background: #34495e;
        color: #ecf0f1;
        border-color: #4a5568;
    }
    
    .chat-input-section {
        background: #34495e;
        border-top-color: #4a5568;
    }
    
    .chat-input {
        background: #2c3e50;
        color: #ecf0f1;
        border-color: #4a5568;
    }
    
    .chat-actions {
        border-top-color: #4a5568;
    }
}

/* Animation for new messages */
.message {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

