/* ChatBot Plugin Frontend Styles */

.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    display: none;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

.chatbot-header {
    background: #0073aa;
    color: white;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
    max-height: 350px;
}

.chatbot-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.chatbot-bot-message .message-content {
    background: #0073aa;
    color: white;
    padding: 10px 15px;
    border-radius: 18px 18px 18px 4px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

.chatbot-user-message .message-content {
    background: #e3f2fd;
    color: #333;
    padding: 10px 15px;
    border-radius: 18px 18px 4px 18px;
    max-width: 80%;
    margin-left: auto;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

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

.chatbot-user-message .message-time {
    text-align: right;
    margin-right: 5px;
    margin-left: auto;
}

.chatbot-input-container {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.chatbot-send {
    padding: 10px 15px;
    border-radius: 20px;
    border: none;
    background: #0073aa;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    font-family: inherit;
}

.chatbot-send:hover {
    background: #005a87;
}

.chatbot-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ChatBot Toggle Button */
.chatbot-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.chatbot-toggle-btn:hover {
    background: #005a87;
    transform: scale(1.1);
}

.chatbot-toggle-btn.active {
    background: #dc3545;
}

/* Dark theme for frontend */
.chatbot-widget.dark-theme {
    background: #2c3e50;
    color: #ecf0f1;
    border-color: #4a5f7a;
}

.chatbot-widget.dark-theme .chatbot-header {
    background: #34495e;
}

.chatbot-widget.dark-theme .chatbot-messages {
    background: #34495e;
}

.chatbot-widget.dark-theme .chatbot-bot-message .message-content {
    background: #3498db;
}

.chatbot-widget.dark-theme .chatbot-user-message .message-content {
    background: #95a5a6;
    color: #2c3e50;
}

.chatbot-widget.dark-theme .chatbot-input {
    background: #34495e;
    border-color: #4a5f7a;
    color: #ecf0f1;
}

.chatbot-widget.dark-theme .chatbot-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 1px #3498db;
}

.chatbot-widget.dark-theme .chatbot-input-container {
    border-color: #4a5f7a;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .chatbot-widget {
        width: calc(100vw - 40px);
        height: calc(100vh - 40px);
        bottom: 10px;
        right: 10px;
        left: 10px;
        top: 10px;
    }
    
    .chatbot-toggle-btn {
        bottom: 10px;
        right: 10px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* Animation for widget appearance */
.chatbot-widget {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading indicator */
.chatbot-typing {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #f0f0f0;
    border-radius: 18px;
    max-width: 80px;
    margin-bottom: 15px;
}

.chatbot-typing span {
    height: 8px;
    width: 8px;
    background: #999;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    animation: typing 1.4s infinite ease-in-out;
}

.chatbot-typing span:nth-child(1) {
    animation-delay: -0.32s;
}

.chatbot-typing span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}