/**
 * Tatjana AI Assistant - Chatbot Component
 * Floating AI chat interface for website visitors
 */

.tatjana-ai-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Launcher (label + button) - the part that slowly blinks while the chat is closed */
.tatjana-ai-launcher {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    animation: tatjana-ai-slow-blink 3.5s ease-in-out infinite;
}

.tatjana-ai-launcher.open {
    animation: none;
}

.tatjana-ai-launcher-label {
    background: white;
    color: #8f1a13;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.tatjana-ai-launcher.open .tatjana-ai-launcher-label {
    display: none;
}

@keyframes tatjana-ai-slow-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Chat Button */
.tatjana-ai-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b3230f 0%, #8f1a13 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(143, 26, 19, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.tatjana-ai-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(143, 26, 19, 0.6);
}

.tatjana-ai-chat-button svg {
    width: 30px;
    height: 30px;
    fill: white;
}

.tatjana-ai-chat-button .close-icon {
    display: none;
}

.tatjana-ai-chat-button.active .chat-icon {
    display: none;
}

.tatjana-ai-chat-button.active .close-icon {
    display: block;
}

/* Notification Badge */
.tatjana-ai-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff0000;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat Window */
.tatjana-ai-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.tatjana-ai-chat-window.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.tatjana-ai-chat-header {
    background: linear-gradient(135deg, #ff4a3d 0%, #ff6b5e 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tatjana-ai-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.tatjana-ai-header-info {
    flex: 1;
}

.tatjana-ai-header-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.tatjana-ai-header-subtitle {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

/* Chat Messages Area */
.tatjana-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.tatjana-ai-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tatjana-ai-message.user {
    flex-direction: row-reverse;
}

.tatjana-ai-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.tatjana-ai-message.assistant .tatjana-ai-message-avatar {
    background: linear-gradient(135deg, #ff4a3d 0%, #ff6b5e 100%);
    color: white;
}

.tatjana-ai-message.user .tatjana-ai-message-avatar {
    background: #6c757d;
    color: white;
}

.tatjana-ai-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
}

.tatjana-ai-message.assistant .tatjana-ai-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.tatjana-ai-message.user .tatjana-ai-message-content {
    background: #ff4a3d;
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.tatjana-ai-typing {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    max-width: fit-content;
}

.tatjana-ai-typing-dots {
    display: flex;
    gap: 4px;
}

.tatjana-ai-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4a3d;
    animation: typing 1.4s infinite;
}

.tatjana-ai-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.tatjana-ai-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-8px); }
}

/* Quick Actions */
.tatjana-ai-quick-actions {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tatjana-ai-quick-action {
    padding: 8px 14px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tatjana-ai-quick-action:hover {
    background: #ff4a3d;
    color: white;
    border-color: #ff4a3d;
}

/* Donation Button (matches the site nav's donation button styling) */
.tatjana-ai-donation-wrap {
    text-align: center;
    margin: 4px 0 12px 52px;
}

.tatjana-ai-donation-button {
    display: inline-block;
    background: white;
    color: red;
    border: 1px solid red;
    border-radius: 5px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tatjana-ai-donation-button:hover {
    background: #ffecec;
}

/* Input Area */
.tatjana-ai-input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    align-items: center;
}

.tatjana-ai-input {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.tatjana-ai-input:focus {
    border-color: #ff4a3d;
}

.tatjana-ai-send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4a3d 0%, #ff6b5e 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tatjana-ai-send-button:hover {
    transform: scale(1.05);
}

.tatjana-ai-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tatjana-ai-send-button svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Mic Button (voice input) */
.tatjana-ai-mic-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tatjana-ai-mic-button:hover {
    background: #ff4a3d;
    border-color: #ff4a3d;
}

.tatjana-ai-mic-button:hover svg {
    fill: white;
}

.tatjana-ai-mic-button svg {
    width: 18px;
    height: 18px;
    fill: #666;
    transition: fill 0.2s ease;
}

.tatjana-ai-mic-button.listening {
    background: #ff4a3d;
    border-color: #ff4a3d;
    animation: mic-pulse 1.4s ease-in-out infinite;
}

.tatjana-ai-mic-button.listening svg {
    fill: white;
}

@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 74, 61, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(255, 74, 61, 0); }
}

/* Welcome Message */
.tatjana-ai-welcome {
    text-align: center;
    padding: 40px 20px;
}

.tatjana-ai-welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.tatjana-ai-welcome-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.tatjana-ai-welcome-text {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* Scrollbar Styling */
.tatjana-ai-messages::-webkit-scrollbar {
    width: 6px;
}

.tatjana-ai-messages::-webkit-scrollbar-track {
    background: transparent;
}

.tatjana-ai-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.tatjana-ai-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .tatjana-ai-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        right: 10px;
        bottom: 80px;
    }
    
    .tatjana-ai-chatbot {
        bottom: 10px;
        right: 10px;
    }
}

/* Error Message */
.tatjana-ai-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin: 10px 0;
}
