/* AI Chatbot Widget Styles */
.ai-chatbot-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Position-specific styles */
.ai-chatbot-widget.ai-chatbot-bottom-right {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.ai-chatbot-widget.ai-chatbot-bottom-left {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
}

.ai-chatbot-widget.ai-chatbot-top-right {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.ai-chatbot-widget.ai-chatbot-top-left {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
}

/* Chat Button */
.ai-chatbot-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.ai-chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.ai-chatbot-button svg {
    width: 24px;
    height: 24px;
    fill: white;
    transition: transform 0.3s ease;
}

.ai-chatbot-button.active svg.chat-icon {
    transform: rotate(180deg) scale(0);
}

.ai-chatbot-button svg.close-icon {
    position: absolute;
    transform: rotate(180deg) scale(0);
    transition: transform 0.3s ease;
}

.ai-chatbot-button.active svg.close-icon {
    transform: rotate(0deg) scale(1);
}

/* Chat Window */
.ai-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.ai-chatbot-window.active {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

/* Size-specific styles */
.ai-chatbot-widget.ai-chatbot-small .ai-chatbot-window {
    width: 300px;
    height: 400px;
    max-height: calc(100vh - 120px);
}

.ai-chatbot-widget.ai-chatbot-medium .ai-chatbot-window {
    width: 350px;
    height: 500px;
    max-height: calc(100vh - 120px);
}

.ai-chatbot-widget.ai-chatbot-large .ai-chatbot-window {
    width: 400px;
    height: 600px;
    max-height: calc(100vh - 120px);
}

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

/* Chat Header */
.ai-chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

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

.ai-chatbot-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

/* Chat Messages */
.ai-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8f9fa;
    max-height: calc(100% - 140px);
    min-height: 200px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.ai-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

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

.ai-chatbot-message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ai-chatbot-message.user {
    flex-direction: row-reverse;
}

.ai-chatbot-message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

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

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

.ai-chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.ai-chatbot-message.user .ai-chatbot-message-avatar {
    background: #28a745;
}

/* Typing Indicator */
.ai-chatbot-typing {
    display: none;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.ai-chatbot-typing-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.ai-chatbot-typing-dots {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 18px;
    padding: 12px 16px;
}

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

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

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

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

/* Chat Input */
.ai-chatbot-chat-input {
    padding: 16px 20px;
    border-top: 1px solid #e1e5e9;
    background: white;
}

.ai-chatbot-input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ai-chatbot-chat-textarea {
    flex: 1;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    outline: none;
    min-height: 20px;
    max-height: 80px;
    transition: border-color 0.2s ease;
}

.ai-chatbot-chat-textarea:focus {
    border-color: #667eea;
}

.ai-chatbot-send-button {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.ai-chatbot-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-chatbot-send-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Quick Suggestions */
.ai-chatbot-quick-suggestions {
    padding: 0 20px 16px;
    background: white;
}

.ai-chatbot-suggestion {
    display: inline-block;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 6px 12px;
    margin: 4px 4px 4px 0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-chatbot-suggestion:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .ai-chatbot-window {
        width: calc(100vw - 40px) !important;
        height: calc(100vh - 140px) !important;
        max-height: calc(100vh - 140px) !important;
        bottom: 80px;
        right: 20px;
        left: 20px;
    }
    
    .ai-chatbot-widget.ai-chatbot-bottom-left .ai-chatbot-window,
    .ai-chatbot-widget.ai-chatbot-bottom-right .ai-chatbot-window {
        left: 20px;
        right: 20px;
    }
    
    .ai-chatbot-widget.ai-chatbot-top-left .ai-chatbot-window,
    .ai-chatbot-widget.ai-chatbot-top-right .ai-chatbot-window {
        left: 20px;
        right: 20px;
        top: 80px;
        bottom: auto;
    }
}

@media (max-height: 600px) {
    .ai-chatbot-window {
        height: calc(100vh - 140px) !important;
        max-height: calc(100vh - 140px) !important;
    }
}

/* Welcome Message */
.ai-chatbot-welcome-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

.ai-chatbot-welcome-message h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
}

.ai-chatbot-welcome-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}