/**
 * AI Pro Plugin - Chatbot Widget Styles
 *
 * Frontend chatbot widget styling
 *
 * @package    AI_Pro_Plugin
 */

.ai-pro-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Toggle Button */
.ai-pro-chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.ai-pro-chatbot-toggle:hover {
    background: #2563eb;
    transform: scale(1.1);
}

/* Chatbot Window */
.ai-pro-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.ai-pro-chatbot-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #3b82f6;
    color: white;
}

.ai-pro-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 12px;
}

.ai-pro-chatbot-info {
    flex: 1;
}

.ai-pro-chatbot-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-pro-chatbot-status {
    font-size: 12px;
    opacity: 0.9;
}

.ai-pro-chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
}

/* Messages */
.ai-pro-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
}

.ai-pro-chatbot-message {
    margin-bottom: 16px;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-pro-chatbot-message p {
    margin: 0;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
}

.ai-pro-bot-message p {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.ai-pro-user-message {
    text-align: right;
}

.ai-pro-user-message p {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

/* Input */
.ai-pro-chatbot-input {
    display: flex;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.ai-pro-chatbot-input-field {
    flex: 1;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
}

.ai-pro-chatbot-input-field:focus {
    border-color: #3b82f6;
}

.ai-pro-chatbot-send {
    margin-left: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-pro-chatbot-send:hover {
    background: #2563eb;
}

/* Typing indicator */
.ai-pro-typing-indicator {
    display: inline-block;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
}

.ai-pro-typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.ai-pro-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-pro-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .ai-pro-chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
    }
}
