/**
 * AI Chatbot Styles
 */

/* Container */
#ai-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Toggle Button */
.ai-chatbot-toggle {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    padding: 0;
    overflow: visible !important;
}

.ai-chatbot-toggle svg {
    pointer-events: none;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    display: block;
}

.ai-chatbot-toggle svg path {
    fill: white !important;
    stroke: white !important;
}

.ai-chatbot-icon-text {
    font-size: 28px !important;
    line-height: 1 !important;
    display: block !important;
}

.ai-chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ai-chatbot-toggle:active {
    transform: scale(0.95);
}

/* Notification Badge */
.ai-chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chat Window */
.ai-chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.ai-chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.ai-chatbot-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.ai-chatbot-close:hover {
    opacity: 1;
}

/* Messages Container */
.ai-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f7f7f7;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Scrollbar */
.ai-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.ai-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Message */
.ai-chatbot-message {
    display: flex;
    margin-bottom: 4px;
}

.ai-chatbot-message-content {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Bot Message */
.ai-chatbot-message-bot .ai-chatbot-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* User Message */
.ai-chatbot-message-user {
    justify-content: flex-end;
}

.ai-chatbot-message-user .ai-chatbot-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

/* Links in messages */
.ai-chatbot-message-content a {
    color: inherit;
    text-decoration: underline;
}

.ai-chatbot-message-bot .ai-chatbot-message-content a {
    color: #667eea;
}

/* Typing Indicator */
.ai-chatbot-typing {
    padding: 0 20px 10px;
    background: #f7f7f7;
}

.ai-chatbot-typing span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    margin-right: 4px;
    animation: typing 1.4s infinite;
}

.ai-chatbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-chatbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Schedule Demo Button */
.ai-chatbot-schedule-wrapper {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #eee;
}

.ai-chatbot-schedule-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chatbot-schedule-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ai-chatbot-schedule-btn:active {
    transform: translateY(0);
}

/* Quick Replies */
.ai-chatbot-quick-replies {
    padding: 10px 16px 0;
    background: white;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-chatbot-quick-reply-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 16px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
}

.ai-chatbot-quick-reply-btn:hover {
    background: #e0e0e0;
    border-color: #ccc;
    transform: translateY(-1px);
}

.ai-chatbot-quick-reply-btn:active {
    transform: translateY(0);
}

/* Input Form */
.ai-chatbot-form {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: white;
    border-top: 1px solid #eee;
}

.ai-chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ai-chatbot-input:focus {
    border-color: #667eea;
}

.ai-chatbot-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #999;
}

.ai-chatbot-send:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.ai-chatbot-transcript-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: white;
}

.ai-chatbot-transcript-btn span {
    font-size: 22px;
    line-height: 1;
    display: block;
}

.ai-chatbot-transcript-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.ai-chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-chatbot-send:hover {
    transform: scale(1.05);
}

.ai-chatbot-send:active {
    transform: scale(0.95);
}

/* Footer */
.ai-chatbot-footer {
    padding: 8px 16px;
    text-align: center;
    background: #f7f7f7;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 11px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ai-chatbot-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    #ai-chatbot-container {
        bottom: 15px;
        right: 15px;
    }
    
    .ai-chatbot-toggle {
        width: 56px;
        height: 56px;
    }
}

/* Lead Capture Form */
.ai-chatbot-lead-form {
    background: #f9f9f9;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.ai-chatbot-lead-message {
    margin-bottom: 15px;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.ai-chatbot-lead-input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ai-chatbot-lead-input:focus {
    border-color: #667eea;
}

.ai-chatbot-lead-submit,
.ai-chatbot-lead-skip {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 8px;
}

.ai-chatbot-lead-submit {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.ai-chatbot-lead-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.ai-chatbot-lead-skip {
    background: transparent;
    color: #666;
    font-size: 13px;
}

.ai-chatbot-lead-skip:hover {
    color: #333;
    text-decoration: underline;
}

/* Accessibility */
.ai-chatbot-toggle:focus,
.ai-chatbot-close:focus,
.ai-chatbot-send:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-chatbot-window {
    animation: slideUp 0.3s ease;
}

