/* AI Chatbot WordPress Plugin Styles */

/* Widget Container */
.ai-chatbot-widget {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Position variants */
.ai-chatbot-bottom-right {
    bottom: 20px;
    right: 20px;
}

.ai-chatbot-bottom-left {
    bottom: 20px;
    left: 20px;
}

.ai-chatbot-top-right {
    top: 20px;
    right: 20px;
}

.ai-chatbot-top-left {
    top: 20px;
    left: 20px;
}

/* Toggle Button */
.ai-chatbot-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 140px;
}

.ai-chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.ai-chatbot-icon {
    font-size: 1.2em;
}

.ai-chatbot-title {
    font-size: 0.9em;
}

/* Chat Container */
.ai-chatbot-container {
    display: none;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.ai-chatbot-container.active {
    display: block;
}

/* Header */
.ai-chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
}

.ai-chatbot-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.ai-chatbot-header-title {
    font-size: 1.1em;
    font-weight: 600;
    flex: 1;
}

.ai-chatbot-model-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8em;
}

.ai-chatbot-model-selector label {
    font-weight: 500;
    white-space: nowrap;
}

.ai-chatbot-model-selector select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 120px;
}

.ai-chatbot-model-selector select:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-chatbot-model-selector select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
}

.ai-chatbot-model-selector select option {
    background: #4a5568;
    color: white;
}

.ai-chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.ai-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Area */
.ai-chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
    height: 350px;
    max-height: 350px;
}

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

.ai-chatbot-message.user {
    align-items: flex-end;
}

.ai-chatbot-message.bot {
    align-items: flex-start;
}

.ai-chatbot-message-content {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 0.9em;
}

.ai-chatbot-message.user .ai-chatbot-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-chatbot-message.bot .ai-chatbot-message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.ai-chatbot-model-info {
    font-size: 0.7em;
    color: #666;
    margin-top: 4px;
    font-style: italic;
    padding-left: 4px;
}

/* Input Area */
.ai-chatbot-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.ai-chatbot-input-group {
    display: flex;
    gap: 8px;
}

.ai-chatbot-message-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.9em;
    outline: none;
    transition: border-color 0.3s ease;
}

.ai-chatbot-message-input:focus {
    border-color: #667eea;
}

.ai-chatbot-send-button {
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: transform 0.2s ease;
    white-space: nowrap;
}

.ai-chatbot-send-button:hover {
    transform: translateY(-1px);
}

.ai-chatbot-send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ai-chatbot-loading {
    display: none;
    text-align: center;
    color: #666;
    font-style: italic;
    font-size: 0.85em;
    margin-top: 8px;
}

/* Theme Variants */
.ai-chatbot-dark .ai-chatbot-container {
    background: #2d3748;
    border-color: #4a5568;
}

.ai-chatbot-dark .ai-chatbot-messages {
    background: #1a202c;
}

.ai-chatbot-dark .ai-chatbot-message.bot .ai-chatbot-message-content {
    background: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
}

.ai-chatbot-dark .ai-chatbot-input {
    background: #2d3748;
    border-top-color: #4a5568;
}

.ai-chatbot-dark .ai-chatbot-message-input {
    background: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
}

.ai-chatbot-dark .ai-chatbot-message-input:focus {
    border-color: #667eea;
}

.ai-chatbot-light .ai-chatbot-container {
    background: #ffffff;
    border-color: #e2e8f0;
}

.ai-chatbot-light .ai-chatbot-messages {
    background: #f7fafc;
}

/* Responsive Design */
@media (max-width: 480px) {
    .ai-chatbot-container {
        width: 320px;
        height: 450px;
    }
    
    .ai-chatbot-messages {
        height: 300px;
        max-height: 300px;
    }
    
    .ai-chatbot-widget {
        bottom: 10px !important;
        right: 10px !important;
        left: 10px !important;
    }
    
    .ai-chatbot-toggle {
        min-width: auto;
        padding: 10px 16px;
    }
    
    .ai-chatbot-title {
        display: none;
    }
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-chatbot-container.active {
    animation: slideIn 0.3s ease-out;
}

/* Scrollbar Styling */
.ai-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

.ai-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Focus states for accessibility */
.ai-chatbot-toggle:focus,
.ai-chatbot-close:focus,
.ai-chatbot-send-button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Loading animation */
.ai-chatbot-loading.active {
    display: block;
}

/* Error states */
.ai-chatbot-error {
    color: #e53e3e;
    font-size: 0.85em;
    text-align: center;
    padding: 8px;
    background: #fed7d7;
    border-radius: 8px;
    margin: 8px 0;
} 