/**
 * AI Chatbot Assistant Styles
 */

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

/* Toggle Button */
.ai-chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    position: relative;
    color: white;
}

.ai-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.ai-chatbot-toggle:active {
    transform: scale(0.95);
}

.ai-chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff4757;
    border-radius: 50%;
    border: 2px solid white;
    display: none;
}

.ai-chatbot-badge.active {
    display: block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Chat Window */
.ai-chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

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

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

.ai-chatbot-status {
    margin: 4px 0 0 0;
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    display: inline-block;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.ai-chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    color: white;
}

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

/* Messages Container */
.ai-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

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

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

/* Chat Messages */
.ai-chat-message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease-out;
}

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

.ai-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.ai-chat-message-user .ai-message-avatar {
    background: #e9ecef;
    color: #495057;
}

.ai-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 70%;
    line-height: 1.5;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    white-space: pre-wrap;
}

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

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

/* Typing Indicator */
.ai-typing-indicator {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease-out;
}

.ai-typing-dots {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ai-typing-dots span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

.ai-typing-dots 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;
    }
}

/* Input Container */
.ai-chatbot-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

.ai-chatbot-input {
    flex: 1;
    border: 1px solid #e9ecef;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

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

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

.ai-chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ai-chatbot-send:active {
    transform: scale(0.95);
}

/* Suggestions */
.ai-chatbot-suggestions {
    padding: 12px 20px 16px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-suggestion-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #495057;
}

.ai-suggestion-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-chatbot-window {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .ai-chatbot-toggle {
        bottom: 15px;
        right: 15px;
        width: 56px;
        height: 56px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ai-chatbot-window {
        background: #1e1e1e;
    }

    .ai-chatbot-messages {
        background: #2d2d2d;
    }

    .ai-message-content {
        background: #3d3d3d;
        color: #e0e0e0;
    }

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

    .ai-chatbot-input-container {
        background: #1e1e1e;
        border-top-color: #3d3d3d;
    }

    .ai-chatbot-input {
        background: #2d2d2d;
        border-color: #3d3d3d;
        color: #e0e0e0;
    }

    .ai-chatbot-suggestions {
        background: #1e1e1e;
        border-top-color: #3d3d3d;
    }

    .ai-suggestion-btn {
        background: #2d2d2d;
        border-color: #3d3d3d;
        color: #e0e0e0;
    }

    .ai-suggestion-btn:hover {
        background: #3d3d3d;
        border-color: #667eea;
        color: #667eea;
    }

    .ai-typing-dots {
        background: #3d3d3d;
    }

    .ai-chat-message-user .ai-message-avatar {
        background: #3d3d3d;
        color: #e0e0e0;
    }
}

/* Accessibility improvements */
.ai-chatbot-toggle:focus,
.ai-chatbot-close:focus,
.ai-chatbot-send:focus,
.ai-suggestion-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.ai-chatbot-input:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
